Changeset 3082 for trunk/tmpl/cms/cfg_archives.tmpl
- Timestamp:
- 10/03/08 01:07:01 (14 months ago)
- Files:
-
- 1 modified
-
trunk/tmpl/cms/cfg_archives.tmpl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tmpl/cms/cfg_archives.tmpl
r2213 r3082 116 116 return false; 117 117 } 118 if (f.enable_archive_paths.checked) { 119 if (!f.archive_path.value) { 120 alert('<__trans phrase="You must set Local Archive Path." escape="singlequotes">'); 121 return false; 122 } else if (!is_valid_url(f.archive_url.value)){ 123 alert('<__trans phrase="You must set a valid Archive URL." escape="singlequotes">'); 124 return false; 125 } else if (!is_valid_path(f.archive_path.value)){ 126 alert('<__trans phrase="You must set a valid Local Archive Path." escape="singlequotes">'); 127 return false; 128 } 129 } 118 130 f.site_url.disabled = false; 119 131 f.site_path.disabled = false; … … 126 138 } 127 139 function is_valid_path(path_){ 128 for(i = 0; i < path_.length; i++){ 129 var buf = escape(path_.substr(i, 1)); 130 if (buf.match(/^%u.*/)){ 131 return false; 132 } 133 if (buf.match(/(%.{2}){2}?/)){ 134 return false; 135 } 140 var str = path_.replace(/[ "%<>\[\\\]\^`{\|}~]/g, ""); 141 str = encodeURI(str); 142 if (str.indexOf('%') != -1) { 143 return false; 144 } 145 if (str.match(/\.\./)) { 146 return false; 136 147 } 137 148 return true;
