* code for paste image.

This commit is contained in:
王怡栋
2022-03-01 08:54:27 +08:00
parent 2dac4c550e
commit 5ee1c3e5e3
2 changed files with 5 additions and 3 deletions

View File

@@ -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));
}
/**

View File

@@ -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));
}