最新消息:imsyx老店新开,原博客因服务器问题,数据全毁,痛心!

PHPCMSv9 前台投稿显示html字符,图片上传大小限制失效的解决办法

二次开发 tally 731浏览

phpcms我的版本是:V9.5.2,其他版本对照参考修改。

1、前台投稿显示HTML字符

/phpcms/modules/member/content.php

查找:

if(in_array($_k, $fields)) $info[$_k] = new_html_special_chars(trim_script($_v));

修改为:

if(in_array($_k, $fields)) $info[$_k] = trim_script($_v); //解决前台发布出现html字符tally2014-04-28

2、图片上传大小限制失效

/phpcms/libs/classes/attachment.class.php

查找:

$this->maxsize = $maxsize;

修改为:

if(empty($maxsize) || $maxsize == 0) {
  $site_setting = $this->_get_site_setting($this->siteid);
  $this->maxsize = $site_setting[‘upload_maxsize’]*1024;
}

/phpcms/modules/attachment/attachments.php

查找:

if($a){
  $filepath = $attachment->uploadedfiles[0][‘filepath’];
  $fn = intval($_GET[‘CKEditorFuncNum’]);
  $this->upload_json($a[0],$filepath,$attachment->uploadedfiles[0][‘filename’]);
  $attachment->mkhtml($fn,$this->upload_url.$filepath,”);
}

添加:

else{
  echo($attachment->error());
}

 

转载请注明:小码农 » PHPCMSv9 前台投稿显示html字符,图片上传大小限制失效的解决办法