| @@ 285-310 (lines=26) @@ | ||
| 282 | ||
| 283 | for ($i = -1, $ci = count($t); ++$i < $ci;) { |
|
| 284 | // allowed $ok in parent $p |
|
| 285 | if ($ql = count($q)) { |
|
| 286 | $p = array_pop($q); |
|
| 287 | $q[] = $p; |
|
| 288 | if (isset($cS[$p])) { |
|
| 289 | $ok = $cS[$p]; |
|
| 290 | } elseif (isset($cI[$p])) { |
|
| 291 | $ok = $eI; |
|
| 292 | $cI['del'] = 1; |
|
| 293 | $cI['ins'] = 1; |
|
| 294 | } elseif (isset($cF[$p])) { |
|
| 295 | $ok = $eF; |
|
| 296 | unset($cI['del'], $cI['ins']); |
|
| 297 | } elseif (isset($cB[$p])) { |
|
| 298 | $ok = $eB; |
|
| 299 | unset($cI['del'], $cI['ins']); |
|
| 300 | } |
|
| 301 | if (isset($cO[$p])) { |
|
| 302 | $ok = $ok + $cO[$p]; |
|
| 303 | } |
|
| 304 | if (isset($cN[$p])) { |
|
| 305 | $ok = array_diff_assoc($ok, $cN[$p]); |
|
| 306 | } |
|
| 307 | } else { |
|
| 308 | $ok = $inOk; |
|
| 309 | unset($cI['del'], $cI['ins']); |
|
| 310 | } |
|
| 311 | // bad tags, & ele content |
|
| 312 | if (isset($e) && ($do == 1 or (isset($ok['#pcdata']) && ($do == 3 or $do == 5)))) { |
|
| 313 | echo '<', $s, $e, $a, '>'; |
|
| @@ 446-471 (lines=26) @@ | ||
| 443 | } |
|
| 444 | ||
| 445 | // end |
|
| 446 | if ($ql = count($q)) { |
|
| 447 | $p = array_pop($q); |
|
| 448 | $q[] = $p; |
|
| 449 | if (isset($cS[$p])) { |
|
| 450 | $ok = $cS[$p]; |
|
| 451 | } elseif (isset($cI[$p])) { |
|
| 452 | $ok = $eI; |
|
| 453 | $cI['del'] = 1; |
|
| 454 | $cI['ins'] = 1; |
|
| 455 | } elseif (isset($cF[$p])) { |
|
| 456 | $ok = $eF; |
|
| 457 | unset($cI['del'], $cI['ins']); |
|
| 458 | } elseif (isset($cB[$p])) { |
|
| 459 | $ok = $eB; |
|
| 460 | unset($cI['del'], $cI['ins']); |
|
| 461 | } |
|
| 462 | if (isset($cO[$p])) { |
|
| 463 | $ok = $ok + $cO[$p]; |
|
| 464 | } |
|
| 465 | if (isset($cN[$p])) { |
|
| 466 | $ok = array_diff_assoc($ok, $cN[$p]); |
|
| 467 | } |
|
| 468 | } else { |
|
| 469 | $ok = $inOk; |
|
| 470 | unset($cI['del'], $cI['ins']); |
|
| 471 | } |
|
| 472 | if (isset($e) && ($do == 1 or (isset($ok['#pcdata']) && ($do == 3 or $do == 5)))) { |
|
| 473 | echo '<', $s, $e, $a, '>'; |
|
| 474 | } |
|