Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
058c6f51
Commit
058c6f51
authored
Dec 20, 2012
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added escaping of forward slashes, these were introduced in Solr 4 regex support.
parent
c00e7231
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
library/Solarium/Core/Query/Helper.php
library/Solarium/Core/Query/Helper.php
+1
-1
tests/Solarium/Tests/Core/Query/HelperTest.php
tests/Solarium/Tests/Core/Query/HelperTest.php
+2
-2
No files found.
library/Solarium/Core/Query/Helper.php
View file @
058c6f51
...
...
@@ -103,7 +103,7 @@ class Helper
*/
public
function
escapeTerm
(
$input
)
{
$pattern
=
'/(\+|-|&&|\|\||!|\(|\)|\{|}|\[|]|\^|"|~|\*|\?|:|\\\)/'
;
$pattern
=
'/(\+|-|&&|\|\||!|\(|\)|\{|}|\[|]|\^|"|~|\*|\?|:|\
/|\
\\)/'
;
return
preg_replace
(
$pattern
,
'\\\$1'
,
$input
);
}
...
...
tests/Solarium/Tests/Core/Query/HelperTest.php
View file @
058c6f51
...
...
@@ -207,8 +207,8 @@ class HelperTest extends \PHPUnit_Framework_TestCase
public
function
testEscapeTerm
()
{
$this
->
assertEquals
(
'a\\+b'
,
$this
->
helper
->
escapeTerm
(
'a+b'
)
'a\\+b
\/c
'
,
$this
->
helper
->
escapeTerm
(
'a+b
/c
'
)
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment