#64 Fixes issue with tilde in URL

1.3.x
closed
nobody
None
5
2012-10-11
2004-01-24
Pablo Martinez
No

Fixes issue where the tilde(~) would be removed from an
external URL. For example

[http://my.web/~username/index.html/] would be changed
to [http://my.web/username/index.html/] which would not
work.

Here is the diff to fix this issue:

Index: lib/InlineParser.php

RCS file: /cvsroot/phpwiki/phpwiki/lib/InlineParser.php,v
retrieving revision 1.29
diff -u -r1.29 InlineParser.php
--- lib/InlineParser.php 13 Sep 2003 22:43:00
-0000 1.29
+++ lib/InlineParser.php 24 Jan 2004 03:40:59 -0000
@@ -269,7 +269,15 @@
list (, $hash, $label, $bar, $rawlink) = $matches;

 $label = UnWikiEscape($label);
  • $link = UnWikiEscape($rawlink);
    +
  • /*
    • Check if the user has typed a URL. This solves the
    • problem where the URLs have a ~ character
  • */
  • if (strstr($rawlink, "http://"))
  • $link = $rawlink;
  • else
  • $link = UnWikiEscape($rawlink);

    // if label looks like a url to an image, we want
    an image link.
    if (preg_match("/\.($InlineImages)$/i", $label)) {

---- I am very novice on this code, so I do not know if
this change may modify the behavior of the program.

Pablo

Discussion

  • Reini Urban
    Reini Urban
    2004-02-27

    Logged In: YES
    user_id=13755

    very good catch! applied to CVS