Permalink
Browse files

Use the Zend_Uri_Http constants for building the PCRE regex used to

sanitize the querystring of URLs.
  • Loading branch information...
kabel committed Dec 5, 2011
1 parent 5105f4e commit dfff6bbf73331cc81850cb64c18f74a7d45345c7
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/JsonpProxy.php
View
@@ -788,7 +788,9 @@ public function sanitizeUrl($url)
$urlParts = explode('?', $url, 2);
if (!empty($urlParts[1])) {
$urlParts[1] = explode('#', $urlParts[1], 2);
- $urlParts[1][0] = preg_replace_callback('/%(?![[:xdigit:]]{2})|[^A-Za-z0-9-_.!~*\'()\[\];\/?:@&=+$,%]/', array($this, 'urlencodeCallback'), $urlParts[1][0]);
+ $urlParts[1][0] = preg_replace_callback('/%(?![[:xdigit:]]{2})|[^' .
+ Zend_Uri_Http::CHAR_ALNUM . Zend_Uri_Http::CHAR_MARK . Zend_Uri_Http::CHAR_RESERVED . '%]/',
+ array($this, 'urlencodeCallback'), $urlParts[1][0]);
$urlParts[1] = implode('#', $urlParts[1]);
$url = implode('?', $urlParts);
}

0 comments on commit dfff6bb

Please sign in to comment.