OSDN Git Service

BugTrack/2484 AutoTicketLink for JIRA: Support underscore key XX_X
[pukiwiki/pukiwiki.git] / plugin / versionlist.inc.php
index 0a18437..59e3291 100644 (file)
@@ -1,29 +1,32 @@
 <?php
-/*
- * PukiWiki versionlist¥×¥é¥°¥¤¥ó
- *
- * CopyRight 2002 S.YOSHIMURA GPL2
- * http://masui.net/pukiwiki/ yosimura@excellence.ac.jp
- *
- * $Id: versionlist.inc.php,v 1.11 2004/07/24 09:45:38 henoheno Exp $
- */
+// PukiWiki - Yet another WikiWikiWeb clone
+// $Id: versionlist.inc.php,v 1.17 2007/05/12 08:37:38 henoheno Exp $
+// Copyright (C)
+//      2002-2006 PukiWiki Developers Team
+//      2002      S.YOSHIMURA GPL2 yosimura@excellence.ac.jp
+// License: GPL v2
+//
+// Listing cvs revisions of files
 
 function plugin_versionlist_action()
 {
        global $_title_versionlist;
-       
+
+       if (PKWK_SAFE_MODE) die_message('PKWK_SAFE_MODE prohibits this');
+
        return array(
                'msg' => $_title_versionlist,
-               'body' => plugin_versionlist_convert()
-       );
+               'body' => plugin_versionlist_convert());
 }
 
 function plugin_versionlist_convert()
 {
-       /* Ãµº÷¥Ç¥£¥ì¥¯¥È¥êÀßÄê */
+       if (PKWK_SAFE_MODE) return ''; // Show nothing
+       
+       /* 探索ディレクトリ設定 */
        $SCRIPT_DIR = array('./');
-       if (SUB_DIR   != './') array_push($SCRIPT_DIR, SUB_DIR);
-       if (DATA_HOME != './' && DATA_HOME != SUB_DIR) array_push($SCRIPT_DIR, DATA_HOME);
+       if (LIB_DIR   != './') array_push($SCRIPT_DIR, LIB_DIR);
+       if (DATA_HOME != './' && DATA_HOME != LIB_DIR) array_push($SCRIPT_DIR, DATA_HOME);
        array_push($SCRIPT_DIR, PLUGIN_DIR, SKIN_DIR);
 
        $comments = array();
@@ -42,12 +45,12 @@ function plugin_versionlist_convert()
                                continue;
                        }
                        $data = join('',file($sdir.$file));
-                       $comment = array('file'=>htmlspecialchars($sdir.$file),'rev'=>'','date'=>'');
+                       $comment = array('file'=>htmlsc($sdir.$file),'rev'=>'','date'=>'');
                        if (preg_match('/\$'.'Id: (.+),v (\d+\.\d+) (\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2})/',$data,$matches))
                        {
-//                             $comment['file'] = htmlspecialchars($sdir.$matches[1]);
-                               $comment['rev'] = htmlspecialchars($matches[2]);
-                               $comment['date'] = htmlspecialchars($matches[3]);
+//                             $comment['file'] = htmlsc($sdir.$matches[1]);
+                               $comment['rev'] = htmlsc($matches[2]);
+                               $comment['date'] = htmlsc($matches[3]);
                        }
                        $comments[$sdir.$file] = $comment;
                }
@@ -57,7 +60,7 @@ function plugin_versionlist_convert()
        {
                return '';
        }
-       ksort($comments);
+       ksort($comments, SORT_STRING);
        $retval = '';
        foreach ($comments as $comment)
        {