简体   繁体   中英

PHP: Use of undefined constant ENT_HTML5 - assumed 'ENT_HTML5'

I'm getting the error:

Use of undefined constant ENT_HTML5 - assumed 'ENT_HTML5' in /blahblahpath/application/models/Post.php on line 12

in a simple model that deals with some POST input in a forum app. The line that triggers this is as such:

$this->set_attribute('body', htmlspecialchars(strip_tags($body), ENT_NOQUOTES | ENT_HTML5));

Very simple.. I'm wondering if this is a server error because I just migrated to a new server and only encounter the problem there. No idea where to start and Googling hasn't yielded much. Using Ubuntu Server 12.04 LTS (the Windows Azure version) and PHP 5.3.10-1ubuntu3.10.

If you check the manual , you will notice that ENT_HTML5 was added in version 5.4.0.

5.4.0 The constants ENT_SUBSTITUTE, ENT_DISALLOWED, ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added.

You will need to either upgrade PHP or not use any unsupported constants.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM