refプラグインが出力するタグで属性のないファイル名が出力される。

メッセージ

#ref(http://reimy.com/logo.png)
logo.png

これが吐くHTMLタグは次のようになっている(読みにくいので改行を入れてある)。

<div class="img_margin" style="text-align:left">
<a href="http://reimy.com/logo.png" title="logo.png">
<img src="http://reimy.com/logo.png" alt="logo.png"
     title="logo.png" http://reimy.com/logo.png />
</a></div>

外部ファイルを指定した場合、<img>タグのtitle属性の後ろに、属性のないファイル名が出力されている。

以下、対策。

ref.inc.php 202行目あたり

   else
   {
-      $info = $url;
+      $info = '';
    }

ついでに余計な空白が入るのを防ぐために

ref.inc.php 316行目あたり

   if ($width and $height)
   {
-       $info = "width=\"$width\" height=\"$height\"";
+       $info = "width=\"$width\" height=\"$height\" ";
    }

ref.inc.php 342行目あたり

   // ファイル種別判定
   if ($is_image)	// 画像
   {
-      $_url = "<img src=\"$url\" alt=\"$title\" title=\"$title\" $info />";
+      $_url = "<img src=\"$url\" alt=\"$title\" title=\"$title\" $info/>";
       if (!$params['nolink'] and $url2)
       {


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2003-04-26 (土) 18:53:14
Site admin: PukiWiki Development Team

PukiWiki 1.5.4+ © 2001-2022 PukiWiki Development Team. Powered by PHP 8.2.12. HTML convert time: 0.170 sec.

SourceForge