Elijah Saxon - 2002-05-10

I really like [brackets for links].

Unfortunately, [home page] and HomePage end up as different links. In my perfect world, they would point to the same page. A human reads them the same, even if the computer does not.

So I tried to get this working, using 1.3.3:

I modified stdlib.php as so:

in LinkBrackLink():
$squishedURL = str_replace(' ', '', ucwords($URL));
    if ($dbi->isWikiPage($squishedURL))
    {
        if ($linkname == '')
          $linkname = $URL;
        return WikiLink($squishedURL, 'known', $linkname);
    }

and to get backlinks to work, i changed the line "$wikilinks[$brktlinks[2][$i]] = 1;" in ExtractWikiPageLinks() to "$wikilinks[$link->getAttr('href')] = 1"

and to get unknown links to work, I created a custom theme and overrid linkUnknownWikiWord() to include the wiki word replacement using 'str_replace(' ', '', ucwords($wikiword))'.
basically, just one line was changed:  $url = WikiURL(str_replace(' ', '', ucwords($wikiword)), array('action' => 'edit'));

Anyway, it seems to work, and I really like it, but there is probably a better way. I mean, I have just downloaded phpwiki this morning for the first time, so I am sure I mucked it up somehow.

What I would really like is a global function Normalize($wikiname) which then could be customized to do all kinds of crazy wiki naming schemes. Normalize would take in the text as you type it, and then return the normalized pagename. Maybe there is already something like that?

How do I request this as a change for the next version?

In general, I am very impressed by the quality of the code, especially for php code :). Keep up the good work.