瀏覽代碼

Merge pull request #61 from cmattoon/master

Modified Pico::get_pages() to ignore Emacs (~) and (#) temp files
Gilbert Pellegrom 12 年之前
父節點
當前提交
69d67b2b71
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      lib/pico.php

+ 6 - 1
lib/pico.php

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