Mercurial Hosting > luan
diff core/src/luan/modules/Utils.java @ 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 | 3dcb0f9bee82 |
children | 99eef1d0e706 |
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(); }