Renaming or creation of pages with brackets in name not updating links when Wysiwyg
- Status
- Closed
- Subject
- Renaming or creation of pages with brackets in name not updating links when Wysiwyg
- Version
- 6.x
- Category
- Error
- Feature
- Wiki (page view, edit, history, rename, etc)
WYSIWYG (What You See is What You Get) - Resolution status
- Invalid
- Submitted by
- Nelson Ko
- Lastmod by
- Ushindi Gedeon
- Rating
- Description
Renaming or creation of pages with brackets in name not updating links when Wysiwyg.
Affects both ? and normal links.
- Solution
Will commit this once 6.0 release is done.
Copy to clipboardIndex: 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`=?";- Workaround
- Importance
- 8
- Priority
- 40
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 3630
- Created
- Tuesday 09 November, 2010 23:32:06 UTC
by Nelson Ko - LastModif
- Tuesday 30 June, 2026 08:44:36 UTC