<?php
// PukiWiki - Yet another WikiWikiWeb clone
-// $Id: ref.inc.php,v 1.48 2005/01/28 11:58:56 henoheno Exp $
+// $Id: ref.inc.php,v 1.51 2011/01/25 15:01:01 henoheno Exp $
+// Copyright (C)
+// 2002-2006 PukiWiki Developers Team
+// 2001-2002 Originally written by yu-ji
+// License: GPL v2 or (at your option) any later version
//
// Image refernce plugin
// Include an attached image-file as an inline-image
// Promote new design
if ($is_file_default && $is_file_second) {
// Because of race condition NOW
- $params['_error'] = htmlspecialchars('The same file name "' .
+ $params['_error'] = htmlsc('The same file name "' .
$name . '" at both page: "' . $page . '" and "' . $_arg .
'". Try ref(pagename/filename) to specify one of them');
} else {
// Because of possibility of race condition, in the future
$params['_error'] = 'The style ref(filename,pagename) is ambiguous ' .
'and become obsolete. ' .
- 'Please try ref(pagename/filname)';
+ 'Please try ref(pagename/filename)';
}
return $params;
}
$is_file = is_file($file);
}
if (! $is_file) {
- $params['_error'] = htmlspecialchars('File not found: "' .
+ $params['_error'] = htmlsc('File not found: "' .
$name . '" at page "' . $page . '"');
return $params;
}
$matches = array();
if ($is_url) { // URL
- $url = $url2 = htmlspecialchars($name);
- $title = htmlspecialchars(preg_match('/([^\/]+)$/', $name, $matches) ? $matches[1] : $url);
+ if (PKWK_DISABLE_INLINE_IMAGE_FROM_URI) {
+ //$params['_error'] = 'PKWK_DISABLE_INLINE_IMAGE_FROM_URI prohibits this';
+ //return $params;
+ $url = htmlsc($name);
+ $params['_body'] = '<a href="' . $url . '">' . $url . '</a>';
+ return $params;
+ }
+
+ $url = $url2 = htmlsc($name);
+ $title = htmlsc(preg_match('/([^\/]+)$/', $name, $matches) ? $matches[1] : $url);
$is_image = (! $params['noimg'] && preg_match(PLUGIN_REF_IMAGE, $name));
} else { // źÉÕ¥Õ¥¡¥¤¥ë
- $title = htmlspecialchars($name);
+ $title = htmlsc($name);
$is_image = (! $params['noimg'] && preg_match(PLUGIN_REF_IMAGE, $name));
}
if (! empty($_title)) {
- $title = htmlspecialchars(join(',', $_title));
+ $title = htmlsc(join(',', $_title));
if ($is_image) $title = make_line_rules($title);
}
}
break;
}
}
- $file = htmlspecialchars($filename);
+ $file = htmlsc($filename);
$size = filesize($ref);
// Output