From 2650a647e95beb3d6f4324ec9db7488d4562ba42 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 2 Nov 2022 18:32:52 +0000 Subject: php warnings --- Zotlabs/Module/Oep.php | 36 ++++++++++++++++++------------------ Zotlabs/Module/Register.php | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Oep.php b/Zotlabs/Module/Oep.php index 8e048a487..d3ef05e16 100644 --- a/Zotlabs/Module/Oep.php +++ b/Zotlabs/Module/Oep.php @@ -15,7 +15,7 @@ class Oep extends \Zotlabs\Web\Controller { logger('oep: ' . print_r($_REQUEST,true), LOGGER_DEBUG, LOG_INFO); $html = ((argc() > 1 && argv(1) === 'html') ? true : false); - if($_REQUEST['url']) { + if(isset($_REQUEST['url'])) { $_REQUEST['url'] = strip_zids($_REQUEST['url']); $url = $_REQUEST['url']; } @@ -23,9 +23,9 @@ class Oep extends \Zotlabs\Web\Controller { if(! $url) http_status_exit(404, 'Not found'); - $maxwidth = $_REQUEST['maxwidth']; - $maxheight = $_REQUEST['maxheight']; - $format = $_REQUEST['format']; + $maxwidth = $_REQUEST['maxwidth'] ?? 0; + $maxheight = $_REQUEST['maxheight'] ?? 0; + $format = $_REQUEST['format'] ?? ''; if($format && $format !== 'json') http_status_exit(501, 'Not implemented'); @@ -70,8 +70,8 @@ class Oep extends \Zotlabs\Web\Controller { $ret = array(); $url = $args['url']; - $maxwidth = intval($args['maxwidth']); - $maxheight = intval($args['maxheight']); + $maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0); + $maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0); if(preg_match('#//(.*?)/display/(.*?)(&|\?|$)#',$url,$matches)) { $res = $matches[2]; @@ -159,8 +159,8 @@ class Oep extends \Zotlabs\Web\Controller { $ret = []; $url = $args['url']; - $maxwidth = intval($args['maxwidth']); - $maxheight = intval($args['maxheight']); + $maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0); + $maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0); if(preg_match('#//(.*?)/cards/(.*?)/(.*?)(&|\?|$)#',$url,$matches)) { $nick = $matches[2]; @@ -246,8 +246,8 @@ class Oep extends \Zotlabs\Web\Controller { $ret = []; $url = $args['url']; - $maxwidth = intval($args['maxwidth']); - $maxheight = intval($args['maxheight']); + $maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0); + $maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0); if(preg_match('#//(.*?)/articles/(.*?)/(.*?)(&|\?|$)#',$url,$matches)) { $nick = $matches[2]; @@ -333,8 +333,8 @@ class Oep extends \Zotlabs\Web\Controller { $ret = array(); $url = $args['url']; - $maxwidth = intval($args['maxwidth']); - $maxheight = intval($args['maxheight']); + $maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0); + $maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0); if(preg_match('#//(.*?)/(.*?)/(.*?)/(.*?)mid\=(.*?)(&|$)#',$url,$matches)) { $chn = $matches[3]; @@ -454,8 +454,8 @@ class Oep extends \Zotlabs\Web\Controller { $ret = array(); $url = $args['url']; - $maxwidth = intval($args['maxwidth']); - $maxheight = intval($args['maxheight']); + $maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0); + $maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0); if(preg_match('|//(.*?)/(.*?)/(.*?)/album/|',$url,$matches)) { $chn = $matches[3]; @@ -519,8 +519,8 @@ class Oep extends \Zotlabs\Web\Controller { $ret = array(); $url = $args['url']; - $maxwidth = intval($args['maxwidth']); - $maxheight = intval($args['maxheight']); + $maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0); + $maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0); if(preg_match('|//(.*?)/(.*?)/(.*?)$|',$url,$matches)) { $chn = $matches[3]; @@ -582,8 +582,8 @@ class Oep extends \Zotlabs\Web\Controller { $ret = array(); $url = $args['url']; - $maxwidth = intval($args['maxwidth']); - $maxheight = intval($args['maxheight']); + $maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0); + $maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0); if(preg_match('|//(.*?)/(.*?)/(.*?)/image/|',$url,$matches)) { $chn = $matches[3]; diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php index 0d423e0cd..5a50b4de0 100644 --- a/Zotlabs/Module/Register.php +++ b/Zotlabs/Module/Register.php @@ -26,7 +26,7 @@ class Register extends Controller { // created a channel, we'll try to revive the connection request // and process it. - if($_REQUEST['connect']) + if(isset($_REQUEST['connect'])) $_SESSION['connect'] = $_REQUEST['connect']; switch($cmd) { -- cgit v1.2.3