aljeux schrieb:
> Message body follows:
>
> Hello,
>
> Please, excuse me to contact directly, but as you seems the
> author of the lines, I think it's better to ask you directly.
>
> I am a gforge developer running a gforge with phpwiki 1.3
> inside for projects.
>
> When renaming a page, I've found a strange thing.
>
> How to reproduce:
>
> Create a link: PageAlain
> Create the page with the default text.
> Rename the page (with links) to: PageAlainTwo
>
> => The page is renamed but now the links are named
> 'PageAlainTwoTwo'.
>
> I have noticied that the code responsible for this is in
> lib/WikiDB.php
> In this code, there is a section:
>
> if ($updateWikiLinks) {
> require_once('lib/plugin/WikiAdminSearchReplace.php');
> $links = $oldpage->getBackLinks();
> while ($linked_page = $links->next()) {
> WikiPlugin_WikiAdminSearchReplace::replaceHelper($this,
>
> $linked_page->getName(),
> $from,
> $to);
> }
> $links = $newpage->getBackLinks();
> while ($linked_page = $links->next()) {
> WikiPlugin_WikiAdminSearchReplace::replaceHelper($this,
>
> $linked_page->getName(),
>
> $from, $to);
> }
> }
>
> To solve the problem, I am tempted to comment the second
> part of the code (the one renaming link to the new page) but
> as I don't understand what is it for, I am quite reserved.
>
> Can you help me to understand it's goal ?
>
> Many thanks for for time,
> Alain Peyrat.
Hi Alain, better use the phpwiki-talk mailinglist.
this code does renaming all pagenames in all backlinked pages,
and is only executed if $updateWikiLinks is true.
Generally it is not good to do that automatically also,
because the old pagename detection is not strict enough.
--
Reini Urban
http://phpwiki.org/ http://murbreak.at/
http://helsinki.at/ http://spacemovie.mur.at/
|