From: <mi...@us...> - 2010-08-16 09:21:40
|
Revision: 28526 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=28526&view=rev Author: minger0 Date: 2010-08-16 09:21:33 +0000 (Mon, 16 Aug 2010) Log Message: ----------- [FIX] TRACKER plugin: itemId may not be replaced in the url if it is followed by an id Modified Paths: -------------- trunk/lib/wiki-plugins/wikiplugin_tracker.php Modified: trunk/lib/wiki-plugins/wikiplugin_tracker.php =================================================================== --- trunk/lib/wiki-plugins/wikiplugin_tracker.php 2010-08-16 09:19:25 UTC (rev 28525) +++ trunk/lib/wiki-plugins/wikiplugin_tracker.php 2010-08-16 09:21:33 UTC (rev 28526) @@ -725,8 +725,12 @@ break; } } - if (strstr($url[$key], 'itemId')) { - $url[$key] = str_replace('itemId', 'itemId='.$rid, $url[$key]); + $itemIdPos = strpos($url[$key], 'itemId'); + if ($itemIdPos !== false) { + // replace by the itemId if in the end (or -1: for backward compatibility so that "&itemId=" also works) or if it is followed by an '&' + if (($itemIdPos+strlen('itemId') >= strlen($url[$key])-1) || (substr($url[$key],$itemIdPos+strlen('itemId'),1) == "&")) { + $url[$key] = str_replace('itemId', 'itemId='.$rid, $url[$key]); + } } header('Location: '.$url[$key]); die; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |