File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1112,6 +1112,11 @@ public static function normalize( string $html ): ?string {
11121112 */
11131113 public function serialize (): ?string {
11141114 if ( WP_HTML_Tag_Processor::STATE_READY !== $ this ->parser_state ) {
1115+ wp_trigger_error (
1116+ __METHOD__ ,
1117+ "An HTML Processor which has already started processing cannot serialize it's contents. Serialize immediately after creating the instance. " ,
1118+ E_USER_ERROR
1119+ );
11151120 return null ;
11161121 }
11171122
@@ -1215,6 +1220,11 @@ public function serialize(): ?string {
12151220 }
12161221
12171222 if ( null !== $ this ->get_last_error () ) {
1223+ wp_trigger_error (
1224+ __METHOD__ ,
1225+ "Cannot serialize HTML Processor with parsing error: {$ this ->get_last_error ()}. " ,
1226+ E_USER_ERROR
1227+ );
12181228 return null ;
12191229 }
12201230
You can’t perform that action at this time.
0 commit comments