Browse Source

Fix for https://opengamepanel.org/forum/viewthread.php?thread_id=8374 (#636)

OwN-3m-All 1 năm trước cách đây
mục cha
commit
4f3cf0cdcc
1 tập tin đã thay đổi với 11 bổ sung7 xóa
  1. 11 7
      lang/lang-check.php

+ 11 - 7
lang/lang-check.php

@@ -37,13 +37,17 @@ function curPageURL() {
 	return $pageURL;
 }
 
-if(isset($_GET['file']))
+if(isset($_GET['file'])) // Don't allow remote URLs
 {
-	$file = urldecode($_GET['file']);
-	include($file);
-	$constants = get_defined_constants(true);
-	echo base64_encode(serialize($constants['user']));
-	exit();
+	if(!filter_var($_GET['file'], FILTER_VALIDATE_URL)){
+		$file = urldecode($_GET['file']);
+		include($file);
+		$constants = get_defined_constants(true);
+		echo base64_encode(serialize($constants['user']));
+		exit();
+	}else{
+		exit();
+	}
 }
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -206,7 +210,7 @@ foreach ($locale_files as $lang_name)
 		$contents = file_get_contents("$current_url?file=$file");
 		$compare_lang = unserialize(base64_decode($contents));
 		if(!is_array($compare_lang))
-			echo "Errors where found at $file";
+			die("Errors where found at $file");
 		$extra_lang_vars = @array_diff_key($compare_lang,$lang[$glf]);
 		$missing_lang_vars = @array_diff_key($lang[$glf],$compare_lang);
 		if(isset($extra_lang_vars['']))