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
e33e7915
Commit
e33e7915
authored
Jul 26, 2013
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for issue #180
parent
504cf43d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
library/Solarium/Core/Query/Helper.php
library/Solarium/Core/Query/Helper.php
+13
-0
tests/Solarium/Tests/Core/Query/HelperTest.php
tests/Solarium/Tests/Core/Query/HelperTest.php
+8
-0
No files found.
library/Solarium/Core/Query/Helper.php
View file @
e33e7915
...
...
@@ -479,4 +479,17 @@ class Helper
return
$result
;
}
/**
* Filters control characters that cause issues with servlet containers.
*
* Mainly useful to filter data before adding it to a document for the update query.
*
* @param $data
* @return mixed
*/
public
function
filterControlCharacters
(
$data
)
{
return
preg_replace
(
'@[\x00-\x08\x0B\x0C\x0E-\x1F]@'
,
' '
,
$data
);
}
}
tests/Solarium/Tests/Core/Query/HelperTest.php
View file @
e33e7915
...
...
@@ -404,4 +404,12 @@ class HelperTest extends \PHPUnit_Framework_TestCase
);
}
public
function
testFilterControlCharacters
()
{
$this
->
assertEquals
(
'my string'
,
$this
->
helper
->
filterControlCharacters
(
"my
\x08
string"
)
);
}
}
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