mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 09:43:13 +08:00
Ensure request is not performed if both title resolution and URL validation are disabled
This commit is contained in:
@@ -47,9 +47,12 @@ class UrlValidator implements UrlValidatorInterface, RequestMethodInterface
|
||||
public function validateUrlWithTitle(string $url, ?bool $doValidate): ?string
|
||||
{
|
||||
$doValidate = $doValidate ?? $this->options->isUrlValidationEnabled();
|
||||
$response = $this->validateUrlAndGetResponse($url, $doValidate);
|
||||
if (! $doValidate && ! $this->options->autoResolveTitles()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($response === null || ! $this->options->autoResolveTitles()) {
|
||||
$response = $this->validateUrlAndGetResponse($url, $doValidate);
|
||||
if ($response === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user