Explorar o código

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

Yannick Warnier %!s(int64=9) %!d(string=hai) anos
pai
achega
86f577aff6
Modificáronse 1 ficheiros con 7 adicións e 4 borrados
  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;
+                        }
                     }
                 }
             }