]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do urlencoding in linkTo functions
authorBart Visscher <bartv@thisnet.nl>
Fri, 28 Sep 2012 20:27:52 +0000 (22:27 +0200)
committerBart Visscher <bartv@thisnet.nl>
Fri, 28 Sep 2012 20:27:52 +0000 (22:27 +0200)
apps/files_versions/templates/history.php
core/lostpassword/index.php
lib/helper.php
lib/public/util.php
lib/search/provider/file.php
lib/util.php

index 99bc153a816ad41275f1fda3ff1ec810eee5780d..854d032da625541e28211366d876ba8b644cd282 100644 (file)
@@ -22,7 +22,7 @@ if( isset( $_['message'] ) ) {
        foreach ( $_['versions'] as $v ) {
                echo ' ';
                echo OCP\Util::formatDate( doubleval($v['version']) );
-               echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php', array('path' => urlencode( $_['path'] ), 'revert' => $v['version'])) .'" class="button">Revert</a><br /><br />';
+               echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php', array('path' => $_['path'], 'revert' => $v['version'])) .'" class="button">Revert</a><br /><br />';
                if ( $v['cur'] ) { echo '  (<b>Current</b>)'; }
                echo '<br /><br />';
        }
index 3f58b03c982ce2ae44e015d9101aa66e88ff3871..8da86d5a36099edd92b471a199300d4bdaef255f 100644 (file)
@@ -17,7 +17,7 @@ if (isset($_POST['user'])) {
                OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', $token);
                $email = OC_Preferences::getValue($_POST['user'], 'settings', 'email', '');
                if (!empty($email) and isset($_POST['sectoken']) and isset($_SESSION['sectoken']) and ($_POST['sectoken']==$_SESSION['sectoken']) ) {
-                       $link = OC_Helper::linkToAbsolute('core/lostpassword', 'resetpassword.php', array('user' => urlencode($_POST['user']), 'token' => $token));
+                       $link = OC_Helper::linkToAbsolute('core/lostpassword', 'resetpassword.php', array('user' => $_POST['user'], 'token' => $token));
                        $tmpl = new OC_Template('core/lostpassword', 'email');
                        $tmpl->assign('link', $link, false);
                        $msg = $tmpl->fetchPage();
index 3bb30620175569be15e814dac9062fb86fac4011..8e578735f4ca58e1fcae4df87e2bb22638b181a7 100644 (file)
@@ -33,6 +33,7 @@ class OC_Helper {
         * @param string $app app
         * @param string $file file
         * @param array $args array with param=>value, will be appended to the returned url
+        *      The value of $args will be urlencoded
         * @return string the url
         *
         * Returns a url to the given app and file.
@@ -65,7 +66,7 @@ class OC_Helper {
                if (!empty($args)) {
                        $urlLinkTo .= '?';
                        foreach($args as $k => $v) {
-                               $urlLinkTo .= '&'.$k.'='.$v;
+                               $urlLinkTo .= '&'.$k.'='.urlencode($v);
                        }
                }
 
@@ -77,6 +78,7 @@ class OC_Helper {
         * @param string $app app
         * @param string $file file
         * @param array $args array with param=>value, will be appended to the returned url
+        *      The value of $args will be urlencoded
         * @return string the url
         *
         * Returns a absolute url to the given app and file.
index 747448e62eb4e8678fa5e8d139808a0a10f3911d..38da7e821717ee968d875bdf9576ee57d2e720fb 100644 (file)
@@ -116,6 +116,7 @@ class Util {
         * @param $app app
         * @param $file file
         * @param $args array with param=>value, will be appended to the returned url
+        *      The value of $args will be urlencoded
         * @returns the url
         *
         * Returns a absolute url to the given app and file.
@@ -151,6 +152,7 @@ class Util {
        * @param $app app
        * @param $file file
        * @param $args array with param=>value, will be appended to the returned url
+       *       The value of $args will be urlencoded
        * @returns the url
        *
        * Returns a url to the given app and file.
index 21fae0c1ce541ee7d5e6b62859a7d6b77fdf0d48..e21278f3918f84360a5bb7944e2c4ec755a9291a 100644 (file)
@@ -10,7 +10,6 @@ class OC_Search_Provider_File extends OC_Search_Provider{
 
                        $name = basename($path);
                        $text = '';
-                       $path = urlencode($path);
                        if($mime=='httpd/unix-directory') {
                                $link = OC_Helper::linkTo( 'files', 'index.php', array('dir' => $path));
                                $type = 'Files';
index 777cb7a28fce84763c90343a10bfaf20a8acab87..d1227f8379c70582fe80ae54312f3ed730781e82 100755 (executable)
@@ -344,7 +344,7 @@ class OC_Util {
        public static function checkLoggedIn() {
                // Check if we are a user
                if( !OC_User::isLoggedIn()) {
-                       header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php', array('redirect_url' => urlencode($_SERVER["REQUEST_URI"]))));
+                       header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php', array('redirect_url' => $_SERVER["REQUEST_URI"])));
                        exit();
                }
        }