Woops, fix bug with last commit when the number of rows <= 2.
[lhc/web/wiklou.git] / includes / ExternalEdit.php
index e1841f5..f592d3c 100644 (file)
@@ -3,12 +3,10 @@
  * 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
@@ -48,13 +46,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 +67,4 @@ CONTROL;
                echo $control;
        }
 }
-?>
+