summaryrefslogtreecommitdiffstats
path: root/utility
diff options
context:
space:
mode:
Diffstat (limited to 'utility')
-rw-r--r--utility/articleenhancer/xpatharticleenhancer.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/utility/articleenhancer/xpatharticleenhancer.php b/utility/articleenhancer/xpatharticleenhancer.php
index 114a612f0..c9cff238a 100644
--- a/utility/articleenhancer/xpatharticleenhancer.php
+++ b/utility/articleenhancer/xpatharticleenhancer.php
@@ -119,10 +119,14 @@ class XPathArticleEnhancer implements ArticleEnhancer {
foreach ($substitution as $attribute) {
$xpath = new \DOMXpath($dom);
- $xpathResult = $xpath->query("//*[@".$attribute." and not(contains(@".$attribute.", '://')) and not(starts-with(@".$attribute.", 'mailto:'))]");
+ $xpathResult = $xpath->query(
+ "//*[@" . $attribute . " " .
+ "and not(contains(@" . $attribute . ", '://')) " .
+ "and not(starts-with(@" . $attribute . ", 'mailto:'))]");
foreach ($xpathResult as $linkNode) {
$urlElement = $linkNode->attributes->getNamedItem($attribute);
- $urlElement->nodeValue = $this->relativeToAbsoluteUrl( $urlElement->nodeValue, $absoluteUrl );
+ $abs = $this->relativeToAbsoluteUrl( $urlElement->nodeValue, $absoluteUrl );
+ $urlElement->nodeValue = htmlspecialchars($abs);
}
}