Selaa lähdekoodia

Modified Pico::get_pages() to ignore Emacs (~) and Nano (#) temp files

Curtis Mattoon 12 vuotta sitten
vanhempi
commit
9fa454499d
1 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  1. 6 2
      lib/pico.php

+ 6 - 2
lib/pico.php

@@ -218,7 +218,11 @@ class Pico {
 				unset($pages[$key]);
 				continue;
 			}
-			
+            // Ignore Emacs (and Nano) temp files
+            if (in_array(substr($page, -1), array('~','#'))) {
+			    unset($pages[$key]);
+			    continue;
+			}			
 			// Get title and format $page
 			$page_content = file_get_contents($page);
 			$page_meta = $this->read_file_meta($page_content);
@@ -336,4 +340,4 @@ class Pico {
 
 }
 
-?>
+?>