mirror of
https://github.com/friendica/friendica
synced 2025-05-04 11:04:09 +02:00
Renamed function name
This commit is contained in:
parent
0aa49510b2
commit
9b73189e1d
3 changed files with 18 additions and 19 deletions
|
@ -660,23 +660,22 @@ class Network
|
|||
}
|
||||
|
||||
/**
|
||||
* Check if a provided URI is valid
|
||||
* Creates an Uri object out of a given Uri string
|
||||
*
|
||||
* @param string|null $uri
|
||||
* @return boolean
|
||||
* @return UriInterface|null
|
||||
*/
|
||||
public static function isValidUri(string $uri = null): bool
|
||||
public static function createUriFromString(string $uri = null): ?UriInterface
|
||||
{
|
||||
if (empty($uri)) {
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
new Uri($uri);
|
||||
return new Uri($uri);
|
||||
} catch (\Exception $e) {
|
||||
Logger::debug('Invalid URI', ['code' => $e->getCode(), 'message' => $e->getMessage(), 'uri' => $uri]);
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue