Commit 9dd1a09e authored by hancong03's avatar hancong03

对输入进行转义;修复dirname函数的拼写错误

Signed-off-by: 's avatarhancong03 <hancong03@baidu.com>
parent adf5189f
...@@ -6,11 +6,11 @@ require_once "Parser.freemind.class.php"; ...@@ -6,11 +6,11 @@ require_once "Parser.freemind.class.php";
class Parser { class Parser {
public static function toXMind ( $source, $previewImage = null ) { public static function toXMind ( $source, $previewImage = null ) {
return XMindParser::parse( $source, $previewImage ); return XMindParser::parse( htmlspecialchars( $source, ENT_NOQUOTES ), $previewImage );
} }
public static function toFreeMind ( $source ) { public static function toFreeMind ( $source ) {
return FreeMindParser::parse( $source ); return FreeMindParser::parse( htmlspecialchars( $source, ENT_NOQUOTES ) );
} }
} }
\ No newline at end of file
...@@ -198,7 +198,7 @@ class XMindParser { ...@@ -198,7 +198,7 @@ class XMindParser {
private static function move ( $meta, $path ) { private static function move ( $meta, $path ) {
$config = require( diranme( __FILE__ ) . '/../config.php' ); $config = require( dirname( __FILE__ ) . '/../config.php' );
$savepath = $config[ 'savepath' ]; $savepath = $config[ 'savepath' ];
if ( !file_exists( $savepath ) ) { if ( !file_exists( $savepath ) ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment