Loading...
 
Skip to main content

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
(0)
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 clipboard
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`=?";
Workaround
Importance
8
Priority
40
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
3630
Created
Tuesday 09 November, 2010 23:32:06 UTC
by Nelson Ko
LastModif
Tuesday 30 June, 2026 08:44:36 UTC


Show PHP error messages