From: Brion Vibber <brion@pobox.com>
Date: Sun, 21 Feb 2010 19:11:37 +0000 (-0800)
Subject: Fix for doc action on systems that return false for globbing in a non-existing dir
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3e7a2a4014dd93637f5a666e238dde13e397523c;p=quix0rs-gnu-social.git

Fix for doc action on systems that return false for globbing in a non-existing dir
---

diff --git a/actions/doc.php b/actions/doc.php
index eaf4b7df2d..459f5f0968 100644
--- a/actions/doc.php
+++ b/actions/doc.php
@@ -173,6 +173,10 @@ class DocAction extends Action
         }
 
         $local = glob(INSTALLDIR.'/local/doc-src/'.$this->title.'.*');
+        if ($local === false) {
+            // Some systems return false, others array(), if dir didn't exist.
+            $local = array();
+        }
 
         if (count($local) || isset($localDef)) {
             return $this->negotiateLanguage($local, $localDef);
@@ -183,6 +187,9 @@ class DocAction extends Action
         }
 
         $dist = glob(INSTALLDIR.'/doc-src/'.$this->title.'.*');
+        if ($dist === false) {
+            $dist = array();
+        }
 
         if (count($dist) || isset($distDef)) {
             return $this->negotiateLanguage($dist, $distDef);