r8104 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r8103‎ | r8104 | r8105 >
Date:06:29, 7 April 2005
Author:eloquence
Status:old
Tags:
Comment:
1) we need an absolute path for the image, since it needs to be retrieved
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)
Modified paths:
  • /trunk/phase3/includes/ExternalEdit.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ExternalEdit.php
@@ -31,7 +31,7 @@
3232 }
3333
3434 function edit() {
35 - global $wgUser, $wgOut, $wgScript, $wgServer;
 35+ global $wgUser, $wgOut, $wgScript, $wgScriptPath, $wgServer;
3636 $wgOut->disable();
3737 $name=$this->mTitle->getText();
3838 $pos=strrpos($name,".")+1;
@@ -45,7 +45,7 @@
4646 } elseif($this->mMode=="file") {
4747 $type="Edit file";
4848 $url = Image::newFromTitle( $this->mTitle );
49 - $url = $url->url; # php sucks
 49+ $url = $wgServer . $url->url; # php sucks
5050
5151 $extension=substr($name, $pos);
5252 }
@@ -54,6 +54,8 @@
5555 Type=$type
5656 Engine=MediaWiki
5757 Script={$wgServer}{$wgScript}
 58+Server={$wgServer}
 59+Path={$wgScriptPath}
5860
5961 [File]
6062 Extension=$extension

Status & tagging log