1

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.

wnajar
  • 747
  • 1
  • 7
  • 27
  • Possible duplicate of [Notice: Use of undefined constant ENT\_HTML5 - assumed 'ENT\_HTML5'](https://stackoverflow.com/questions/11523282/notice-use-of-undefined-constant-ent-html5-assumed-ent-html5) – Bram Vanroy Nov 23 '18 at 11:51

1 Answers1

4

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.

Mike
  • 23,542
  • 14
  • 76
  • 87