Skip to content

Commit 577d995

Browse files
Merge pull request #2442 from nextcloud/dependabot/composer/symfony/dom-crawler-7.4.12
build(deps): bump symfony/dom-crawler from 6.4.32 to 7.4.12
2 parents ca56861 + 91c9c90 commit 577d995

21 files changed

Lines changed: 242 additions & 263 deletions

composer.lock

Lines changed: 15 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer/installed.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,17 +2048,17 @@
20482048
},
20492049
{
20502050
"name": "masterminds/html5",
2051-
"version": "2.9.0",
2052-
"version_normalized": "2.9.0.0",
2051+
"version": "2.10.0",
2052+
"version_normalized": "2.10.0.0",
20532053
"source": {
20542054
"type": "git",
20552055
"url": "https://github.com/Masterminds/html5-php.git",
2056-
"reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6"
2056+
"reference": "fcf91eb64359852f00d921887b219479b4f21251"
20572057
},
20582058
"dist": {
20592059
"type": "zip",
2060-
"url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f5ac2c0b0a2eefca70b2ce32a5809992227e75a6",
2061-
"reference": "f5ac2c0b0a2eefca70b2ce32a5809992227e75a6",
2060+
"url": "https://api.github.com/repos/Masterminds/html5-php/zipball/fcf91eb64359852f00d921887b219479b4f21251",
2061+
"reference": "fcf91eb64359852f00d921887b219479b4f21251",
20622062
"shasum": ""
20632063
},
20642064
"require": {
@@ -2068,7 +2068,7 @@
20682068
"require-dev": {
20692069
"phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8 || ^9"
20702070
},
2071-
"time": "2024-03-31T07:05:07+00:00",
2071+
"time": "2025-07-25T09:04:22+00:00",
20722072
"type": "library",
20732073
"extra": {
20742074
"branch-alias": {
@@ -2112,7 +2112,7 @@
21122112
],
21132113
"support": {
21142114
"issues": "https://github.com/Masterminds/html5-php/issues",
2115-
"source": "https://github.com/Masterminds/html5-php/tree/2.9.0"
2115+
"source": "https://github.com/Masterminds/html5-php/tree/2.10.0"
21162116
},
21172117
"install-path": "../masterminds/html5"
21182118
},
@@ -4765,29 +4765,30 @@
47654765
},
47664766
{
47674767
"name": "symfony/dom-crawler",
4768-
"version": "v6.4.32",
4769-
"version_normalized": "6.4.32.0",
4768+
"version": "v7.4.12",
4769+
"version_normalized": "7.4.12.0",
47704770
"source": {
47714771
"type": "git",
47724772
"url": "https://github.com/symfony/dom-crawler.git",
4773-
"reference": "f57f1cbd6b13b54e7f8a25cae1ee55cbe892b1f3"
4773+
"reference": "b59b59122690976550fd142c23fab62c84738db6"
47744774
},
47754775
"dist": {
47764776
"type": "zip",
4777-
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/f57f1cbd6b13b54e7f8a25cae1ee55cbe892b1f3",
4778-
"reference": "f57f1cbd6b13b54e7f8a25cae1ee55cbe892b1f3",
4777+
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b59b59122690976550fd142c23fab62c84738db6",
4778+
"reference": "b59b59122690976550fd142c23fab62c84738db6",
47794779
"shasum": ""
47804780
},
47814781
"require": {
47824782
"masterminds/html5": "^2.6",
4783-
"php": ">=8.1",
4783+
"php": ">=8.2",
4784+
"symfony/deprecation-contracts": "^2.5|^3",
47844785
"symfony/polyfill-ctype": "~1.8",
47854786
"symfony/polyfill-mbstring": "~1.0"
47864787
},
47874788
"require-dev": {
4788-
"symfony/css-selector": "^5.4|^6.0|^7.0"
4789+
"symfony/css-selector": "^6.4|^7.0|^8.0"
47894790
},
4790-
"time": "2026-01-04T12:18:37+00:00",
4791+
"time": "2026-05-20T07:20:23+00:00",
47914792
"type": "library",
47924793
"installation-source": "dist",
47934794
"autoload": {
@@ -4815,7 +4816,7 @@
48154816
"description": "Eases DOM navigation for HTML and XML documents",
48164817
"homepage": "https://symfony.com",
48174818
"support": {
4818-
"source": "https://github.com/symfony/dom-crawler/tree/v6.4.32"
4819+
"source": "https://github.com/symfony/dom-crawler/tree/v7.4.12"
48194820
},
48204821
"funding": [
48214822
{

composer/installed.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@
263263
'dev_requirement' => false,
264264
),
265265
'masterminds/html5' => array(
266-
'pretty_version' => '2.9.0',
267-
'version' => '2.9.0.0',
268-
'reference' => 'f5ac2c0b0a2eefca70b2ce32a5809992227e75a6',
266+
'pretty_version' => '2.10.0',
267+
'version' => '2.10.0.0',
268+
'reference' => 'fcf91eb64359852f00d921887b219479b4f21251',
269269
'type' => 'library',
270270
'install_path' => __DIR__ . '/../masterminds/html5',
271271
'aliases' => array(),
@@ -698,9 +698,9 @@
698698
'dev_requirement' => false,
699699
),
700700
'symfony/dom-crawler' => array(
701-
'pretty_version' => 'v6.4.32',
702-
'version' => '6.4.32.0',
703-
'reference' => 'f57f1cbd6b13b54e7f8a25cae1ee55cbe892b1f3',
701+
'pretty_version' => 'v7.4.12',
702+
'version' => '7.4.12.0',
703+
'reference' => 'b59b59122690976550fd142c23fab62c84738db6',
704704
'type' => 'library',
705705
'install_path' => __DIR__ . '/../symfony/dom-crawler',
706706
'aliases' => array(),

masterminds/html5/src/HTML5.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ public function hasErrors()
146146
* Parse an input string.
147147
*
148148
* @param string $input
149-
* @param array $options
150149
*
151150
* @return \DOMDocument
152151
*/

masterminds/html5/src/HTML5/Parser/CharacterReference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function lookupDecimal($int)
4848
}
4949

5050
/**
51-
* Given a hexidecimal number, return the UTF-8 character.
51+
* Given a hexadecimal number, return the UTF-8 character.
5252
*
5353
* @param $hexdec
5454
*

masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,6 @@ public function fragment()
231231
*
232232
* This is used for handling Processor Instructions as they are
233233
* inserted. If omitted, PI's are inserted directly into the DOM tree.
234-
*
235-
* @param InstructionProcessor $proc
236234
*/
237235
public function setInstructionProcessor(InstructionProcessor $proc)
238236
{

masterminds/html5/src/HTML5/Parser/Tokenizer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ protected function attribute(&$attributes)
507507
$this->scanner->whitespace();
508508

509509
$val = $this->attributeValue();
510-
if ($isValidAttribute) {
510+
if ($isValidAttribute && !array_key_exists($name, $attributes)) {
511511
$attributes[$name] = $val;
512512
}
513513

@@ -729,6 +729,7 @@ protected function isCommentEnd()
729729
// Test for '!>'
730730
if ('!' == $this->scanner->current() && '>' == $this->scanner->peek()) {
731731
$this->scanner->consume(); // Consume the last '>'
732+
732733
return true;
733734
}
734735
// Unread '-' and one of '!' or '>';
@@ -1127,7 +1128,7 @@ protected function decodeCharacterReference($inAttribute = false)
11271128
return '&';
11281129
}
11291130

1130-
// Hexidecimal encoding.
1131+
// Hexadecimal encoding.
11311132
// X[0-9a-fA-F]+;
11321133
// x[0-9a-fA-F]+;
11331134
if ('x' === $tok || 'X' === $tok) {

masterminds/html5/src/HTML5/Parser/TreeBuildingRules.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public function evaluate($new, $current)
8080
case 'thead':
8181
case 'tfoot':
8282
case 'table': // Spec isn't explicit about this, but it's necessary.
83-
8483
return $this->closeIfCurrentMatches($new, $current, array(
8584
'thead',
8685
'tfoot',

masterminds/html5/src/HTML5/Serializer/OutputRules.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ protected function doctype()
206206
$this->nl();
207207
}
208208

209+
/**
210+
* @param \DOMElement $ele
211+
*/
209212
public function element($ele)
210213
{
211214
$name = $ele->tagName;
@@ -227,6 +230,9 @@ public function element($ele)
227230
}
228231

229232
$this->openTag($ele);
233+
// The tag is already self-closed (`<svg />` or `<math />`) in `openTag` if there are no child nodes.
234+
$handledAsVoidTag = $this->outputMode !== static::IM_IN_HTML && !$ele->hasChildNodes();
235+
230236
if (Elements::isA($name, Elements::TEXT_RAW)) {
231237
foreach ($ele->childNodes as $child) {
232238
if ($child instanceof \DOMCharacterData) {
@@ -248,7 +254,7 @@ public function element($ele)
248254
}
249255

250256
// If not unary, add a closing tag.
251-
if (!Elements::isA($name, Elements::VOID_TAG)) {
257+
if (!$handledAsVoidTag && !Elements::isA($name, Elements::VOID_TAG)) {
252258
$this->closeTag($ele);
253259
}
254260
}

symfony/dom-crawler/AbstractUriElement.php

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,8 @@
1818
*/
1919
abstract class AbstractUriElement
2020
{
21-
/**
22-
* @var \DOMElement
23-
*/
24-
protected $node;
25-
26-
/**
27-
* @var string|null The method to use for the element
28-
*/
29-
protected $method;
30-
31-
/**
32-
* @var string The URI of the page where the element is embedded (or the base href)
33-
*/
34-
protected $currentUri;
21+
protected \DOMElement $node;
22+
protected ?string $method;
3523

3624
/**
3725
* @param \DOMElement $node A \DOMElement instance
@@ -40,14 +28,16 @@ abstract class AbstractUriElement
4028
*
4129
* @throws \InvalidArgumentException if the node is not a link
4230
*/
43-
public function __construct(\DOMElement $node, ?string $currentUri = null, ?string $method = 'GET')
44-
{
31+
public function __construct(
32+
\DOMElement $node,
33+
protected ?string $currentUri = null,
34+
?string $method = 'GET',
35+
) {
4536
$this->setNode($node);
4637
$this->method = $method ? strtoupper($method) : null;
47-
$this->currentUri = $currentUri;
4838

4939
$elementUriIsRelative = !parse_url(trim($this->getRawUri()), \PHP_URL_SCHEME);
50-
$baseUriIsAbsolute = null !== $this->currentUri && \in_array(strtolower(substr($this->currentUri, 0, 4)), ['http', 'file']);
40+
$baseUriIsAbsolute = null !== $this->currentUri && \in_array(strtolower(substr($this->currentUri, 0, 4)), ['http', 'file'], true);
5141
if ($elementUriIsRelative && !$baseUriIsAbsolute) {
5242
throw new \InvalidArgumentException(\sprintf('The URL of the element is relative, so you must define its base URI passing an absolute URL to the constructor of the "%s" class ("%s" was passed).', __CLASS__, $this->currentUri));
5343
}
@@ -115,9 +105,7 @@ protected function canonicalizePath(string $path): string
115105
*
116106
* @param \DOMElement $node A \DOMElement instance
117107
*
118-
* @return void
119-
*
120108
* @throws \LogicException If given node is not an anchor
121109
*/
122-
abstract protected function setNode(\DOMElement $node);
110+
abstract protected function setNode(\DOMElement $node): void;
123111
}

0 commit comments

Comments
 (0)