[Home]WikiPatches/UriEscapeIds

UseModWiki | WikiPatches | RecentChanges | Preferences

Pages with names containing non-ASCII characters doesn't work in all browsers (eg. Netscape Navigator 4.7), but uri_escape'ing them takes care of this.

--PeterLindberg

*** wiki.orig   Tue Apr 23 13:49:37 2002
--- wiki        Tue Apr 23 13:53:42 2002
***************
*** 304,309 ****
--- 304,310 ----
  #$BrowseCode = <<'#END_OF_BROWSE_CODE';
  use CGI;
  use CGI::Carp qw(fatalsToBrowser);
+ use URI::Escape;
  
  sub InitRequest {
    my @ScriptPath = split('/', "$ENV{SCRIPT_NAME}");
***************
*** 482,487 ****
--- 483,489 ----
  sub ReBrowsePage {
    my ($id, $oldId, $isEdit) = @_;
  
+   $id = uri_escape($id);
    if ($oldId ne "") {   # Target of #REDIRECT (loop breaking)
      print &GetRedirectPage("action=browse&id=$id&oldid=$oldId",
                             $id, $isEdit);
***************
*** 793,798 ****
--- 795,801 ----
      $id = &FreeToNormal($id);
      $name =~ s/_/ /g;
    }
+   $id = uri_escape($id);
    return &ScriptLink($id, $name);
  }
  
***************
*** 804,809 ****
--- 807,813 ----
      $id = &FreeToNormal($id);
      $name =~ s/_/ /g;
    }
+   $id = uri_escape($id);
    return &ScriptLink($id, $name);
  }
  
***************
*** 814,819 ****
--- 818,824 ----
      $id = &FreeToNormal($id);
      $name =~ s/_/ /g;
    }
+   $id = uri_escape($id);
    return &ScriptLink("action=edit&id=$id", $name);
  }
  
***************
*** 824,829 ****
--- 829,835 ----
      $id = &FreeToNormal($id);
      $name =~ s/_/ /g;
    }
+   $id = uri_escape($id);
    return &ScriptLink("action=$kind&id=$id&revision=$revision", $name);
  }
  
***************
*** 870,875 ****
--- 876,882 ----
      $name =~ s/_/ /g;  # Display with spaces
      $id =~ s/_/+/g;    # Search for url-escaped spaces
    }
+   $id = uri_escape($id);
    return &ScriptLink("search=$id", $name);
  }
  

UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited May 21, 2004 5:36 am by MichaelHerman (diff)
Search: