Exemplo n.º 1
0
 private static function &pluginDummy(&$root, $text)
 {
     $matches = array();
     if (preg_match('/^#([^\\(\\{]+)(?:\\(([^\\r]*)\\))?(\\{*)/', $text, $matches) && PluginRenderer::hasPluginMethod($matches[1], 'convert')) {
         $len = strlen($matches[3]);
         $body = array();
         if ($len === 0) {
             $ret = new BlockPluginDummy($matches);
             // Seems legacy block plugin
         } else {
             if (preg_match('/\\{{' . $len . '}\\s*\\r(.*)\\r\\}{' . $len . '}/', $text, $body)) {
                 $matches[2] .= "\r" . $body[1] . "\r";
                 $ret = new BlockPluginDummy($matches);
                 // Seems multiline-enabled block plugin
             }
         }
     }
     return $ret;
 }
Exemplo n.º 2
0
    PluginRenderer::executePluginInline('remoteip');
}
// プラグインのaction命令を実行
$cmd = strtolower($vars['cmd']);
$is_protect = Auth::is_protect();
if ($is_protect) {
    $plugin_arg = '';
    if (Auth::is_protect_plugin_action($cmd)) {
        PluginRenderer::executePluginAction($cmd);
        // Location で飛ばないプラグインの場合
        $plugin_arg = $cmd;
    }
    PluginRenderer::executePluginBlock('protect', $plugin_arg);
}
if (!empty($cmd)) {
    if (!PluginRenderer::hasPluginMethod($cmd, 'action')) {
        // プラグインにactionが定義されてない場合
        Utility::dieMessage(sprintf($_string['plugin_not_implemented'], Utility::htmlsc($cmd)), 501);
    } else {
        // プラグインのactionを実行する。
        // 帰り値:array('title', 'body', 'http_code');
        $retvars = PluginRenderer::executePluginAction($cmd);
    }
}
if ($is_protect) {
    // Location で飛ぶようなプラグインの対応のため
    // 上のアクションプラグインの実行後に処理を実施
    PluginRenderer::executePluginBlock('protect');
    die('<var>PLUS_PROTECT_MODE</var> is set.');
}
///////////////////////////////////////