|
@@ -167,7 +167,7 @@ discard block |
|
|
block discarded – undo |
|
167
|
167
|
return \call_user_func_array([$this, self::$functionAliases[$name]], $arguments); |
|
168
|
168
|
} |
|
169
|
169
|
|
|
170
|
|
- throw new \BadMethodCallException('Method does not exist: ' . $name); |
|
|
170
|
+ throw new \BadMethodCallException('Method does not exist: '.$name); |
|
171
|
171
|
} |
|
172
|
172
|
|
|
173
|
173
|
/** |
|
@@ -318,14 +318,14 @@ discard block |
|
|
block discarded – undo |
|
318
|
318
|
self::$domReplaceHelper['orig'] |
|
319
|
319
|
); |
|
320
|
320
|
|
|
321
|
|
- $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<' . self::$domHtmlWrapperHelper . '>'; |
|
322
|
|
- $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</' . self::$domHtmlWrapperHelper . '>'; |
|
|
321
|
+ $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<'.self::$domHtmlWrapperHelper.'>'; |
|
|
322
|
+ $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</'.self::$domHtmlWrapperHelper.'>'; |
|
323
|
323
|
|
|
324
|
324
|
$DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__start'] = ''; |
|
325
|
325
|
$DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__end'] = ''; |
|
326
|
326
|
|
|
327
|
|
- $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<' . self::$domHtmlSpecialScriptHelper; |
|
328
|
|
- $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
|
327
|
+ $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<'.self::$domHtmlSpecialScriptHelper; |
|
|
328
|
+ $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
329
|
329
|
|
|
330
|
330
|
$DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__start'] = '<script'; |
|
331
|
331
|
$DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__end'] = '</script>'; |
|
@@ -419,7 +419,7 @@ discard block |
|
|
block discarded – undo |
|
419
|
419
|
|| |
|
420
|
420
|
$this->keepBrokenHtml |
|
421
|
421
|
) { |
|
422
|
|
- $html = '<' . self::$domHtmlWrapperHelper . '>' . $html . '</' . self::$domHtmlWrapperHelper . '>'; |
|
|
422
|
+ $html = '<'.self::$domHtmlWrapperHelper.'>'.$html.'</'.self::$domHtmlWrapperHelper.'>'; |
|
423
|
423
|
} |
|
424
|
424
|
|
|
425
|
425
|
$html = self::replaceToPreserveHtmlEntities($html); |
|
@@ -433,7 +433,7 @@ discard block |
|
|
block discarded – undo |
|
433
|
433
|
$xmlHackUsed = false; |
|
434
|
434
|
if (\stripos('<?xml', $html) !== 0) { |
|
435
|
435
|
$xmlHackUsed = true; |
|
436
|
|
- $html = '<?xml encoding="' . $this->getEncoding() . '" ?>' . $html; |
|
|
436
|
+ $html = '<?xml encoding="'.$this->getEncoding().'" ?>'.$html; |
|
437
|
437
|
} |
|
438
|
438
|
|
|
439
|
439
|
$this->document->loadHTML($html, $optionsXml); |
|
@@ -472,7 +472,7 @@ discard block |
|
|
block discarded – undo |
|
472
|
472
|
// regEx for e.g.: [<script id="elements-image-2">...<script>] |
|
473
|
473
|
$regExSpecialScript = '/<(script)(?<attr>[^>]*)>(?<content>.*)<\/\1>/isU'; |
|
474
|
474
|
$html = \preg_replace_callback($regExSpecialScript, function($scripts) { |
|
475
|
|
- return '<script' . $scripts['attr'] . '>' . \str_replace('</', '<\/',$scripts['content']) . '</script>'; |
|
|
475
|
+ return '<script'.$scripts['attr'].'>'.\str_replace('</', '<\/', $scripts['content']).'</script>'; |
|
476
|
476
|
},$html); |
|
477
|
477
|
} |
|
478
|
478
|
|
|
@@ -489,8 +489,8 @@ discard block |
|
|
block discarded – undo |
|
489
|
489
|
if (isset($specialScripts[0])) { |
|
490
|
490
|
foreach ($specialScripts[0] as $specialScript) { |
|
491
|
491
|
|
|
492
|
|
- $specialNonScript = '<' . self::$domHtmlSpecialScriptHelper . \substr($specialScript, \strlen('<script')); |
|
493
|
|
- $specialNonScript = \substr($specialNonScript, 0, -\strlen('</script>')) . '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
|
492
|
+ $specialNonScript = '<'.self::$domHtmlSpecialScriptHelper.\substr($specialScript, \strlen('<script')); |
|
|
493
|
+ $specialNonScript = \substr($specialNonScript, 0, -\strlen('</script>')).'</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
494
|
494
|
// remove the html5 fallback |
|
495
|
495
|
$specialNonScript = \str_replace('<\/', '</', $specialNonScript); |
|
496
|
496
|
|
|
@@ -511,11 +511,11 @@ discard block |
|
|
block discarded – undo |
|
511
|
511
|
|
|
512
|
512
|
$html = (string) \preg_replace_callback( |
|
513
|
513
|
'/(?<start>.*)<(?<element_start>[a-z]+)(?<element_start_addon> [^>]*)?>(?<value>.*?)<\/(?<element_end>\2)>(?<end>.*)/sui', |
|
514
|
|
- function ($matches) { |
|
515
|
|
- return $matches['start'] . |
|
516
|
|
- '°lt_simple_html_dom__voku_°' . $matches['element_start'] . $matches['element_start_addon'] . '°gt_simple_html_dom__voku_°' . |
|
517
|
|
- $matches['value'] . |
|
518
|
|
- '°lt/_simple_html_dom__voku_°' . $matches['element_end'] . '°gt_simple_html_dom__voku_°' . |
|
|
514
|
+ function($matches) { |
|
|
515
|
+ return $matches['start']. |
|
|
516
|
+ '°lt_simple_html_dom__voku_°'.$matches['element_start'].$matches['element_start_addon'].'°gt_simple_html_dom__voku_°'. |
|
|
517
|
+ $matches['value']. |
|
|
518
|
+ '°lt/_simple_html_dom__voku_°'.$matches['element_end'].'°gt_simple_html_dom__voku_°'. |
|
519
|
519
|
$matches['end']; |
|
520
|
520
|
}, |
|
521
|
521
|
$html |
|
@@ -527,7 +527,7 @@ discard block |
|
|
block discarded – undo |
|
527
|
527
|
|
|
528
|
528
|
$html = (string) \preg_replace_callback( |
|
529
|
529
|
'/(?<start>[^<]*)?(?<broken>(?:(?:<\/\w+(?:\s+\w+=\\"[^\"]+\\")*+)(?:[^<]+)>)+)(?<end>.*)/u', |
|
530
|
|
- function ($matches) { |
|
|
530
|
+ function($matches) { |
|
531
|
531
|
$matches['broken'] = \str_replace( |
|
532
|
532
|
['°lt/_simple_html_dom__voku_°', '°lt_simple_html_dom__voku_°', '°gt_simple_html_dom__voku_°'], |
|
533
|
533
|
['</', '<', '>'], |
|
@@ -535,9 +535,9 @@ discard block |
|
|
block discarded – undo |
|
535
|
535
|
); |
|
536
|
536
|
|
|
537
|
537
|
self::$domBrokenReplaceHelper['orig'][] = $matches['broken']; |
|
538
|
|
- self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '____simple_html_dom__voku__broken_html____' . \crc32($matches['broken']); |
|
|
538
|
+ self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '____simple_html_dom__voku__broken_html____'.\crc32($matches['broken']); |
|
539
|
539
|
|
|
540
|
|
- return $matches['start'] . $matchesHash . $matches['end']; |
|
|
540
|
+ return $matches['start'].$matchesHash.$matches['end']; |
|
541
|
541
|
}, |
|
542
|
542
|
$html |
|
543
|
543
|
); |