]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/ExternalEdit.php
MediaWiki 1.17.0
[autoinstallsdev/mediawiki.git] / includes / ExternalEdit.php
index f3fc22e3bc1067e0e3c068b50c649d52d3e39cf8..7109c1ac935b3421c5f7103b75ebd0de470066ee 100644 (file)
@@ -1,13 +1,14 @@
 <?php
 /**
+ * External editors support
+ *
  * License: Public domain
  *
+ * @file
  * @author Erik Moeller <moeller@scireview.de>
  */
 
 /**
- *
- *
  * 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'
@@ -17,7 +18,6 @@
  * and save the modified data back to the server.
  *
  */
-
 class ExternalEdit {
 
        function __construct( $article, $mode ) {
@@ -34,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
@@ -47,16 +48,16 @@ class ExternalEdit {
                } elseif($this->mMode=="file") {
                        $type="Edit file";
                        $image = wfLocalFile( $this->mTitle );
-                       $img_url = $image->getURL();
-                       if(strpos($img_url,"://")) {
-                               $url = $img_url;
-                       } else {
-                               $url = $wgServer . $img_url;
-                       }
+                       $url = $image->getFullURL();
                        $extension=substr($name, $pos);
                }
                $special=$wgLang->getNsText(NS_SPECIAL);
                $control = <<<CONTROL
+; You're seeing this file because you're using Mediawiki's External Editor
+; feature. This is probably because you selected use external editor
+; in your preferences. To edit normally, either disable that preference
+; or go to the URL $url .
+; See http://www.mediawiki.org/wiki/Manual:External_editors for details.
 [Process]
 Type=$type
 Engine=MediaWiki
@@ -72,4 +73,3 @@ CONTROL;
                echo $control;
        }
 }
-