Renaming or creation of pages with brackets in name not updating links when Wysiwyg.
Affects both ? and normal links.
Will commit this once 6.0 release is done.
Index: lib/wiki/wikilib.php =================================================================== --- lib/wiki/wikilib.php (revision 30521) +++ lib/wiki/wikilib.php (working copy) @@ -214,12 +214,20 @@ $data = preg_replace("/(?<=\(\()$quotedOldName(?=\)\)|\|)/i", $newName, $data); $quotedOldHtmlName = preg_quote( urlencode($oldName), '/' ); + // Need to set %28 and %29 back to brackets for wysiwyg + $quotedOldHtmlName2 = $quotedOldHtmlName; + $quotedOldHtmlName2 = str_replace('%28', '\(', $quotedOldHtmlName2); + $quotedOldHtmlName2 = str_replace('%29', '\)', $quotedOldHtmlName2); + $htmlSearch = '/<a class="wiki" href="tiki-index\.php\?page=' . $quotedOldHtmlName . '([^"]*)"/i'; + $htmlSearch2 = '/<a class="wiki" href="tiki-index\.php\?page=' . $quotedOldHtmlName2 . '([^"]*)"/i'; $htmlReplace = '<a class="wiki" href="tiki-index.php?page=' . urlencode($newName) . '\\1"'; $data = preg_replace($htmlSearch, $htmlReplace, $data); - + $data = preg_replace($htmlSearch2, $htmlReplace, $data); $htmlWantedSearch = '/(' . $quotedOldName . ')?<a class="wiki wikinew" href="tiki-editpage\.php\?page=' . $quotedOldHtmlName . '"[^<]+<\/a>/i'; + $htmlWantedSearch2 = '/(' . $quotedOldName . ')?<a class="wiki wikinew" href="tiki-editpage\.php\?page=' . $quotedOldHtmlName2 . '"[^<]+<\/a>/i'; $data = preg_replace($htmlWantedSearch, '((' . $newName . '))', $data); + $data = preg_replace($htmlWantedSearch2, '((' . $newName . '))', $data); if ($is_wiki_page) { $query = "update `tiki_pages` set `data`=?,`page_size`=? where `pageName`=?";
To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tiki.org instance. To start, simply select a version and click on "Create show2.tiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tiki.org.
To help developers solve the bug, we kindly request that you demonstrate your bug on a show.tikiwiki.org instance. To start, simply select a version and click on "Create show.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show.tikiwiki.org.
filename | created | hits | comment | version | filetype | ||
---|---|---|---|---|---|---|---|
No attachments for this item |