[[alias>http://localhost/image.png]]の処理は意図したものか?

メッセージ

[[alias>URL]]形式で画像にリンクすると、期待したように表示されない。


症状

[[http://www.example.com/.png>http://www.example.com/]]

→[[http://www.example.com/.png>http://www.example.com/]]

(インライン画像を有効にしないと表示されない)

現状

aliasがURLとして有効で、.png等の拡張子を持つ場合に、

<a href="http&#x3a;//www.example.com/" rel="nofollow">
  <img src="http&#x3a;//www.example.com/.png" alt="http&#x3a;//www.example.com/" />
</a>

期待する動作

nameがURLとして有効で、.png等の拡張子を持つ場合に、

<a href="http&#x3a;//www.example.com/" rel="nofollow">
  <img src="http&#x3a;//www.example.com/" alt="http&#x3a;//www.example.com/.png" />
</a>

パッチ例

--- make_link.php.070907	2007-05-09 17:26:27.000000000 +0900
+++ make_link.php	2007-09-08 03:27:16.000000000 +0900
@@ -186,8 +186,8 @@
 		$this->body = $body;
 		$this->type = $type;
 		if (! PKWK_DISABLE_INLINE_IMAGE_FROM_URI &&
-			is_url($alias) && preg_match('/\.(gif|png|jpe?g)$/i', $alias)) {
-			$alias = '<img src="' . htmlspecialchars($alias) . '" alt="' . $name . '" />';
+			is_url($name) && preg_match('/\.(gif|png|jpe?g)(\?|$)/i', $name)) {
+			$alias = '<img src="' . htmlspecialchars($name) . '" alt="' . $alias . '" />';
 		} else if ($alias != '') {
 			if ($converter === NULL)
 				$converter = new InlineConverter(array('plugin'));

関連項目

コメント



トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2008-10-20 (月) 18:55:17
Site admin: PukiWiki Development Team

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

SourceForge