* 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' );
$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 ) {
* @access private
*/
function processUpload(){
- global $wgUser, $wgOut, $wgFileExtensions, $wgLang;
+ global $wgOut, $wgFileExtensions, $wgLang;
$details = null;
$value = null;
$value = $this->internalProcessUpload( $details );
);
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>"
else {
$wgOut->addHTML(
"<input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='60'
- value='{$encDestName}' onchange='toggleFilenameFiller()' $destOnkeyup />"
+ value=\"{$encDestName}\" onchange='toggleFilenameFiller()' $destOnkeyup />"
);
}
<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>" .