Kill a bunch of unused $wgUser
[lhc/web/wiklou.git] / includes / specials / SpecialUpload.php
index 7d28a38..232064d 100644 (file)
@@ -155,7 +155,7 @@ class UploadForm {
         * Returns true if there was an error, false otherwise
         */
        private function curlCopy( $url, $dest ) {
-               global $wgUser, $wgOut, $wgHTTPProxy;
+               global $wgUser, $wgOut, $wgHTTPProxy, $wgCopyUploadTimeout;
 
                if( !$wgUser->isAllowed( 'upload_by_url' ) ) {
                        $wgOut->permissionRequired( 'upload_by_url' );
@@ -180,7 +180,7 @@ class UploadForm {
 
                $ch = curl_init();
                curl_setopt( $ch, CURLOPT_HTTP_VERSION, 1.0); # Probably not needed, but apparently can work around some bug
-               curl_setopt( $ch, CURLOPT_TIMEOUT, 10); # 10 seconds timeout
+               curl_setopt( $ch, CURLOPT_TIMEOUT, $wgCopyUploadTimeout); # Default 30 seconds timeout
                curl_setopt( $ch, CURLOPT_LOW_SPEED_LIMIT, 512); # 0.5KB per second minimum transfer speed
                curl_setopt( $ch, CURLOPT_URL, $url);
                if( $wgHTTPProxy ) {
@@ -288,7 +288,7 @@ class UploadForm {
         * @access private
         */
        function processUpload(){
-               global $wgUser, $wgOut, $wgFileExtensions, $wgLang;
+               global $wgOut, $wgFileExtensions, $wgLang;
                $details = null;
                $value = null;
                $value = $this->internalProcessUpload( $details );
@@ -1157,8 +1157,7 @@ wgUploadAutoFill = {$autofill};
                );
                if( $this->mForReUpload ) {
                        $wgOut->addHTML(
-                               "<input tabindex='2' type='hidden' name='wpDestFile' id='wpDestFile' 
-                                       value='{$encDestName}' />" . 
+                               Xml::hidden( 'wpDestFile', $this->mDesiredDestName, array('id'=>'wpDestFile','tabindex'=>2) ) .
                                "<tt>" .
                                $encDestName .
                                "</tt>"
@@ -1167,7 +1166,7 @@ wgUploadAutoFill = {$autofill};
                else {
                        $wgOut->addHTML(
                                "<input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='60'
-                                               value='{$encDestName}' onchange='toggleFilenameFiller()' $destOnkeyup />"
+                                               value=\"{$encDestName}\" onchange='toggleFilenameFiller()' $destOnkeyup />"
                        );
                }
                
@@ -1254,14 +1253,17 @@ wgUploadAutoFill = {$autofill};
                        <tr>
                                <td></td>
                                        <td class='mw-input'>
-                                               <input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\"" . $wgUser->getSkin()->tooltipAndAccesskey( 'upload' ) . " />
+                                               <input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\"" .
+                                                       $wgUser->getSkin()->tooltipAndAccesskey( 'upload' ) . " />
                                        </td>
                        </tr>
                        <tr>
                                <td></td>
                                <td class='mw-input'>"
                );
-               $wgOut->addWikiText( wfMsgForContent( 'edittools' ) );
+               $wgOut->addHTML( '<div class="mw-editTools">' );
+               $wgOut->addWikiMsgArray( 'edittools', array(), array( 'content' ) );
+               $wgOut->addHTML( '</div>' );
                $wgOut->addHTML( "
                                </td>
                        </tr>" .