general: Fix PHP 7.3 deprecation warnings (#982)

Fix PHP 7.3 deprecation warnings. FILTER_VALIDATE_URL implies FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED since PHP 5.2.1

https://bugs.php.net/bug.php?id=75442
This commit is contained in:
triatic 2018-12-28 15:13:03 +00:00 committed by LogMANOriginal
parent 988635dcf3
commit 81ee15a161
4 changed files with 5 additions and 10 deletions

View file

@ -179,8 +179,7 @@ class FacebookBridge extends BridgeAbstract {
if(filter_var(
$group,
FILTER_VALIDATE_URL,
FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED)) {
FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) {
// User provided a URL
$urlparts = parse_url($group);

View file

@ -186,8 +186,7 @@ class GlassdoorBridge extends BridgeAbstract {
* redirection and strange naming conventions.
*/
if(!filter_var($uri,
FILTER_VALIDATE_URL,
FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED)) {
FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) {
returnClientError('The specified URL is invalid!');
}

View file

@ -75,8 +75,7 @@ class XenForoBridge extends BridgeAbstract {
$this->threadurl = filter_var(
$this->getInput('url'),
FILTER_VALIDATE_URL,
FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED);
FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED);
if($this->threadurl === false) {
returnClientError('The URL you provided is invalid!');

View file

@ -150,8 +150,7 @@ class FeedItem {
Debug::log('URI must be a string!');
} elseif(!filter_var(
$uri,
FILTER_VALIDATE_URL,
FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED)) {
FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) {
Debug::log('URI must include a scheme, host and path!');
} else {
$scheme = parse_url($uri, PHP_URL_SCHEME);
@ -343,8 +342,7 @@ class FeedItem {
foreach($enclosures as $enclosure) {
if(!filter_var(
$enclosure,
FILTER_VALIDATE_URL,
FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED)) {
FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) {
Debug::log('Each enclosure must contain a scheme, host and path!');
} else {
$this->enclosures[] = $enclosure;