]> source.dussan.org Git - jquery.git/commitdiff
Fix for #979
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 25 Feb 2007 13:27:29 +0000 (13:27 +0000)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 25 Feb 2007 13:27:29 +0000 (13:27 +0000)
src/jquery/jquery.js

index c309428ead7d15539bad9dcd9f2c9d712edf2473..81b5b64e7f488b08492c4444d87493fd7cce810d 100644 (file)
@@ -1313,6 +1313,8 @@ jQuery.extend({
                // internal only, use is(".class")
                has: function( t, c ) {
                        t = t.className || t;
+                       // escape regex characters
+                       c = c.replace(/([\.\\\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, "\\$1");
                        return t && new RegExp("(^|\\s)" + c + "(\\s|$)").test( t );
                }
        },