OSDN Git Service

Please use abstruct method $vars instead of $get or $post. Return something suitable...
authorhenoheno <henoheno>
Sun, 18 Jul 2004 02:58:00 +0000 (11:58 +0900)
committerhenoheno <henoheno>
Sun, 18 Jul 2004 02:58:00 +0000 (11:58 +0900)
plugin/diff.inc.php

index a60c19d..5993a03 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: diff.inc.php,v 1.6 2004/07/18 02:39:06 henoheno Exp $
+// $Id: diff.inc.php,v 1.7 2004/07/18 02:58:00 henoheno Exp $
 //
 
 //¥Ú¡¼¥¸¤Îº¹Ê¬¤òɽ¼¨¤¹¤ë
@@ -81,12 +81,10 @@ function plugin_diff_delete($page)
        global $_msg_diff_adminpass, $_btn_delete, $_msg_invalidpass;
        
        $filename = DIFF_DIR . encode($page) . '.txt'; 
-       $s_page = htmlspecialchars($page);
        $body = '';
-       if (! is_pagename($page) || ! file_exists($filename)) {
-               $body = make_pagelink($page) . "'s diff seems not found";
-               return array('msg'=>$_title_diff_delete, 'body'=>$body); 
-       }
+       if (! is_pagename($page))     $body = "Invalid page name";
+       if (! file_exists($filename)) $body = make_pagelink($page) . "'s diff seems not found";
+       if ($body) return array('msg'=>$_title_diff_delete, 'body'=>$body);
 
        if (isset($vars['pass'])) {
                if (md5($vars['pass']) == $adminpass) {
@@ -100,6 +98,7 @@ function plugin_diff_delete($page)
                }
        }
 
+       $s_page = htmlspecialchars($page);
        $body .= <<<EOD
 <p>$_msg_diff_adminpass</p>
 <form action="$script" method="post">