Postings

You can freely browse the forum and post in the community forum.
However, you need a valid license to write posts for support (own a valid commercial software license or have purchased a support membership).

Posts only show once reviewed. This is mainly preventive to keep spam away. Thank you for your understanding!

Bug (typo?) in code

  • who8
  • who8's Avatar Topic Author
  • New Member
  • New Member
More
IP: 195.241.201.202 14 years 7 months ago #271 by who8
Bug (typo?) in code was created by who8
hi,

Thanks for this plugin. It works great after a minor change. I think there's a bug although I'm not sure if it's intentional or not.

In jqueryeasy.php line 207 you have
Code:
$body = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n\']+/", "\n", $body);

while the original regex (I found it here programming-oneliners.blogspot.com/2006/...ty-lines-php-29.html ) is
Code:
preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $string);

That extra quote that you're replacing is causing code in Joomlart templates to break, because this
Code:
var megamenu = new jaMegaMenuMoo ('ja-megamenu', { 'bgopacity': 0, 'delayHide': 300, 'slide' : 0, 'fading' : 0, 'direction': 'down', 'action' : 'mouseover', 'tips' : false, 'duration' : 300, 'hidestyle': 'fastwhenshow' });

is replaced with this
Code:
var megamenu = new jaMegaMenuMoo ('ja-megamenu', { bgopacity': 0, delayHide': 300, slide' : 0, fading' : 0, direction': 'down', action' : 'mouseover', tips' : false, duration' : 300, hidestyle': 'fastwhenshow' });

Removing the quote or commenting out the line entirely fixed it for me.
The following user(s) said Thank You: admin
More
IP: 207.181.196.3 14 years 7 months ago #273 by admin
Replied by admin on topic Re: Bug (typo?) in code
I apologize for the late reply, I have been sick.
Thank you so much for sharing this, I probably have been a little overzealous in my regular expression.
It is a bug and I will issue a fix as soon as possible to benefit other users of your findings.

Olivier.