<?php
// PukiWiki - Yet another WikiWikiWeb clone.
-// $Id: plugin.php,v 1.14 2005/06/30 13:20:05 henoheno Exp $
+// $Id: plugin.php,v 1.20 2011/01/25 15:01:01 henoheno Exp $
// Copyright (C)
// 2002-2005 PukiWiki Developers Team
// 2001-2002 Originally written by yu-ji
$name = strtolower($name);
if(isset($exist[$name])) {
if (++$count[$name] > PKWK_PLUGIN_CALL_TIME_LIMIT)
- die('Alert: plugin "' . htmlspecialchars($name) .
+ die('Alert: plugin "' . htmlsc($name) .
'" was called over ' . PKWK_PLUGIN_CALL_TIME_LIMIT .
' times. SPAM or someting?<br />' . "\n" .
'<a href="' . get_script_uri() . '?cmd=edit&page='.
if(do_plugin_init($name) === FALSE)
return '[Plugin init failed: ' . $name . ']';
+ if (! PKWKEXP_DISABLE_MULTILINE_PLUGIN_HACK) {
+ // Multiline plugin?
+ $pos = strpos($args, "\r"); // "\r" is just a delimiter
+ if ($pos !== FALSE) {
+ $body = substr($args, $pos + 1);
+ $args = substr($args, 0, $pos);
+ }
+ }
+
if ($args === '') {
$aryargs = array(); // #plugin()
} else {
$aryargs = csv_explode(',', $args); // #plugin(A,B,C,D)
}
+ if (! PKWKEXP_DISABLE_MULTILINE_PLUGIN_HACK) {
+ if (isset($body)) $aryargs[] = & $body; // #plugin(){{body}}
+ }
$_digest = $digest;
$retvar = call_user_func_array('plugin_' . $name . '_convert', $aryargs);
$digest = $_digest; // Revert
if ($retvar === FALSE) {
- return htmlspecialchars('#' . $name .
+ return htmlsc('#' . $name .
($args != '' ? '(' . $args . ')' : ''));
} else if (PKWK_ENCODING_HINT != '') {
// Insert a hidden field, supports idenrtifying text enconding
if($retvar === FALSE) {
// Do nothing
- return htmlspecialchars('&' . $name . ($args ? '(' . $args . ')' : '') . ';');
+ return htmlsc('&' . $name . ($args ? '(' . $args . ')' : '') . ';');
} else {
return $retvar;
}