File tree Expand file tree Collapse file tree
src/Phpbb/TranslationValidator/Validator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -233,14 +233,20 @@ protected function printErrorLevel(Output $output)
233233 */
234234 protected function guessPluralRule (): int
235235 {
236- // TODO: Check for safeMode and langParser integration here in that function
237236 $ filePath = $ this ->originPath . '/ ' . $ this ->originLanguagePath . 'composer.json ' ;
238237
239238 if (file_exists ($ filePath ))
240239 {
241-
242- $ fileContents = (string ) file_get_contents ($ filePath );
243- $ jsonContent = json_decode ($ fileContents , true );
240+ // Safe mode for safe execution on a server
241+ if ($ this ->safeMode )
242+ {
243+ $ jsonContent = self ::langParser ($ filePath );
244+ }
245+ else
246+ {
247+ $ fileContents = (string ) file_get_contents ($ filePath );
248+ $ jsonContent = json_decode ($ fileContents , true );
249+ }
244250
245251 if (!isset ($ jsonContent ['extra ' ]['plural-rule ' ]))
246252 {
You can’t perform that action at this time.
0 commit comments