projects
/
GitHub
/
WoltLab
/
WCF.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7c727a0
)
Added wcfEscapeRegExp function
author
Marcel Werk
<burntime@woltlab.com>
Sun, 4 Nov 2012 18:52:06 +0000
(19:52 +0100)
committer
Marcel Werk
<burntime@woltlab.com>
Sun, 4 Nov 2012 18:52:06 +0000
(19:52 +0100)
wcfsetup/install/files/js/WCF.js
patch
|
blob
|
blame
|
history
diff --git
a/wcfsetup/install/files/js/WCF.js
b/wcfsetup/install/files/js/WCF.js
index ff89967eef33695e357a25353093a91a51ff4ad5..09617814e0a7e4387a886c1060239b94fbb14c3b 100755
(executable)
--- a/
wcfsetup/install/files/js/WCF.js
+++ b/
wcfsetup/install/files/js/WCF.js
@@
-125,6
+125,16
@@
$.extend(true, {
}
return $length;
+ },
+
+ /**
+ * Quotes regular expression characters.
+ *
+ * @param string string
+ * @return string
+ */
+ wcfEscapeRegExp: function(string) {
+ return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
}
});