Exemple #1
0
//	FCKeditor : Copyright (C) 2003-2008 Frederico Caldeira Knabben
//
//
//	File:
//	  xhtml2wiki.php
//	  XHTML を PukiWiki の構文に変換
//
error_reporting(0);
$post = isset($_POST['s']) ? $_POST['s'] : $_GET['s'];
$line_break = isset($_POST['lb']) ? $_POST['lb'] : $_GET['lb'];
if (get_magic_quotes_gpc()) {
    $post = stripslashes($post);
}
define('DEBUG', !empty($_GET['debug']));
$source = str_replace(array("\r\n", "\r"), "\n", $post);
$postdata = xhtml2wiki($source);
Send_xml($postdata);
function debug($data)
{
    $file = dirname(__FILE__) . '/debug.txt';
    @unlink($file);
    file_put_contents($file, $data);
}
//	XML 形式で出力
function Send_xml($postdata)
{
    $postdata = trim($postdata, "\n") . "\n";
    $out = '<?xml version="1.0" encoding="UTF-8" ?>' . "\n";
    $out .= '<res><![CDATA[' . $postdata . ']]></res>';
    //	出力
    header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
function plugin_guiedit_write()
{
    global $vars;
    global $guiedit_use_fck;
    if ($guiedit_use_fck) {
        //	構文の変換
        require_once GUIEDIT_LIB_PATH . 'xhtml2wiki.php';
        $vars['msg'] = xhtml2wiki($vars['msg']);
    }
    //	書き込み
    exist_plugin('edit');
    // require_once("edit.inc.php");
    return plugin_edit_write();
}