On Fri, 2005-10-07 at 10:11 -0500, Zed Pobre wrote:

> I just discovered that the upgrade to 1.3.10 has caused PHPWiki to
> stop recognizing the data in at least one of my links.  This is very
> bad.  I need the information in that node, and worse, I have no idea
> how many other links may now be dead.  The error I get is:

Not having a great run with this upgrade are you :(

There isn't a lot of detail in your message that lets me reproduce the
situation, but based on what I can make out of the code around line 343
it seems like an upstream bug when an image is used as the label for a
link such as:

[http://www.example.com/foo.jpg|SomeWikiPage]

Using this syntax I can definitely reproduce the error you report, I
have no way of knowing if this is what is causing your error though.

I have whipped up a quick patch that seems to solve the problem with
this syntax. The bug appears to have been introduced 16 months (and
several releases ago) in upstream revision 1.44. Obviously using an
image as a label isn't widely used.

Can you please try the attached patch and let me know if that fixes the
problem?

Kind Regards

-- 
Matt Brown
[EMAIL PROTECTED]
Mob +64 275 611 544 www.mattb.net.nz
--- lib/InlineParser.php	(revision 63)
+++ lib/InlineParser.php	(working copy)
@@ -340,7 +340,8 @@
     // if label looks like a url to an image, we want an image link.
     if (isImageLink($label)) {
         $imgurl = $label;
-        if (preg_match("/^" . $intermap->getRegexp() . ":/", $label)) {
+        if (($intermap = getInterwikiMap()) and 
+                preg_match("/^" . $intermap->getRegexp() . ":/", $label)) {
             $imgurl = $intermap->link($label);
             $imgurl = $imgurl->getAttr('href');
         } elseif (! preg_match("#^(" . ALLOWED_PROTOCOLS . "):#", $imgurl)) {

Reply via email to