[Home]WikiBugs/CamelCaseImageUploadCausesProblemsWithDisplay

UseModWiki | WikiBugs | RecentChanges | Preferences

Fixed in 1.0.2 --MarkusLude

Enable uploads and upload an image with a CamelCase name, for example CamelCase.png. Then try to display the image inline with this code:

upload:CamelCase.png

Rather than getting an inline image, it shows the word CamelCase as a missing document (clickable question mark to create a new document, provided, of course, the document doesn't exist):

upload:CamelCase?.png

and "upload:CamelCase" is a link to the image (without its extension).

upload:lowercase.png works as I would expect.

If the wiki page CamelCase actually exists, my system shows the image properly.


I can confirm this as well. Can anyone offer a fix?
Workaround: Set $WikiLinks to 0. (But then if you've been relying on the wiki link style, you're out of luck.)

I tried prefixing "(?<!upload:)" (a negative look-behind) on $LinkPattern but still had problems. If the filename is something like MyCamelCase.png, the link is to the document CamelCase.... so this fixes my problem. It may make a problem for you, though ;-)

The fix is to ensure wiki-style links' names are the starts of their words.

Side-effects:

*** wiki.o      Thu Jan 29 10:04:02 2004
--- wiki        Thu Jan 29 12:03:05 2004
***************
*** 270,276 ****
    }
    $UpperLetter .= "]"; $LowerLetter .= "]"; $AnyLetter .= "]";
    # Main link pattern: lowercase between uppercase, then anything
!   $LpA = $UpperLetter . "+" . $LowerLetter . "+" . $UpperLetter
           . $AnyLetter . "*";
    # Optional subpage link pattern: uppercase, lowercase, then anything
    $LpB = $UpperLetter . "+" . $LowerLetter . "+" . $AnyLetter . "*";
--- 270,276 ----
    }
    $UpperLetter .= "]"; $LowerLetter .= "]"; $AnyLetter .= "]";
    # Main link pattern: lowercase between uppercase, then anything
!   $LpA = "\b" . $UpperLetter . "+" . $LowerLetter . "+" . $UpperLetter
           . $AnyLetter . "*";
    # Optional subpage link pattern: uppercase, lowercase, then anything
    $LpB = $UpperLetter . "+" . $LowerLetter . "+" . $AnyLetter . "*";
-- Ke4roh


This patch did not work for me it trashed other links types. So I just moved
    if ($UseUpload) {
      s/$UploadPattern/&StoreUpload($1)/geo;
    }
to just after the EvalLocalRules? in CommonMarkup.
That works quite nicely! Thanks! -- Ke4roh

I may have sinned by editing my patch after posting it, editing it with bug fixes. I'm curious now if you applied the patch above or the old patch that I know would trash other link types. I haven't figured out what link types this patch might trash yet. Thanks! -- Ke4roh


I also think moving these three lines up a bit is the correct approach - but they only need to go to just above the "if ($WikiLinks) {" line (about 9 lines up). -- DavidClaughton

UseModWiki | WikiBugs | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited October 5, 2007 12:28 pm by MarkusLude (diff)
Search: