/** * @return int */ function htmlspecialchars_flags() { switch (Doctype::get()) { case Doctype::VER_HTML_4_01: $flags = ENT_HTML401; break; case Doctype::VER_HTML_5: $flags = ENT_HTML5; break; default: if (Doctype::isXhtml()) { $flags = ENT_XHTML; } else { debug_enforce(false, "Unhandled doctype " . Doctype::get()); $flags = null; } break; } return $flags; }