OSDN Git Service

BugTrack/2430 Remove author line from text-search target
[pukiwiki/pukiwiki.git] / lib / file.php
index 34a2f3e..597b5fc 100644 (file)
@@ -204,6 +204,18 @@ function remove_author_info($wikitext)
        return preg_replace('/^\s*#author\([^\n]*(\n|$)/m', '', $wikitext);
 }
 
+function remove_author_lines($lines)
+{
+       $author_head = '#author(';
+       $len = strlen($author_head);
+       for ($i = 0; $i < 5; $i++) {
+               if (substr($lines[$i], 0, $len) === $author_head) {
+                       unset($lines[$i]);
+               }
+       }
+       return $lines;
+}
+
 function get_date_atom($timestamp)
 {
        // Compatible with DATE_ATOM format