From d4e8d793923d4cc92a8d4bff0579a4edcab8c36d Mon Sep 17 00:00:00 2001 From: Dongsheng Cai Date: Tue, 18 Mar 2014 15:24:24 +1100 Subject: [PATCH] EQ-1012 More urlencode() fixes --- common/lib.php | 4 ++-- lib.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/lib.php b/common/lib.php index 0d89a42..7044c20 100644 --- a/common/lib.php +++ b/common/lib.php @@ -114,7 +114,7 @@ function equella_getssotoken_raw($username, $shareid, $sharedsecret) { $time = time() . '000'; $hash = md5($username . $shareid . $time . $sharedsecret); $params = array(); - $params[] = urlencode($username); + $params[] = rawurlencode($username); $params[] = $shareid; $params[] = $time; $params[] = base64_encode(pack('H*', $hash)); @@ -136,7 +136,7 @@ function equella_appendtoken($url, $token = null) { $token = equella_getssotoken(); } $url .= (strpos($url, '?') != false) ? '&' : '?'; - $url .= 'token=' . urlencode($token); + $url .= 'token=' . rawurlencode($token); return $url; } diff --git a/lib.php b/lib.php index ec6bce8..2cac563 100644 --- a/lib.php +++ b/lib.php @@ -160,7 +160,7 @@ function equella_delete_instance($id) { if ($equella->activation) { $url = str_replace("signon.do", "access/activationwebservice.do", $CFG->equella_url); - $url = equella_appendtoken($url)."&activationUuid=".urlencode($equella->activation); + $url = equella_appendtoken($url)."&activationUuid=".rawurlencode($equella->activation); $curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $res = curl_exec($curl);