Skip to content

Instantly share code, notes, and snippets.

@zeelot

zeelot/fix.diff Secret

Created August 27, 2012 17:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeelot/50a7d11977a17aab2400 to your computer and use it in GitHub Desktop.
Save zeelot/50a7d11977a17aab2400 to your computer and use it in GitHub Desktop.
seems to work!
diff --git a/classes/kohana/url.php b/classes/kohana/url.php
index e7e66bb..d95c7db 100644
--- a/classes/kohana/url.php
+++ b/classes/kohana/url.php
@@ -112,13 +112,18 @@ class Kohana_URL {
if ( ! UTF8::is_ascii($path))
{
// Encode all non-ASCII characters, as per RFC 1738
- $path = preg_replace('~([^/]+)~e', 'rawurlencode("$1")', $path);
+ $path = preg_replace_callback('~([^/]+)~', 'URL::_rawurlencode_callback', $path);
}
// Concat the URL
return URL::base($protocol, $index).$path;
}
+ protected static function _rawurlencode_callback($matches)
+ {
+ return rawurlencode($matches[0]);
+ }
+
/**
* Merges the current GET parameters with an array of new or overloaded
* parameters and returns the resulting query string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment