Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 89647a5

Browse filesBrowse files
Minor fixes around parse_url() checks
1 parent 7111520 commit 89647a5
Copy full SHA for 89647a5

File tree

Expand file treeCollapse file tree

2 files changed

+2
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-3
lines changed

‎AbstractUriElement.php

Copy file name to clipboardExpand all lines: AbstractUriElement.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(\DOMElement $node, ?string $currentUri = null, ?stri
4646
$this->method = $method ? strtoupper($method) : null;
4747
$this->currentUri = $currentUri;
4848

49-
$elementUriIsRelative = null === parse_url(trim($this->getRawUri()), \PHP_URL_SCHEME);
49+
$elementUriIsRelative = !parse_url(trim($this->getRawUri()), \PHP_URL_SCHEME);
5050
$baseUriIsAbsolute = null !== $this->currentUri && \in_array(strtolower(substr($this->currentUri, 0, 4)), ['http', 'file']);
5151
if ($elementUriIsRelative && !$baseUriIsAbsolute) {
5252
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));

‎Form.php

Copy file name to clipboardExpand all lines: Form.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,8 @@ public function getUri()
203203
$uri = parent::getUri();
204204

205205
if (!\in_array($this->getMethod(), ['POST', 'PUT', 'DELETE', 'PATCH'])) {
206-
$query = parse_url($uri, \PHP_URL_QUERY);
207206
$currentParameters = [];
208-
if ($query) {
207+
if ($query = parse_url($uri, \PHP_URL_QUERY)) {
209208
parse_str($query, $currentParameters);
210209
}
211210

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.