OSDN Git Service

array_search()をin_array()に変更(FALSE/NULL問題)
authorarino <arino>
Tue, 10 Jun 2003 14:02:16 +0000 (23:02 +0900)
committerarino <arino>
Tue, 10 Jun 2003 14:02:16 +0000 (23:02 +0900)
plugin/ls.inc.php

index cbe8f60..f34cef1 100644 (file)
@@ -5,32 +5,39 @@
  * CopyRight 2002 Y.MASUI GPL2
  * http://masui.net/pukiwiki/ masui@masui.net
  *
- * $Id: ls.inc.php,v 1.7 2003/04/29 00:39:53 arino Exp $
+ * $Id: ls.inc.php,v 1.8 2003/06/10 14:02:16 arino Exp $
  */
 
 function plugin_ls_convert()
 {
        global $vars;
        
-       $aryargs = func_num_args() ? func_get_args() : array();
+       $with_title = FALSE;
        
-       $with_title = (array_search('title',$aryargs)!==FALSE);
-       
-       $ls = array();
+       if (func_num_args())
+       {
+               $args = func_get_args();
+               $with_title = in_array('title',$args);
+       }
        
        $prefix = $vars['page'].'/';
        
        $pages = array();
-       foreach (get_existpages() as $page) {
-               if (strpos($page,$prefix) === 0) {
+       foreach (get_existpages() as $page)
+       {
+               if (strpos($page,$prefix) === 0)
+               {
                        $pages[] = $page;
                }
        }
        natcasesort($pages);
        
-       foreach ($pages as $page) {
+       $ls = array();
+       foreach ($pages as $page)
+       {
                $comment = '';
-               if ($with_title) {
+               if ($with_title)
+               {
                        list($comment) = get_source($page);
                        // ¸«½Ð¤·¤Î¸ÇÍ­IDÉô¤òºï½ü
                        $comment = preg_replace('/^(\*{1,3}.*)\[#[A-Za-z][\w-]+\](.*)$/','$1$2',$comment);