1) we need an absolute path for the image, since it needs to be retrieved
authorErik Moeller <erik@users.mediawiki.org>
Thu, 7 Apr 2005 06:29:08 +0000 (06:29 +0000)
committerErik Moeller <erik@users.mediawiki.org>
Thu, 7 Apr 2005 06:29:08 +0000 (06:29 +0000)
by the external editor helper application (NB: that fatal error was probably
a PHP 4/5 thing, I'm using PHP 5 here).

2) adding some extra information for the helper, this should all be made
a little more logical (only pass on as much information as needed to
construct the proper URLs)

includes/ExternalEdit.php

index 7d02447..b52dcf0 100644 (file)
@@ -31,7 +31,7 @@ class ExternalEdit {
        }
        
        function edit() {
-               global $wgUser, $wgOut, $wgScript, $wgServer;
+               global $wgUser, $wgOut, $wgScript, $wgScriptPath, $wgServer;
                $wgOut->disable();
                $name=$this->mTitle->getText();
                $pos=strrpos($name,".")+1;
@@ -45,7 +45,7 @@ class ExternalEdit {
                } elseif($this->mMode=="file") {
                        $type="Edit file"; 
                        $url = Image::newFromTitle( $this->mTitle );
-                       $url = $url->url; # php sucks
+                       $url = $wgServer . $url->url; # php sucks
                        
                        $extension=substr($name, $pos);
                }                                        
@@ -54,6 +54,8 @@ class ExternalEdit {
 Type=$type
 Engine=MediaWiki
 Script={$wgServer}{$wgScript}
+Server={$wgServer}
+Path={$wgScriptPath}
 
 [File]
 Extension=$extension