Skip to content
Snippets Groups Projects
Commit f956ef02 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FIX #11487 TIME 0:45 now using rtrim to remove extra ',' in custom lang

parent 379716f0
No related branches found
No related tags found
No related merge requests found
...@@ -115,14 +115,10 @@ class CoreConfigModel ...@@ -115,14 +115,10 @@ class CoreConfigModel
$strpos = strpos($fileContent, "="); $strpos = strpos($fileContent, "=");
$substr = substr(trim($fileContent), $strpos + 2, -1); $substr = substr(trim($fileContent), $strpos + 2, -1);
$decode = json_decode($substr);
if (json_last_error() != JSON_ERROR_NONE) { $trimmed = rtrim($substr, ',}');
// decoded String is not a valid JSON String, probably because of an extra ',' at the end $trimmed .= '}';
$correctedString = substr_replace($substr, '', strlen($substr) - 2, 1); $decode = json_decode($trimmed);
$decode = json_decode($correctedString);
}
return $decode; return $decode;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment