]> git.mjollnir.org Git - s9y.git/commitdiff
be nice to opendir
authorgarvinhicking <garvinhicking>
Tue, 7 Feb 2006 19:37:17 +0000 (19:37 +0000)
committergarvinhicking <garvinhicking>
Tue, 7 Feb 2006 19:37:17 +0000 (19:37 +0000)
include/functions.inc.php

index ba6eb4492c23d4ae3679b0fa720bc9d37dc911b0..7457a93ceaf26e4f3b45d3b48ba38e449c1477e9 100644 (file)
@@ -135,8 +135,11 @@ function serendipity_formatTime($format, $time, $useOffset = true) {
 function serendipity_fetchTemplates($dir = '') {
     global $serendipity;
 
-    $cdir = opendir($serendipity['serendipityPath'] . $serendipity['templatePath'] . $dir);
-    $rv  = array();
+    $cdir = @opendir($serendipity['serendipityPath'] . $serendipity['templatePath'] . $dir);
+    $rv   = array();
+    if (!$cdir) {
+        return $rv;
+    }
     while (($file = readdir($cdir)) !== false) {
         if (is_dir($serendipity['serendipityPath'] . $serendipity['templatePath'] . $dir . $file) && !ereg('^(\.|CVS)', $file) && !file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $dir . $file . '/inactive.txt')) {
             if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $dir . $file . '/info.txt')) {