Are you enjoying the extensions? Did you like the support? Help others decide.

Leave a review

file Bug (typo?) in code

More
12 years 1 month 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
$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
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
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
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

Please Log in or Create an account to join the conversation.

More
12 years 1 month 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.

Please Log in or Create an account to join the conversation.