From 391ab932f78cd97ec73e5db69e342d900402581c Mon Sep 17 00:00:00 2001 From: Jaiver Pastor Date: Thu, 7 May 2020 20:47:44 +0200 Subject: [PATCH 1/3] Fix name folder "classes". --- src/include/functions_common.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 93d81c3..689f238 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -1253,6 +1253,10 @@ function IncludeLanguageFile( $langfile, $failOnError = true ) $langengfile = str_replace( $LANG, $LANG_EN, $langfile ); else $langengfile = $langfile; + + //Fix #56 + $langengfile = str_replace( "/classen/", "/classes/", $langengfile ); + if ( file_exists($langengfile) ) include( $langengfile ); else From d304b7274d7b325e8985e0d31b10a1392d1ab965 Mon Sep 17 00:00:00 2001 From: Jaiver Pastor Date: Thu, 7 May 2020 21:15:39 +0200 Subject: [PATCH 2/3] modify the detect mode for language in path. --- src/include/functions_common.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 689f238..4c50d76 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -1249,14 +1249,14 @@ function IncludeLanguageFile( $langfile, $failOnError = true ) global $LANG, $LANG_EN; // If english is not selected, we load ENGLISH first - then overwrite with configured language - if ( $LANG != "en" ) - $langengfile = str_replace( $LANG, $LANG_EN, $langfile ); + if ( $LANG != "en" ) { + //Fix #56 + $langengfile = str_replace( "/".$LANG."/", "/".$LANG_EN."/", $langfile ); + $langengfile = str_replace( ".".$LANG.".", ".".$LANG_EN.".", $langengfile ); + } else $langengfile = $langfile; - //Fix #56 - $langengfile = str_replace( "/classen/", "/classes/", $langengfile ); - if ( file_exists($langengfile) ) include( $langengfile ); else From 2a3da1e5c8b038fbb7ccbb39381a343158801ed0 Mon Sep 17 00:00:00 2001 From: Jaiver Pastor Date: Thu, 7 May 2020 22:25:49 +0200 Subject: [PATCH 3/3] use a single replace with the help of arrays. --- src/include/functions_common.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/include/functions_common.php b/src/include/functions_common.php index 4c50d76..6576f99 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -1251,8 +1251,9 @@ function IncludeLanguageFile( $langfile, $failOnError = true ) // If english is not selected, we load ENGLISH first - then overwrite with configured language if ( $LANG != "en" ) { //Fix #56 - $langengfile = str_replace( "/".$LANG."/", "/".$LANG_EN."/", $langfile ); - $langengfile = str_replace( ".".$LANG.".", ".".$LANG_EN.".", $langengfile ); + $arr_LANG = array(sprintf('/%s/', $LANG), sprintf('.%s.', $LANG)); + $arr_LANG_EN = array(sprintf('/%s/', $LANG_EN), sprintf('.%s.', $LANG_EN)); + $langengfile = str_replace($arr_LANG, $arr_LANG_EN, $langfile); } else $langengfile = $langfile;