?
avatar nordmograph
nordmograph
17 May 2017

Steps to reproduce the issue

Updated from 3.7.0. to 3.7.1
Turn SEF off in Joomla config. Although in admin menu items edit pages the menu item url is set correctly with &. In the front end & are replaced with &breaking the variables and Itemid value, breaking modules affectations.

Expected result

index.php?option=com_content&view=categories&id=50&Itemid=288

Actual result

index.php?option=com_content&view=categories&id=50& amp;Itemid=288

System information (as much as possible)

PHP Version 7.0.18

Additional comments

Observed on 4 sites hosted on 2 different servers

avatar nordmograph nordmograph - open - 17 May 2017
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 May 2017
avatar nordmograph nordmograph - change - 17 May 2017
The description was changed
avatar nordmograph nordmograph - edited - 17 May 2017
avatar nordmograph nordmograph - change - 17 May 2017
The description was changed
avatar mbabker mbabker - change - 17 May 2017
The description was changed
avatar mbabker mbabker - edited - 17 May 2017
avatar nordmograph nordmograph - change - 17 May 2017
The description was changed
avatar nordmograph nordmograph - edited - 17 May 2017
avatar nordmograph nordmograph - change - 17 May 2017
The description was changed
avatar nordmograph nordmograph - change - 17 May 2017
The description was changed
avatar nordmograph nordmograph - edited - 17 May 2017
avatar nordmograph nordmograph - change - 17 May 2017
The description was changed
avatar ot2sen
ot2sen - comment - 17 May 2017

Tested using PHP 7.0.19 and do see the replacement but without the spacing you have.
Getting URLs like index.php?option=com_content&view=article&id=8&Itemid=116 which works.
Looks like & is kept in modules for example latest articles which doesnt replace & with & in the Url generated.

avatar nordmograph
nordmograph - comment - 17 May 2017

No the space is only here (in this topic) so the & amp; is not displayed here as a single &. I should have used code tags.
I get
index.php?option=com_content&view=categories&id=50&Itemid=288
instead of
index.php?option=com_content&view=categories&id=50&Itemid=288

avatar nordmograph nordmograph - change - 17 May 2017
The description was changed
avatar nordmograph nordmograph - edited - 17 May 2017
avatar nordmograph nordmograph - edited - 17 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 17 May 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 17 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 17 May 2017
Priority Urgent Medium
Status New Discussion
avatar PhilETaylor
PhilETaylor - comment - 17 May 2017

There were changes to ampReplace in Joomla 3.7.1

a7705bf#diff-17d077571f8b5fe34c3d9f7fec9a6e44

avatar PhilETaylor
PhilETaylor - comment - 17 May 2017

@wilsonge @mbabker The framework merge has broke this ...

avatar PhilETaylor
PhilETaylor - comment - 17 May 2017

try removing htmlspecialchars in the modules/mod_menu/tmpl/default_component.php file on line 52 to make that line:

echo JHtml::_('link', JFilterOutput::ampReplace($item->flink), $linktype, $attributes);

that fixes the issue I think

avatar mbabker
mbabker - comment - 17 May 2017

Give us a unit test case on the repo to work with then. joomla-framework/filter#22 didn't break the lone test case so if it can be proven that change broke it that will help us to fix it.

avatar PhilETaylor
PhilETaylor - comment - 17 May 2017

Give us a unit test case on the repo to work with then

Actually if you check I did actually contrib several more tests on this exact merge!

Im unclear what the exact problem is here, but the framework change broke joomla, but im not sure if thats cause joomla code was crap and the framework was not...

After being shot down repeatedly by certain senior project member telling me that unit tests are ******* Im in no rush to get out of bed and write more

avatar PhilETaylor
PhilETaylor - comment - 17 May 2017

Im thinking this is joomla, not the new ampReplace, as the input to the ampReplace method is:

index.php?option=com_content&view=article&id=1&Itemid=101

which is clearly wrong, so my suggestion here is probably right

avatar mbabker
mbabker - comment - 17 May 2017

Note to self, merge additional tests up...

avatar PhilETaylor
PhilETaylor - comment - 17 May 2017

Please test #16089 and see if that fixes your problem

These were the only 2 cases I could see where a htmlspecialchars was running before the ampReplace

avatar nordmograph
nordmograph - comment - 17 May 2017

I confirm that, as stated PhilETaylor, removing the htmlspecialchars from
modules/mod_menu/tmpl/default_component.php
and
modules/mod_menu/tmpl/default_url.php (for non absolut external url links)
fixes the issue.

avatar clausmunk
clausmunk - comment - 17 May 2017

Problem is also solved by simply undoing the change to OutputFilter::ampreplace

preg_replace parameters look wrong

avatar PhilETaylor
PhilETaylor - comment - 17 May 2017

Problem is also solved by simply undoing the change to OutputFilter::ampreplace

No that is the incorrect way forward. A step back.

The preg_replace is fine.

avatar franz-wohlkoenig franz-wohlkoenig - change - 18 May 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-05-18 05:16:58
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 18 May 2017
The description was changed
Status Closed Discussion
avatar joomla-cms-bot joomla-cms-bot - edited - 18 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 18 May 2017
Status Discussion Closed
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 18 May 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 18 May 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 18 May 2017

closed as having PR #16089


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16088.

Add a Comment

Login with GitHub to post a comment