?
Referenced as Related to: # 4863
avatar dirk-graetz
dirk-graetz
20 Oct 2014

Steps to reproduce the issue

Make a module "Feed display" and take for eg. this as feed Url: http://www.zdnet.de/feed/

Expected result

The above feed gives URLs like

http://www.zdnet.de/88208524/fitbit-plant-fitness-smartwatch-mit-gps/?utm_source=rss&utm_medium=rss&utm_campaign=rss

In line 104 of /modules/mod_feed/tmpl/default

<?php echo $uri; ?>

should be replaced with

<?php echo str_replace('&', '&', $uri); ?>

like in line 66 of the same file.

Actual result

System information (as much as possible)

Joomla! 3.3.6

Additional comments

avatar dirk-graetz dirk-graetz - open - 20 Oct 2014
avatar zero-24
zero-24 - comment - 20 Oct 2014

@dirk-graetz

<?php echo str_replace('&', '&', $uri); ?>

Really?

With this code you change nothing, $search and $replace are the same :D

mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )
http://php.net/manual/de/function.str-replace.php

Also why you want to echo it?

I think you mean somthing like this? Or i missunderstand you?

<?php str_replace('&', '&amp;', $uri); ?>
avatar dirk-graetz
dirk-graetz - comment - 20 Oct 2014

You are correct, i copied the text from the old tracker and the code was modified - replace with '&' is right!

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

avatar dirk-graetz
dirk-graetz - comment - 20 Oct 2014

Same again! Your code is right!

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

avatar dirk-graetz
dirk-graetz - comment - 20 Oct 2014

But echo is correct!

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

avatar zero-24
zero-24 - comment - 20 Oct 2014
avatar zero-24
zero-24 - comment - 20 Oct 2014

But echo is correct!

Yes but please use two lines. (see my edit) i think it is easyer to understand.

avatar dirk-graetz
dirk-graetz - comment - 20 Oct 2014

Sorry, i never made that.
And if the original feed-URL ist correctly escaped, my solution in line 104 will (like the original code in line 66) cause an error. Because the result will be &amp;amp
Maybe this should be solved more intelligent...


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

avatar zero-24
zero-24 - comment - 20 Oct 2014

@dirk-graetz can you test

preg_replace('/&(?!amp;)/', '&amp;', $uri);
avatar zero-24 zero-24 - close - 20 Oct 2014
avatar zero-24 zero-24 - change - 20 Oct 2014
Status New Closed
avatar zero-24
zero-24 - comment - 20 Oct 2014

@dirk-graetz see here for a PR: #4863

You can test it using the com_patchtester:
http://docs.joomla.org/Component_Patchtester_for_Testers
https://github.com/joomla-extensions/patchtester/releases/download/2.0.beta/com_patchtester.zip

So I'm closing here as we have a PR to fix it.

Thanks

avatar jissues-bot
jissues-bot - comment - 20 Oct 2014

Set to "closed" on behalf of @zero-24 by The JTracker Application at issues.joomla.org/joomla-cms/4862

avatar jissues-bot jissues-bot - close - 20 Oct 2014
avatar jissues-bot jissues-bot - change - 20 Oct 2014
Closed_Date 0000-00-00 00:00:00 2014-10-20 13:54:26
avatar dirk-graetz
dirk-graetz - comment - 20 Oct 2014

Works great, thanks!

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

avatar zero-24
zero-24 - comment - 20 Oct 2014

thanks @dirk-graetz So please comment on http://issues.joomla.org/tracker/joomla-cms/4863 and add your test result there.

avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment