]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add url-params to url with new parameter in linkTo function
authorBart Visscher <bartv@thisnet.nl>
Mon, 3 Sep 2012 17:12:52 +0000 (19:12 +0200)
committerBart Visscher <bartv@thisnet.nl>
Mon, 3 Sep 2012 19:51:32 +0000 (21:51 +0200)
apps/files_versions/templates/history.php
core/lostpassword/index.php
lib/search/provider/file.php
lib/util.php

index d4f875a36e870ba42f88cffdf3b5dcb7a0e82c6b..99bc153a816ad41275f1fda3ff1ec810eee5780d 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').'?path='.urlencode( $_['path'] ).'&revert='. $v['version'] .'" class="button">Revert</a><br /><br />';
+               echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php', array('path' => urlencode( $_['path'] ), 'revert' => $v['version'])) .'" class="button">Revert</a><br /><br />';
                if ( $v['cur'] ) { echo '  (<b>Current</b>)'; }
                echo '<br /><br />';
        }
index 8f86fe23aad489e2274c7343d97a72d87904e0a1..58dab5973247c76aa7ccef0c949df2ad0092ebf1 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').'?user='.urlencode($_POST['user']).'&token='.$token;
+                       $link = OC_Helper::linkToAbsolute('core/lostpassword', 'resetpassword.php', array('user' => urlencode($_POST['user']), 'token' => $token));
                        $tmpl = new OC_Template('core/lostpassword', 'email');
                        $tmpl->assign('link', $link, false);
                        $msg = $tmpl->fetchPage();
index a37af4955999cb44a43bfca5ce6016887d92835b..12a535876fe16e4dc0adc2878bd0278a1b49740d 100644 (file)
@@ -8,23 +8,23 @@ class OC_Search_Provider_File extends OC_Search_Provider{
                        $file=$fileData['path'];
                        $mime=$fileData['mimetype'];
                        if($mime=='httpd/unix-directory'){
-                               $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'index.php' ).'?dir='.$file,'Files');
+                               $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'index.php', array('dir' => $file)),'Files');
                        }else{
                                $mimeBase=$fileData['mimepart'];
                                switch($mimeBase){
                                        case 'audio':
                                                break;
                                        case 'text':
-                                               $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php' ).'?file='.$file,'Text');
+                                               $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php', array('dir' => $file) ),'Text');
                                                break;
                                        case 'image':
-                                               $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php' ).'?file='.$file,'Images');
+                                               $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php', array('dir' => $file) ),'Images');
                                                break;
                                        default:
                                                if($mime=='application/xml'){
-                                                       $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php' ).'?file='.$file,'Text');
+                                                       $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php', array('dir' => $file) ),'Text');
                                                }else{
-                                                       $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php' ).'?file='.$file,'Files');
+                                                       $results[]=new OC_Search_Result(basename($file),'',OC_Helper::linkTo( 'files', 'download.php', array('dir' => $file) ),'Files');
                                                }
                                }
                        }
index 581b6bdb317b726cd7b444b3db714e4de76c652f..42a0f5c7df13d5ad89d8321b69b9a83f3cdf0286 100755 (executable)
@@ -320,7 +320,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' ).'?redirect_url='.urlencode($_SERVER["REQUEST_URI"]));
+                       header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php', array('redirect_url' => urlencode($_SERVER["REQUEST_URI"]))));
                        exit();
                }
        }