Definition at line 70 of file PH5P.php.
◆ __construct()
HTML5::__construct |
( |
|
$data | ) |
|
Definition at line 461 of file PH5P.php.
References $data, data, and EOF.
467 $this->content_model = self::PCDATA;
469 $this->state =
'data';
471 while ($this->state !== null) {
472 $this->{$this->state .
'State'}();
◆ afterAttributeNameState()
HTML5::afterAttributeNameState |
( |
| ) |
|
|
private |
Definition at line 955 of file PH5P.php.
References EOF.
961 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
968 $this->state =
'afterAttributeName';
970 } elseif (
$char ===
'=') {
973 $this->state =
'beforeAttributeValue';
975 } elseif (
$char ===
'>') {
979 $this->state =
'data';
981 } elseif (
$char ===
'/' && $this->
character($this->
char + 1) !==
'>') {
985 $this->state =
'beforeAttributeName';
987 } elseif ($this->
char === $this->
EOF) {
994 $this->state =
'data';
1001 $this->token[
'attr'][] = array(
1002 'name' => strtolower(
$char),
1006 $this->state =
'attributeName';
◆ afterDoctypeNameState()
HTML5::afterDoctypeNameState |
( |
| ) |
|
|
private |
Definition at line 1418 of file PH5P.php.
References EOF.
1424 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
1427 } elseif (
$char ===
'>') {
1429 $this->state =
'data';
1431 } elseif ($this->
char === $this->
EOF) {
1434 $this->state =
'data';
1437 $this->token[
'error'] =
true;
1438 $this->state =
'bogusDoctype';
◆ attributeNameState()
HTML5::attributeNameState |
( |
| ) |
|
|
private |
Definition at line 903 of file PH5P.php.
References EOF.
909 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
916 $this->state =
'afterAttributeName';
918 } elseif (
$char ===
'=') {
921 $this->state =
'beforeAttributeValue';
923 } elseif (
$char ===
'>') {
927 $this->state =
'data';
929 } elseif (
$char ===
'/' && $this->
character($this->
char + 1) !==
'>') {
933 $this->state =
'beforeAttributeName';
935 } elseif ($this->
char === $this->
EOF) {
942 $this->state =
'data';
948 $last = count($this->token[
'attr']) - 1;
949 $this->token[
'attr'][$last][
'name'] .= strtolower(
$char);
951 $this->state =
'attributeName';
◆ attributeValueDoubleQuotedState()
HTML5::attributeValueDoubleQuotedState |
( |
| ) |
|
|
private |
Definition at line 1059 of file PH5P.php.
References EOF.
1065 if (
$char ===
'"') {
1068 $this->state =
'beforeAttributeName';
1070 } elseif (
$char ===
'&') {
1075 } elseif ($this->
char === $this->
EOF) {
1082 $this->state =
'data';
1088 $last = count($this->token[
'attr']) - 1;
1089 $this->token[
'attr'][$last][
'value'] .=
$char;
1091 $this->state =
'attributeValueDoubleQuoted';
entityInAttributeValueState()
◆ attributeValueSingleQuotedState()
HTML5::attributeValueSingleQuotedState |
( |
| ) |
|
|
private |
Definition at line 1095 of file PH5P.php.
References EOF.
1101 if (
$char ===
'\'') {
1104 $this->state =
'beforeAttributeName';
1106 } elseif (
$char ===
'&') {
1111 } elseif ($this->
char === $this->
EOF) {
1118 $this->state =
'data';
1124 $last = count($this->token[
'attr']) - 1;
1125 $this->token[
'attr'][$last][
'value'] .=
$char;
1127 $this->state =
'attributeValueSingleQuoted';
entityInAttributeValueState()
◆ attributeValueUnquotedState()
HTML5::attributeValueUnquotedState |
( |
| ) |
|
|
private |
Definition at line 1131 of file PH5P.php.
1137 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
1144 $this->state =
'beforeAttributeName';
1146 } elseif (
$char ===
'&') {
1151 } elseif (
$char ===
'>') {
1155 $this->state =
'data';
1161 $last = count($this->token[
'attr']) - 1;
1162 $this->token[
'attr'][$last][
'value'] .=
$char;
1164 $this->state =
'attributeValueUnquoted';
entityInAttributeValueState()
◆ beforeAttributeNameState()
HTML5::beforeAttributeNameState |
( |
| ) |
|
|
private |
Definition at line 853 of file PH5P.php.
References EOF.
859 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
866 $this->state =
'beforeAttributeName';
868 } elseif (
$char ===
'>') {
872 $this->state =
'data';
874 } elseif (
$char ===
'/') {
878 $this->state =
'beforeAttributeName';
880 } elseif ($this->
char === $this->
EOF) {
887 $this->state =
'data';
894 $this->token[
'attr'][] = array(
895 'name' => strtolower(
$char),
899 $this->state =
'attributeName';
◆ beforeAttributeValueState()
HTML5::beforeAttributeValueState |
( |
| ) |
|
|
private |
Definition at line 1010 of file PH5P.php.
1016 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
1023 $this->state =
'beforeAttributeValue';
1025 } elseif (
$char ===
'"') {
1028 $this->state =
'attributeValueDoubleQuoted';
1030 } elseif (
$char ===
'&') {
1035 $this->state =
'attributeValueUnquoted';
1037 } elseif (
$char ===
'\'') {
1040 $this->state =
'attributeValueSingleQuoted';
1042 } elseif (
$char ===
'>') {
1046 $this->state =
'data';
1052 $last = count($this->token[
'attr']) - 1;
1053 $this->token[
'attr'][$last][
'value'] .=
$char;
1055 $this->state =
'attributeValueUnquoted';
◆ beforeDoctypeNameState()
HTML5::beforeDoctypeNameState |
( |
| ) |
|
|
private |
Definition at line 1336 of file PH5P.php.
References EOF.
1342 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
1345 } elseif (preg_match(
'/^[a-z]$/',
$char)) {
1346 $this->token = array(
1347 'name' => strtoupper(
$char),
1348 'type' => self::DOCTYPE,
1352 $this->state =
'doctypeName';
1354 } elseif (
$char ===
'>') {
1358 'type' => self::DOCTYPE,
1363 $this->state =
'data';
1365 } elseif ($this->
char === $this->
EOF) {
1369 'type' => self::DOCTYPE,
1375 $this->state =
'data';
1378 $this->token = array(
1380 'type' => self::DOCTYPE,
1384 $this->state =
'doctypeName';
◆ bogusCommentState()
HTML5::bogusCommentState |
( |
| ) |
|
|
private |
Definition at line 1184 of file PH5P.php.
References $data, and EOF.
1198 'type' => self::COMMENT
1202 $this->
char += strlen(
$data);
1205 $this->state =
'data';
1208 if ($this->
char === $this->
EOF) {
1209 $this->
char = $this->
EOF - 1;
characters($char_class, $start)
◆ bogusDoctypeState()
HTML5::bogusDoctypeState |
( |
| ) |
|
|
private |
Definition at line 1442 of file PH5P.php.
References EOF.
1448 if (
$char ===
'>') {
1450 $this->state =
'data';
1452 } elseif ($this->
char === $this->
EOF) {
1455 $this->state =
'data';
◆ char()
◆ character()
HTML5::character |
( |
|
$s, |
|
|
|
$l = 0 |
|
) |
| |
|
private |
◆ characters()
HTML5::characters |
( |
|
$char_class, |
|
|
|
$start |
|
) |
| |
|
private |
Definition at line 499 of file PH5P.php.
References $start, and data.
501 return preg_replace(
'#^([' . $char_class .
']+).*#s',
'\\1', substr($this->
data,
$start));
◆ closeTagOpenState()
HTML5::closeTagOpenState |
( |
| ) |
|
|
private |
Definition at line 727 of file PH5P.php.
References EOF.
729 $next_node = strtolower($this->
characters(
'A-Za-z', $this->
char + 1));
730 $the_same = count($this->tree->stack) > 0 && $next_node === end($this->tree->stack)->nodeName;
732 if (($this->content_model === self::RCDATA || $this->content_model === self::CDATA) &&
733 (!$the_same || ($the_same && (!preg_match(
734 '/[\t\n\x0b\x0c >\/]/',
735 $this->
character($this->
char + 1 + strlen($next_node))
736 ) || $this->
EOF === $this->
char)))
755 'type' => self::CHARACTR,
760 $this->state =
'data';
769 if (preg_match(
'/^[A-Za-z]$/',
$char)) {
775 $this->token = array(
776 'name' => strtolower(
$char),
777 'type' => self::ENDTAG
780 $this->state =
'tagName';
782 } elseif (
$char ===
'>') {
785 $this->state =
'data';
787 } elseif ($this->
char === $this->
EOF) {
793 'type' => self::CHARACTR,
799 $this->state =
'data';
803 $this->state =
'bogusComment';
characters($char_class, $start)
◆ commentDashState()
HTML5::commentDashState |
( |
| ) |
|
|
private |
Definition at line 1269 of file PH5P.php.
References EOF.
1276 if (
$char ===
'-') {
1278 $this->state =
'commentEnd';
1281 } elseif ($this->
char === $this->
EOF) {
1286 $this->state =
'data';
1292 $this->token[
'data'] .=
'-' .
$char;
1293 $this->state =
'comment';
◆ commentEndState()
HTML5::commentEndState |
( |
| ) |
|
|
private |
Definition at line 1297 of file PH5P.php.
References EOF.
1303 if (
$char ===
'>') {
1305 $this->state =
'data';
1307 } elseif (
$char ===
'-') {
1308 $this->token[
'data'] .=
'-';
1310 } elseif ($this->
char === $this->
EOF) {
1313 $this->state =
'data';
1316 $this->token[
'data'] .=
'--' .
$char;
1317 $this->state =
'comment';
◆ commentState()
Definition at line 1242 of file PH5P.php.
References EOF.
1249 if (
$char ===
'-') {
1251 $this->state =
'commentDash';
1254 } elseif ($this->
char === $this->
EOF) {
1259 $this->state =
'data';
1265 $this->token[
'data'] .=
$char;
◆ dataState()
Definition at line 504 of file PH5P.php.
References data, and EOF.
510 if (
$char ===
'&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) {
515 $this->state =
'entityData';
517 } elseif (
$char ===
'-') {
524 if (($this->content_model === self::RCDATA || $this->content_model ===
525 self::CDATA) && $this->escape ===
false &&
526 $this->
char >= 3 && $this->
character($this->
char - 4, 4) ===
'<!--' 528 $this->escape =
true;
535 'type' => self::CHARACTR,
541 } elseif (
$char ===
'<' && ($this->content_model === self::PCDATA ||
542 (($this->content_model === self::RCDATA ||
543 $this->content_model === self::CDATA) && $this->escape ===
false))
553 $this->state =
'tagOpen';
556 } elseif (
$char ===
'>') {
562 if (($this->content_model === self::RCDATA ||
563 $this->content_model === self::CDATA) && $this->escape ===
true &&
564 $this->
character($this->
char, 3) ===
'-->' 566 $this->escape =
false;
573 'type' => self::CHARACTR,
578 } elseif ($this->
char === $this->
EOF) {
583 } elseif ($this->content_model === self::PLAINTEXT) {
589 'type' => self::CHARACTR,
590 'data' => substr($this->
data, $this->
char)
601 $len = strcspn($this->
data,
'<&', $this->
char);
602 $char = substr($this->
data, $this->
char, $len);
603 $this->
char += $len - 1;
607 'type' => self::CHARACTR,
612 $this->state =
'data';
◆ doctypeNameState()
HTML5::doctypeNameState |
( |
| ) |
|
|
private |
Definition at line 1388 of file PH5P.php.
References EOF.
1394 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
1395 $this->state =
'AfterDoctypeName';
1397 } elseif (
$char ===
'>') {
1399 $this->state =
'data';
1401 } elseif (preg_match(
'/^[a-z]$/',
$char)) {
1402 $this->token[
'name'] .= strtoupper(
$char);
1404 } elseif ($this->
char === $this->
EOF) {
1407 $this->state =
'data';
1410 $this->token[
'name'] .=
$char;
1413 $this->token[
'error'] = ($this->token[
'name'] ===
'HTML')
◆ doctypeState()
Definition at line 1321 of file PH5P.php.
1327 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
1328 $this->state =
'beforeDoctypeName';
1332 $this->state =
'beforeDoctypeName';
◆ emitToken()
HTML5::emitToken |
( |
|
$token | ) |
|
|
private |
Definition at line 1554 of file PH5P.php.
References PHPMailer\PHPMailer\$token.
1556 $emit = $this->tree->emitToken(
$token);
1558 if (is_int($emit)) {
1559 $this->content_model = $emit;
1561 } elseif (
$token[
'type'] === self::ENDTAG) {
1562 $this->content_model = self::PCDATA;
◆ entity()
Definition at line 1462 of file PH5P.php.
References $c, $id, and $start.
1472 switch ($this->
character($this->
char + 1)) {
1478 switch ($this->
character($this->
char + 1)) {
1490 $char_class =
'0-9A-Fa-f';
1499 $char_class =
'0-9';
1508 $cond = strlen($e_name) > 0;
1519 $e_name = $this->
characters(
'0-9A-Za-z;', $this->
char + 1);
1520 $len = strlen($e_name);
1522 for (
$c = 1;
$c <= $len;
$c++) {
1523 $id = substr($e_name, 0,
$c);
1526 if (in_array(
$id, $this->entities)) {
1527 if ($e_name[
$c - 1] !==
';') {
1528 if (
$c < $len && $e_name[
$c] ==
';') {
1537 $cond = isset($entity);
1551 return html_entity_decode(
'&' . rtrim($entity,
';') .
';', ENT_QUOTES,
'UTF-8');
if(!array_key_exists('StateId', $_REQUEST)) $id
characters($char_class, $start)
◆ entityDataState()
HTML5::entityDataState |
( |
| ) |
|
|
private |
Definition at line 616 of file PH5P.php.
619 $entity = $this->
entity();
623 $char = (!$entity) ?
'&' : $entity;
626 'type' => self::CHARACTR,
632 $this->state =
'data';
◆ entityInAttributeValueState()
HTML5::entityInAttributeValueState |
( |
| ) |
|
|
private |
Definition at line 1168 of file PH5P.php.
1171 $entity = $this->
entity();
1180 $last = count($this->token[
'attr']) - 1;
1181 $this->token[
'attr'][$last][
'value'] .=
$char;
◆ EOF()
◆ markupDeclarationOpenState()
HTML5::markupDeclarationOpenState |
( |
| ) |
|
|
private |
Definition at line 1213 of file PH5P.php.
1218 if ($this->
character($this->
char + 1, 2) ===
'--') {
1220 $this->state =
'comment';
1221 $this->token = array(
1223 'type' => self::COMMENT
1229 } elseif (strtolower($this->
character($this->
char + 1, 7)) ===
'doctype') {
1231 $this->state =
'doctype';
1238 $this->state =
'bogusComment';
◆ save()
Definition at line 476 of file PH5P.php.
478 return $this->tree->save();
◆ tagNameState()
Definition at line 808 of file PH5P.php.
References EOF.
814 if (preg_match(
'/^[\t\n\x0b\x0c ]$/',
$char)) {
821 $this->state =
'beforeAttributeName';
823 } elseif (
$char ===
'>') {
827 $this->state =
'data';
829 } elseif ($this->
char === $this->
EOF) {
836 $this->state =
'data';
838 } elseif (
$char ===
'/') {
842 $this->state =
'beforeAttributeName';
848 $this->token[
'name'] .= strtolower(
$char);
849 $this->state =
'tagName';
◆ tagOpenState()
Definition at line 635 of file PH5P.php.
637 switch ($this->content_model) {
645 if ($this->
character($this->
char + 1) ===
'/') {
647 $this->state =
'closeTagOpen';
652 'type' => self::CHARACTR,
657 $this->state =
'data';
670 $this->state =
'markupDeclarationOpen';
672 } elseif (
$char ===
'/') {
675 $this->state =
'closeTagOpen';
677 } elseif (preg_match(
'/^[A-Za-z]$/',
$char)) {
683 $this->token = array(
684 'name' => strtolower(
$char),
685 'type' => self::STARTTAG,
689 $this->state =
'tagName';
691 } elseif (
$char ===
'>') {
697 'type' => self::CHARACTR,
702 $this->state =
'data';
704 } elseif (
$char ===
'?') {
707 $this->state =
'bogusComment';
715 'type' => self::CHARACTR,
721 $this->state =
'data';
◆ $char
◆ $content_model
◆ $data
◆ $entities
◆ $EOF
◆ $escape
◆ $state
◆ $token
◆ $tree
◆ CDATA
◆ CHARACTR
const HTML5::CHARACTR = 4 |
Definition at line 458 of file PH5P.php.
Referenced by HTML5TreeConstructer\afterBody(), HTML5TreeConstructer\afterFrameset(), HTML5TreeConstructer\afterHead(), HTML5TreeConstructer\beforeHead(), HTML5TreeConstructer\inBody(), HTML5TreeConstructer\inColumnGroup(), HTML5TreeConstructer\inFrameset(), HTML5TreeConstructer\inHead(), HTML5TreeConstructer\initPhase(), HTML5TreeConstructer\inSelect(), HTML5TreeConstructer\inTable(), HTML5TreeConstructer\rootElementPhase(), and HTML5TreeConstructer\trailingEndPhase().
◆ COMMENT
Definition at line 457 of file PH5P.php.
Referenced by HTML5TreeConstructer\afterBody(), HTML5TreeConstructer\afterFrameset(), HTML5TreeConstructer\afterHead(), HTML5TreeConstructer\beforeHead(), HTML5TreeConstructer\inBody(), HTML5TreeConstructer\inColumnGroup(), HTML5TreeConstructer\inFrameset(), HTML5TreeConstructer\inHead(), HTML5TreeConstructer\initPhase(), HTML5TreeConstructer\inSelect(), HTML5TreeConstructer\inTable(), HTML5TreeConstructer\rootElementPhase(), and HTML5TreeConstructer\trailingEndPhase().
◆ DOCTYPE
◆ ENDTAG
Definition at line 456 of file PH5P.php.
Referenced by HTML5TreeConstructer\afterBody(), HTML5TreeConstructer\afterFrameset(), HTML5TreeConstructer\beforeHead(), HTML5TreeConstructer\closeCell(), HTML5TreeConstructer\inBody(), HTML5TreeConstructer\inCaption(), HTML5TreeConstructer\inCell(), HTML5TreeConstructer\inColumnGroup(), HTML5TreeConstructer\inFrameset(), HTML5TreeConstructer\inHead(), HTML5TreeConstructer\initPhase(), HTML5TreeConstructer\inRow(), HTML5TreeConstructer\inSelect(), HTML5TreeConstructer\inTable(), HTML5TreeConstructer\inTableBody(), HTML5TreeConstructer\rootElementPhase(), and HTML5TreeConstructer\trailingEndPhase().
◆ EOF
◆ PCDATA
◆ PLAINTEXT
const HTML5::PLAINTEXT = 3 |
◆ RCDATA
◆ STARTTAG
const HTML5::STARTTAG = 1 |
Definition at line 455 of file PH5P.php.
Referenced by HTML5TreeConstructer\afterFrameset(), HTML5TreeConstructer\afterHead(), HTML5TreeConstructer\beforeHead(), HTML5TreeConstructer\inBody(), HTML5TreeConstructer\inCaption(), HTML5TreeConstructer\inCell(), HTML5TreeConstructer\inColumnGroup(), HTML5TreeConstructer\inFrameset(), HTML5TreeConstructer\inHead(), HTML5TreeConstructer\initPhase(), HTML5TreeConstructer\inRow(), HTML5TreeConstructer\inSelect(), HTML5TreeConstructer\inTable(), HTML5TreeConstructer\inTableBody(), HTML5TreeConstructer\mainPhase(), HTML5TreeConstructer\rootElementPhase(), and HTML5TreeConstructer\trailingEndPhase().
The documentation for this class was generated from the following file:
- libs/composer/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php