|
@@ -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
|
/** |
|
@@ -324,14 +324,14 @@ discard block |
|
|
block discarded – undo |
|
324
|
324
|
self::$domReplaceHelper['orig'] |
|
325
|
325
|
); |
|
326
|
326
|
|
|
327
|
|
- $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<' . self::$domHtmlWrapperHelper . '>'; |
|
328
|
|
- $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</' . self::$domHtmlWrapperHelper . '>'; |
|
|
327
|
+ $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<'.self::$domHtmlWrapperHelper.'>'; |
|
|
328
|
+ $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</'.self::$domHtmlWrapperHelper.'>'; |
|
329
|
329
|
|
|
330
|
330
|
$DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__start'] = ''; |
|
331
|
331
|
$DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__end'] = ''; |
|
332
|
332
|
|
|
333
|
|
- $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<' . self::$domHtmlSpecialScriptHelper; |
|
334
|
|
- $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
|
333
|
+ $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<'.self::$domHtmlSpecialScriptHelper; |
|
|
334
|
+ $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
335
|
335
|
|
|
336
|
336
|
$DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__start'] = '<script'; |
|
337
|
337
|
$DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__end'] = '</script>'; |
|
@@ -421,7 +421,7 @@ discard block |
|
|
block discarded – undo |
|
421
|
421
|
|| |
|
422
|
422
|
$this->keepBrokenHtml === true |
|
423
|
423
|
) { |
|
424
|
|
- $html = '<' . self::$domHtmlWrapperHelper . '>' . $html . '</' . self::$domHtmlWrapperHelper . '>'; |
|
|
424
|
+ $html = '<'.self::$domHtmlWrapperHelper.'>'.$html.'</'.self::$domHtmlWrapperHelper.'>'; |
|
425
|
425
|
} |
|
426
|
426
|
|
|
427
|
427
|
$html = self::replaceToPreserveHtmlEntities($html); |
|
@@ -435,7 +435,7 @@ discard block |
|
|
block discarded – undo |
|
435
|
435
|
$xmlHackUsed = false; |
|
436
|
436
|
if (\stripos('<?xml', $html) !== 0) { |
|
437
|
437
|
$xmlHackUsed = true; |
|
438
|
|
- $html = '<?xml encoding="' . $this->getEncoding() . '" ?>' . $html; |
|
|
438
|
+ $html = '<?xml encoding="'.$this->getEncoding().'" ?>'.$html; |
|
439
|
439
|
} |
|
440
|
440
|
|
|
441
|
441
|
$this->document->loadHTML($html, $optionsXml); |
|
@@ -476,8 +476,8 @@ discard block |
|
|
block discarded – undo |
|
476
|
476
|
|
|
477
|
477
|
if (isset($specialScripts[0])) { |
|
478
|
478
|
foreach ($specialScripts[0] as $specialScript) { |
|
479
|
|
- $specialNonScript = '<' . self::$domHtmlSpecialScriptHelper . substr($specialScript, strlen('<script')); |
|
480
|
|
- $specialNonScript = substr($specialNonScript, 0, -strlen('</script>')) . '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
|
479
|
+ $specialNonScript = '<'.self::$domHtmlSpecialScriptHelper.substr($specialScript, strlen('<script')); |
|
|
480
|
+ $specialNonScript = substr($specialNonScript, 0, -strlen('</script>')).'</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
481
|
481
|
|
|
482
|
482
|
$html = \str_replace($specialScript, $specialNonScript, $html); |
|
483
|
483
|
} |
|
@@ -496,11 +496,11 @@ discard block |
|
|
block discarded – undo |
|
496
|
496
|
|
|
497
|
497
|
$html = (string) \preg_replace_callback( |
|
498
|
498
|
'/(?<start>.*)<(?<element_start>[a-z]+)(?<element_start_addon> [^>]*)?>(?<value>.*?)<\/(?<element_end>\2)>(?<end>.*)/sui', |
|
499
|
|
- function ($matches) { |
|
500
|
|
- return $matches['start'] . |
|
501
|
|
- '°lt_simple_html_dom__voku_°' . $matches['element_start'] . $matches['element_start_addon'] . '°gt_simple_html_dom__voku_°' . |
|
502
|
|
- $matches['value'] . |
|
503
|
|
- '°lt/_simple_html_dom__voku_°' . $matches['element_end'] . '°gt_simple_html_dom__voku_°' . |
|
|
499
|
+ function($matches) { |
|
|
500
|
+ return $matches['start']. |
|
|
501
|
+ '°lt_simple_html_dom__voku_°'.$matches['element_start'].$matches['element_start_addon'].'°gt_simple_html_dom__voku_°'. |
|
|
502
|
+ $matches['value']. |
|
|
503
|
+ '°lt/_simple_html_dom__voku_°'.$matches['element_end'].'°gt_simple_html_dom__voku_°'. |
|
504
|
504
|
$matches['end']; |
|
505
|
505
|
}, |
|
506
|
506
|
$html |
|
@@ -512,7 +512,7 @@ discard block |
|
|
block discarded – undo |
|
512
|
512
|
|
|
513
|
513
|
$html = (string) \preg_replace_callback( |
|
514
|
514
|
'/(?<start>[^<]*)?(?<broken>(?:(?:<\/\w+(?:\s+\w+=\\"[^\"]+\\")*+)(?:[^<]+)>)+)(?<end>.*)/u', |
|
515
|
|
- function ($matches) { |
|
|
515
|
+ function($matches) { |
|
516
|
516
|
$matches['broken'] = \str_replace( |
|
517
|
517
|
['°lt/_simple_html_dom__voku_°', '°lt_simple_html_dom__voku_°', '°gt_simple_html_dom__voku_°'], |
|
518
|
518
|
['</', '<', '>'], |
|
@@ -520,9 +520,9 @@ discard block |
|
|
block discarded – undo |
|
520
|
520
|
); |
|
521
|
521
|
|
|
522
|
522
|
self::$domBrokenReplaceHelper['orig'][] = $matches['broken']; |
|
523
|
|
- self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '____simple_html_dom__voku__broken_html____' . \crc32($matches['broken']); |
|
|
523
|
+ self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '____simple_html_dom__voku__broken_html____'.\crc32($matches['broken']); |
|
524
|
524
|
|
|
525
|
|
- return $matches['start'] . $matchesHash . $matches['end']; |
|
|
525
|
+ return $matches['start'].$matchesHash.$matches['end']; |
|
526
|
526
|
}, |
|
527
|
527
|
$html |
|
528
|
528
|
); |