From 10eeea80c1d1e40708a4fac1ade97d4e0cbe0591 Mon Sep 17 00:00:00 2001 From: Curtis Mattoon Date: Tue, 6 Aug 2013 20:34:36 -0400 Subject: [PATCH] Modified Pico::get_pages() to ignore Emacs (~) and Nano (#) temp files --- lib/pico.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/pico.php b/lib/pico.php index d2230bd..17ca8b7 100644 --- a/lib/pico.php +++ b/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 { } -?> \ No newline at end of file +?>