changeset 187:1cb298d918b2

ban "//" in file and java paths git-svn-id: https://luan-java.googlecode.com/svn/trunk@188 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Thu, 26 Jun 2014 03:27:25 +0000
parents cf939124461a
children e132b7a3d94c
files core/src/luan/modules/Utils.java web/src/luan/modules/web/web_shell.luan
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/core/src/luan/modules/Utils.java	Thu Jun 26 00:36:50 2014 +0000
+++ b/core/src/luan/modules/Utils.java	Thu Jun 26 03:27:25 2014 +0000
@@ -61,7 +61,7 @@
 	}
 
 	public static boolean isFile(String path) {
-		return exists(new File(path));
+		return !path.contains("//") && exists(new File(path));
 	}
 
 	public static String toUrl(String path) {
@@ -69,6 +69,8 @@
 			return null;
 		if( path.startsWith("java:") ) {
 			path = path.substring(5);
+			if( path.contains("//") )
+				return null;
 			URL url = ClassLoader.getSystemResource(path);
 			return url==null ? null : url.toString();
 		}
--- a/web/src/luan/modules/web/web_shell.luan	Thu Jun 26 00:36:50 2014 +0000
+++ b/web/src/luan/modules/web/web_shell.luan	Thu Jun 26 03:27:25 2014 +0000
@@ -1,3 +1,4 @@
+import "Io"
 import "web/Http"
 
 per_session = true