X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FExternalEdit.php;h=f5ce5b9d0d5a33cdaae40d220f017793db21ccef;hb=72f3df40d2ed32e8d7af94b958210aa57b1152d1;hp=14b55fdbde2685923689fac04c24a10b91bed873;hpb=fa813bd470e8209045f38b3c78fa74f782a63f4f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ExternalEdit.php b/includes/ExternalEdit.php index 14b55fdbde..f5ce5b9d0d 100644 --- a/includes/ExternalEdit.php +++ b/includes/ExternalEdit.php @@ -3,12 +3,10 @@ * License: Public domain * * @author Erik Moeller - * @package MediaWiki */ /** * - * @package MediaWiki * * Support for external editors to modify both text and files * in external applications. It works as follows: MediaWiki @@ -22,7 +20,7 @@ class ExternalEdit { - function ExternalEdit ( $article, $mode ) { + function __construct( $article, $mode ) { global $wgInputEncoding; $this->mArticle =& $article; $this->mTitle =& $article->mTitle; @@ -36,6 +34,7 @@ class ExternalEdit { $name=$this->mTitle->getText(); $pos=strrpos($name,".")+1; header ( "Content-type: application/x-external-editor; charset=".$this->mCharset ); + header( "Cache-control: no-cache" ); # $type can be "Edit text", "Edit file" or "Diff text" at the moment # See the protocol specifications at [[m:Help:External editors/Tech]] for @@ -48,13 +47,8 @@ class ExternalEdit { $extension="wiki"; } elseif($this->mMode=="file") { $type="Edit file"; - $image = new Image( $this->mTitle ); - $img_url = $image->getURL(); - if(strpos($img_url,"://")) { - $url = $img_url; - } else { - $url = $wgServer . $img_url; - } + $image = wfLocalFile( $this->mTitle ); + $url = $image->getFullURL(); $extension=substr($name, $pos); } $special=$wgLang->getNsText(NS_SPECIAL); @@ -74,4 +68,4 @@ CONTROL; echo $control; } } -?> +