最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【未解决】warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in XXXincludesbootstrap.inc on line 857

Drupal crifan 1987浏览 0评论

【未解决】warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in XXXincludesbootstrap.inc on line 857

【问题背景】

Drupal 6.20,在新建的page里面,使用File attachments功能,上传一个文件,文件名中包含中文,结果点击上传的时候,显示错误:

warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in E:DrupalApache_rootApache Software FoundationApache2.2htdocsdrupal6includesbootstrap.inc on line 857.

【解决过程】

1.去这里:

http://drupal.org/node/837322

看到说,最好装个Transliteration,所以去试试。

2.试了试transliteration,结果6.x-3.0和6.x-3.x-dev,都和我此处的drupal不兼容,只要一把transliteration放到modules下面,admin/build/modules就白屏,试了很多次,还是无法解决白屏问题,所以只能放弃。。。

3.去按照这里:

http://drupal.org/node/837322

说的,用这里:

http://info4admins.com/warning-htmlspecialchars-expects-parameter-1-be-string-array-given-includesbootstrap-inc-line/

的方法,去includes/bootstrap.inc的857行中,改为:

 //Orginal: return htmlspecialchars($text, ENT_QUOTES, ’UTF-8‘);
 //Fix to:
 return (preg_match(‘/^./us‘, (string) $text) == 1) ? htmlspecialchars((string) $text, ENT_QUOTES, ‘UTF-8’) : ’‘;

结果还是不行,问题依旧。

4.按照这里:

http://drupal.org/node/894880

去把

 function check_plain($text) {
static $php525;

if (!isset($php525)) {
$php525 = version_compare(PHP_VERSION, ‘5.2.5’, ‘>=’);
}
if ($php525) {
return htmlspecialchars($text, ENT_QUOTES, ‘UTF-8’);
}
return (preg_match(‘/^./us’, $text) == 1) ? htmlspecialchars($text, ENT_QUOTES, ‘UTF-8’) : ”;
}

换为:

 function check_plain($text) {
return drupal_validate_utf8($text) ? htmlspecialchars($text, ENT_QUOTES) : ”;
}

  还是不行。

转载请注明:在路上 » 【未解决】warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in XXXincludesbootstrap.inc on line 857

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
81 queries in 0.157 seconds, using 21.97MB memory