Permalink
Browse files

Merge pull request #24 from Daniel15/patch-2

Escape forward slashes
  • Loading branch information...
2 parents f7a7820 + cf8e4d2 commit b8d0bfd20e191c9705584040d940609fa19f40dd @jpmckinney jpmckinney committed Sep 24, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 core/Parameter.js
View
@@ -170,9 +170,9 @@ AjaxSolr.Parameter = AjaxSolr.Class.extend(
* @returns {String} The escaped value.
*/
AjaxSolr.Parameter.escapeValue = function (value) {
- // If the field value has a space or a colon in it, wrap it in quotes,
+ // If the field value has a space, colon or forward slash in it, wrap it in quotes,
// unless it is a range query or it is already wrapped in quotes.
- if (value.match(/[ :]/) && !value.match(/[\[\{]\S+ TO \S+[\]\}]/) && !value.match(/^["\(].*["\)]$/)) {
+ if (value.match(/[ :\/]/) && !value.match(/[\[\{]\S+ TO \S+[\]\}]/) && !value.match(/^["\(].*["\)]$/)) {
return '"' + value + '"';
}
return value;

0 comments on commit b8d0bfd

Please sign in to comment.