Index: /trunk/ChangeLog
===================================================================
--- /trunk/ChangeLog	(revision 782)
+++ /trunk/ChangeLog	(revision 783)
@@ -13,4 +13,5 @@
 1.3.2 2011-??-??
 ========
+ * avoid possible filename injection in admin page
  * adds 30 seconds timeout to "compiling" flag
  * decompiler: improves decompiling
Index: /trunk/NEWS
===================================================================
--- /trunk/NEWS	(revision 782)
+++ /trunk/NEWS	(revision 783)
@@ -4,4 +4,5 @@
 1.3.2 2011-??-??
 ========
+ * admin page security fix
  * adds 30 seconds timeout to "compiling" flag
  * improves decompiling
Index: /trunk/admin/common.php
===================================================================
--- /trunk/admin/common.php	(revision 782)
+++ /trunk/admin/common.php	(revision 783)
@@ -1,3 +1,8 @@
 <?php
+
+function xcache_validateFileName($name)
+{
+	return preg_match('!^[a-zA-Z0-9._-]+$!', $name);
+}
 
 function get_language_file_ex($name, $l, $s)
@@ -16,14 +21,17 @@
 		$l = $lmap[$l];
 	}
-	if (file_exists($file = "$name-$l-$s.lang.php")) {
+	$file = "$name-$l-$s.lang.php";
+	if (xcache_validateFileName($file) && file_exists($file)) {
 		return $file;
 	}
 	if (isset($smap[$s])) {
 		$s = $smap[$s];
-		if (file_exists($file = "$name-$l-$s.lang.php")) {
+		$file = "$name-$l-$s.lang.php";
+		if (xcache_validateFileName($file) && file_exists($file)) {
 			return $file;
 		}
 	}
-	if (file_exists($file = "$name-$l.lang.php")) {
+	$file = "$name-$l.lang.php";
+	if (xcache_validateFileName($file) && file_exists($file)) {
 		return $file;
 	}
