check that $wgArticle is an instance of the Article class in Skin::pageStats() per...
[lhc/web/wiklou.git] / includes / ExternalEdit.php
index 14b55fd..1c58f44 100644 (file)
@@ -3,13 +3,9 @@
  * License: Public domain
  *
  * @author Erik Moeller <moeller@scireview.de>
- * @package MediaWiki
  */
 
 /**
- *
- * @package MediaWiki
- *
  * Support for external editors to modify both text and files
  * in external applications. It works as follows: MediaWiki
  * sends a meta-file with the MIME type 'application/x-external-editor'
@@ -22,7 +18,7 @@
 
 class ExternalEdit {
 
-       function ExternalEdit ( $article, $mode ) {
+       function __construct( $article, $mode ) {
                global $wgInputEncoding;
                $this->mArticle =& $article;
                $this->mTitle =& $article->mTitle;
@@ -36,6 +32,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 +45,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 +66,3 @@ CONTROL;
                echo $control;
        }
 }
-?>