From d9baf1a70bff3db65f4443658c00eae23ad11c8a Mon Sep 17 00:00:00 2001
From: Kazutaka Miyasaka <kazmiya@gmail.com>
Date: Sun, 15 Nov 2009 14:13:28 +0100
Subject: [PATCH] fixed a bug of image links with relative mediaID FS#1775

Ignore-this: d1798348ca669a3471f33b501f6b1aa

darcs-hash:20091115131328-9b77a-9f24277aba89ddc4c8dca30edacaeeb44f29e628.gz
---
 inc/parser/xhtml.php | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index 54177d8c3..4d5333f7a 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -1087,6 +1087,15 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
      * @author Andreas Gohr <andi@splitbrain.org>
      */
     function _imageTitle($img) {
+        global $ID;
+
+        // some fixes on $img['src']
+        // see internalmedia() and externalmedia()
+        list($img['src'],$hash) = explode('#',$img['src'],2);
+        if ($img['type'] == 'internalmedia') {
+            resolve_mediaid(getNS($ID),$img['src'],$exists);
+        }
+
         return $this->_media($img['src'],
                               $img['title'],
                               $img['align'],
-- 
GitLab