projects
/
GitHub
/
WoltLab
/
WCF.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a15998b
)
Use `XPath::query()` for its superior performance
author
Alexander Ebert
<ebert@woltlab.com>
Mon, 12 Apr 2021 20:14:20 +0000
(22:14 +0200)
committer
Alexander Ebert
<ebert@woltlab.com>
Mon, 12 Apr 2021 20:14:20 +0000
(22:14 +0200)
wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php
patch
|
blob
|
blame
|
history
wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php
patch
|
blob
|
blame
|
history
diff --git
a/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php
b/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php
index 6e4cf7222996dc5ad426b88eb195c1daac750032..e07b677798f1d497d280807f3a7dc737123fc2de 100644
(file)
--- a/
wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php
+++ b/
wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php
@@
-283,7
+283,7
@@
abstract class AbstractHtmlNodeProcessor implements IHtmlNodeProcessor {
}
$elements = [];
- foreach ($this->get
Document()->getElementsByTagName($tagName
) as $element) {
+ foreach ($this->get
XPath()->query("//{$tagName}"
) as $element) {
$elements[] = $element;
}
diff --git
a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php
b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php
index d2e54f1740404b02f46139eae164b6d614bf39e4..9ac423ce5195d85a67e47f78b4185bfd5fb6d641 100644
(file)
--- a/
wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php
+++ b/
wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php
@@
-98,7
+98,6
@@
class HtmlOutputNodeProcessor extends AbstractHtmlNodeProcessor {
if ($this->outputType !== 'text/html') {
// convert `<p>...</p>` into `...<br><br>`
- $paragraphs = [];
foreach ($this->getXPath()->query('//p') as $paragraph) {
$isLastNode = true;
$sibling = $paragraph;