Skip to content

Instantly share code, notes, and snippets.

@ywatase
Created April 23, 2018 15:40
Show Gist options
  • Save ywatase/570abeb73c0c9878d921dd85ce3a4b8c to your computer and use it in GitHub Desktop.
Save ywatase/570abeb73c0c9878d921dd85ce3a4b8c to your computer and use it in GitHub Desktop.
diff -N -u wiki.cgi.old wiki.cgi
--- wiki.cgi.old 2012-11-13 18:47:10.000000000 +0900
+++ wiki.cgi 2018-04-24 00:18:18.000000000 +0900
@@ -83,6 +83,14 @@
}
#==============================================================================
+ # Redirect if URI is escaped twice and pointed page exists.
+ #==============================================================================
+ if (not $wiki->page_exists($cgi->param('page'))
+ and $wiki->page_exists(Util::url_decode($cgi->param('page')))) {
+ $wiki->redirect(Util::url_decode(Util::url_decode($cgi->param('page'))));
+ }
+
+ #==============================================================================
# 設定を反映(もうちょっとスマートにやりたいね)
#==============================================================================
my $config = &Util::load_config_hash($wiki,$wiki->config('config_file'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment