* code for paste image.
This commit is contained in:
@@ -340,7 +340,7 @@ class file extends control
|
||||
*/
|
||||
public function ajaxPasteImg($uid = '')
|
||||
{
|
||||
if($_POST) return print($this->file->pasteImage($this->post->editor, $uid));
|
||||
if($_POST) return print($this->file->pasteImage($this->post->editor, $uid, $safe = true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -549,10 +549,12 @@ class fileModel extends model
|
||||
* Paste image in kindeditor at firefox and chrome.
|
||||
*
|
||||
* @param string $data
|
||||
* @param string $uid
|
||||
* @param bool $safe
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function pasteImage($data, $uid = '')
|
||||
public function pasteImage($data, $uid = '', $safe = false)
|
||||
{
|
||||
if(empty($data)) return '';
|
||||
$data = str_replace('\"', '"', $data);
|
||||
@@ -583,7 +585,7 @@ class fileModel extends model
|
||||
$data = str_replace($out[1][$key], helper::createLink('file', 'read', "fileID=$fileID", $file['extension']), $data);
|
||||
}
|
||||
}
|
||||
else
|
||||
elseif($safe)
|
||||
{
|
||||
$data = fixer::stripDataTags(rawurldecode($data));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user