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:
parent
988635dcf3
commit
81ee15a161
4 changed files with 5 additions and 10 deletions
|
@ -179,8 +179,7 @@ class FacebookBridge extends BridgeAbstract {
|
||||||
|
|
||||||
if(filter_var(
|
if(filter_var(
|
||||||
$group,
|
$group,
|
||||||
FILTER_VALIDATE_URL,
|
FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) {
|
||||||
FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED)) {
|
|
||||||
// User provided a URL
|
// User provided a URL
|
||||||
|
|
||||||
$urlparts = parse_url($group);
|
$urlparts = parse_url($group);
|
||||||
|
|
|
@ -186,8 +186,7 @@ class GlassdoorBridge extends BridgeAbstract {
|
||||||
* redirection and strange naming conventions.
|
* redirection and strange naming conventions.
|
||||||
*/
|
*/
|
||||||
if(!filter_var($uri,
|
if(!filter_var($uri,
|
||||||
FILTER_VALIDATE_URL,
|
FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) {
|
||||||
FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED)) {
|
|
||||||
returnClientError('The specified URL is invalid!');
|
returnClientError('The specified URL is invalid!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,8 +75,7 @@ class XenForoBridge extends BridgeAbstract {
|
||||||
|
|
||||||
$this->threadurl = filter_var(
|
$this->threadurl = filter_var(
|
||||||
$this->getInput('url'),
|
$this->getInput('url'),
|
||||||
FILTER_VALIDATE_URL,
|
FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED);
|
||||||
FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED);
|
|
||||||
|
|
||||||
if($this->threadurl === false) {
|
if($this->threadurl === false) {
|
||||||
returnClientError('The URL you provided is invalid!');
|
returnClientError('The URL you provided is invalid!');
|
||||||
|
|
|
@ -150,8 +150,7 @@ class FeedItem {
|
||||||
Debug::log('URI must be a string!');
|
Debug::log('URI must be a string!');
|
||||||
} elseif(!filter_var(
|
} elseif(!filter_var(
|
||||||
$uri,
|
$uri,
|
||||||
FILTER_VALIDATE_URL,
|
FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) {
|
||||||
FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED)) {
|
|
||||||
Debug::log('URI must include a scheme, host and path!');
|
Debug::log('URI must include a scheme, host and path!');
|
||||||
} else {
|
} else {
|
||||||
$scheme = parse_url($uri, PHP_URL_SCHEME);
|
$scheme = parse_url($uri, PHP_URL_SCHEME);
|
||||||
|
@ -343,8 +342,7 @@ class FeedItem {
|
||||||
foreach($enclosures as $enclosure) {
|
foreach($enclosures as $enclosure) {
|
||||||
if(!filter_var(
|
if(!filter_var(
|
||||||
$enclosure,
|
$enclosure,
|
||||||
FILTER_VALIDATE_URL,
|
FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) {
|
||||||
FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_PATH_REQUIRED)) {
|
|
||||||
Debug::log('Each enclosure must contain a scheme, host and path!');
|
Debug::log('Each enclosure must contain a scheme, host and path!');
|
||||||
} else {
|
} else {
|
||||||
$this->enclosures[] = $enclosure;
|
$this->enclosures[] = $enclosure;
|
||||||
|
|
Loading…
Reference in a new issue