[Pkg-owncloud-commits] [php-sabredav] 05/66: Don't urlencode colons. Fixes Issue #374.
David Prévot
taffit at moszumanska.debian.org
Sat Jan 18 20:08:18 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository php-sabredav.
commit bd3f85bc796f29d211e1230f35548f3e6f82f2d8
Author: Evert Pot <evert at rooftopsolutions.nl>
Date: Fri Nov 8 20:59:58 2013 -0500
Don't urlencode colons. Fixes Issue #374.
---
ChangeLog | 3 +++
lib/Sabre/DAV/URLUtil.php | 7 +++++--
tests/Sabre/DAV/URLUtilTest.php | 4 ++--
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b8908ca..2928888 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+1.7.10-stable (2013-??-??)
+ * Fixed: Issue #374: Don't urlescape colon (:) when it's not required.
+
1.7.9-stable (2013-10-02)
* The zip release ships with sabre/vobject 2.1.3.
* Fixed: Issue #365. Incorrect output when principal urls have spaces in
diff --git a/lib/Sabre/DAV/URLUtil.php b/lib/Sabre/DAV/URLUtil.php
index 827b315..4d9bfb6 100644
--- a/lib/Sabre/DAV/URLUtil.php
+++ b/lib/Sabre/DAV/URLUtil.php
@@ -12,6 +12,9 @@
* ). Since these are reserved, but don't have a reserved meaning in url, these characters are
* kept as-is.
*
+ * It was also discovered that versions of the SOGO connector for thunderbird
+ * has issues with urlencoded colons.
+ *
* @package Sabre
* @subpackage DAV
* @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/).
@@ -30,7 +33,7 @@ class Sabre_DAV_URLUtil {
*/
static function encodePath($path) {
- return preg_replace_callback('/([^A-Za-z0-9_\-\.~\(\)\/])/',function($match) {
+ return preg_replace_callback('/([^A-Za-z0-9_\-\.~\(\)\/:])/',function($match) {
return '%'.sprintf('%02x',ord($match[0]));
@@ -48,7 +51,7 @@ class Sabre_DAV_URLUtil {
*/
static function encodePathSegment($pathSegment) {
- return preg_replace_callback('/([^A-Za-z0-9_\-\.~\(\)])/',function($match) {
+ return preg_replace_callback('/([^A-Za-z0-9_\-\.~\(\):])/',function($match) {
return '%'.sprintf('%02x',ord($match[0]));
diff --git a/tests/Sabre/DAV/URLUtilTest.php b/tests/Sabre/DAV/URLUtilTest.php
index 90b913d..c4fd436 100644
--- a/tests/Sabre/DAV/URLUtilTest.php
+++ b/tests/Sabre/DAV/URLUtilTest.php
@@ -13,7 +13,7 @@ class Sabre_DAV_URLUtilTest extends PHPUnit_Framework_TestCase{
'%00%01%02%03%04%05%06%07%08%09%0a%0b%0c%0d%0e%0f'.
'%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f'.
'%20%21%22%23%24%25%26%27()%2a%2b%2c-./'.
- '0123456789%3a%3b%3c%3d%3e%3f'.
+ '0123456789:%3b%3c%3d%3e%3f'.
'%40ABCDEFGHIJKLMNO' .
'PQRSTUVWXYZ%5b%5c%5d%5e_' .
'%60abcdefghijklmno' .
@@ -37,7 +37,7 @@ class Sabre_DAV_URLUtilTest extends PHPUnit_Framework_TestCase{
'%00%01%02%03%04%05%06%07%08%09%0a%0b%0c%0d%0e%0f'.
'%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f'.
'%20%21%22%23%24%25%26%27()%2a%2b%2c-.%2f'.
- '0123456789%3a%3b%3c%3d%3e%3f'.
+ '0123456789:%3b%3c%3d%3e%3f'.
'%40ABCDEFGHIJKLMNO' .
'PQRSTUVWXYZ%5b%5c%5d%5e_' .
'%60abcdefghijklmno' .
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git
More information about the Pkg-owncloud-commits
mailing list