Browse Source

Minor - Add check on existence of parent language path - refs BT#9880 #TMI

Yannick Warnier 9 years ago
parent
commit
86f577aff6
1 changed files with 7 additions and 4 deletions
  1. 7 4
      main/inc/lib/plugin.class.php

+ 7 - 4
main/inc/lib/plugin.class.php

@@ -342,11 +342,14 @@ class Plugin
                 $languageParentInfo = api_get_language_info($languageParentId);
                 $languageParentFolder = $languageParentInfo['dokeos_folder'];
 
-                include "{$root}{$plugin_name}/lang/{$languageParentFolder}.php";
+                $parentPath = "{$root}{$plugin_name}/lang/{$languageParentFolder}.php";
+                if (is_readable($parentPath)) {
+                    include $parentPath;
 
-                if (!empty($strings)) {
-                    foreach ($strings as $key => $string) {
-                        $this->strings[$key] = $string;
+                    if (!empty($strings)) {
+                        foreach ($strings as $key => $string) {
+                            $this->strings[$key] = $string;
+                        }
                     }
                 }
             }