author | Michael Krelin <hacker@klever.net> | 2014-06-30 18:20:13 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2014-06-30 18:20:13 (UTC) |
commit | c392fe28606eefa0c814e5c25d641f5ffe623186 (patch) (unidiff) | |
tree | da03fe13ca09fadbebbad9b5d38750757270bae8 /frontend/beta/js/Clipperz/Base.js | |
parent | d341307d346dee62ee36b27f0f93b8f000748a96 (diff) | |
parent | 6dd16d9359e3a4dc306802588b09acd43947a606 (diff) | |
download | clipperz-c392fe28606eefa0c814e5c25d641f5ffe623186.zip clipperz-c392fe28606eefa0c814e5c25d641f5ffe623186.tar.gz clipperz-c392fe28606eefa0c814e5c25d641f5ffe623186.tar.bz2 |
Merge remote-tracking branch 'github/master' into nmaster
Diffstat (limited to 'frontend/beta/js/Clipperz/Base.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/Base.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/frontend/beta/js/Clipperz/Base.js b/frontend/beta/js/Clipperz/Base.js index cf40314..1c6faa1 100644 --- a/frontend/beta/js/Clipperz/Base.js +++ b/frontend/beta/js/Clipperz/Base.js | |||
@@ -225,48 +225,76 @@ MochiKit.Base.update(Clipperz.Base, { | |||
225 | return JSON2.parse(aString); | 225 | return JSON2.parse(aString); |
226 | }, | 226 | }, |
227 | 227 | ||
228 | 'serializeJSON': function(anObject) { | 228 | 'serializeJSON': function(anObject) { |
229 | // return MochiKit.Base.serializeJSON(anObject); | 229 | // return MochiKit.Base.serializeJSON(anObject); |
230 | return JSON2.stringify(anObject); | 230 | return JSON2.stringify(anObject); |
231 | }, | 231 | }, |
232 | 232 | ||
233 | //------------------------------------------------------------------------- | 233 | //------------------------------------------------------------------------- |
234 | 234 | ||
235 | 'sanitizeString': function(aValue) { | 235 | 'sanitizeString': function(aValue) { |
236 | var result; | 236 | var result; |
237 | 237 | ||
238 | if (Clipperz.Base.objectType(aValue) == 'string') { | 238 | if (Clipperz.Base.objectType(aValue) == 'string') { |
239 | result = aValue; | 239 | result = aValue; |
240 | result = result.replace(/</img,"<"); | 240 | result = result.replace(/</img,"<"); |
241 | result = result.replace(/>/img,">"); | 241 | result = result.replace(/>/img,">"); |
242 | } else { | 242 | } else { |
243 | result = aValue; | 243 | result = aValue; |
244 | } | 244 | } |
245 | 245 | ||
246 | return result; | 246 | return result; |
247 | }, | 247 | }, |
248 | 248 | ||
249 | 'javascriptInjectionPattern': new RegExp("javascript:\/\/\"", "g"), | ||
250 | |||
251 | 'sanitizeUrl': function(aValue) { | ||
252 | varresult; | ||
253 | |||
254 | if ((aValue != null) && this.javascriptInjectionPattern.test(aValue)) { | ||
255 | result = aValue.replace(this.javascriptInjectionPattern, ''); | ||
256 | console.log("sanitized url", aValue, result); | ||
257 | } else { | ||
258 | result = aValue; | ||
259 | } | ||
260 | |||
261 | return result; | ||
262 | }, | ||
263 | |||
264 | 'sanitizeFavicon': function(aValue) { | ||
265 | varresult; | ||
266 | |||
267 | if ((aValue != null) && this.javascriptInjectionPattern.test(aValue)) { | ||
268 | result = aValue.replace(this.javascriptInjectionPattern, ''); | ||
269 | console.log("sanitized favicon", aValue, result); | ||
270 | } else { | ||
271 | result = aValue; | ||
272 | } | ||
273 | |||
274 | return result; | ||
275 | }, | ||
276 | |||
249 | //------------------------------------------------------------------------- | 277 | //------------------------------------------------------------------------- |
250 | 278 | ||
251 | 'exception': { | 279 | 'exception': { |
252 | 'AbstractMethod': new MochiKit.Base.NamedError("Clipperz.Base.exception.AbstractMethod"), | 280 | 'AbstractMethod': new MochiKit.Base.NamedError("Clipperz.Base.exception.AbstractMethod"), |
253 | 'UnknownType': new MochiKit.Base.NamedError("Clipperz.Base.exception.UnknownType"), | 281 | 'UnknownType': new MochiKit.Base.NamedError("Clipperz.Base.exception.UnknownType"), |
254 | 'VulnerabilityIssue':new MochiKit.Base.NamedError("Clipperz.Base.exception.VulnerabilityIssue") | 282 | 'VulnerabilityIssue':new MochiKit.Base.NamedError("Clipperz.Base.exception.VulnerabilityIssue") |
255 | }, | 283 | }, |
256 | 284 | ||
257 | //------------------------------------------------------------------------- | 285 | //------------------------------------------------------------------------- |
258 | __syntaxFix__: "syntax fix" | 286 | __syntaxFix__: "syntax fix" |
259 | 287 | ||
260 | }); | 288 | }); |
261 | 289 | ||
262 | 290 | ||
263 | 291 | ||
264 | MochiKit.Base.registerComparator('Object dummy comparator', | 292 | MochiKit.Base.registerComparator('Object dummy comparator', |
265 | function(a, b) { | 293 | function(a, b) { |
266 | return ((a.constructor == Object) && (b.constructor == Object)); | 294 | return ((a.constructor == Object) && (b.constructor == Object)); |
267 | }, | 295 | }, |
268 | function(a, b) { | 296 | function(a, b) { |
269 | var result; | 297 | var result; |
270 | var aKeys; | 298 | var aKeys; |
271 | var bKeys; | 299 | var bKeys; |
272 | 300 | ||