Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

@mala
mala /jq_quickpatch.html
CreatedJune 26, 2011 03:13— forked fromanonymous/jq_quickpatch.html
quick patch for jQuery selector XSS
<scripttype="text/javascript">
// http://ma.la/jquery_xss/
(function($){
var _init = $.fn.init;
$.fn.init = function(selector, context, rootjQuery){
// note: only block "#<img>", "a[href=<img onerror=...>]" still work.
if( typeof arguments[ 0 ] == "string" && /^#.*</.test( arguments[ 0 ] ) ){
throw new Error( "selector error" );
}
// console.log(arguments[0]);

[8]ページ先頭

©2009-2025 Movatter.jp