From d26a1db79024d8cbc0bc5a6ffb8de2dc3077307c Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 16 Aug 2021 05:48:59 -0400 Subject: [PATCH] [various] Remove remaining mentions of App->argc/argv - The property has been removed in the core --- saml/saml.php | 4 ++-- tictac/tictac.php | 14 +++++++------- widgets/widgets.php | 28 ++++++++++++++-------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/saml/saml.php b/saml/saml.php index d39ef003..25a4ad37 100755 --- a/saml/saml.php +++ b/saml/saml.php @@ -25,7 +25,7 @@ function saml_module($a) function saml_init($a) { - if ($a->argc < 2) { + if (DI::args()->getArgc() < 2) { return; } @@ -34,7 +34,7 @@ function saml_init($a) return; } - switch ($a->argv[1]) { + switch (DI::args()->get(1)) { case 'metadata.xml': saml_metadata(); break; diff --git a/tictac/tictac.php b/tictac/tictac.php index 47c9e806..4d3a46b4 100644 --- a/tictac/tictac.php +++ b/tictac/tictac.php @@ -30,16 +30,16 @@ function tictac_content(&$a) { $o = ''; if($_POST['move']) { - $handicap = $a->argv[1]; - $mefirst = $a->argv[2]; - $dimen = $a->argv[3]; - $yours = $a->argv[4]; - $mine = $a->argv[5]; + $handicap = DI::args()->get(1); + $mefirst = DI::args()->get(2); + $dimen = DI::args()->get(3); + $yours = DI::args()->get(4); + $mine = DI::args()->get(5); $yours .= $_POST['move']; } - elseif($a->argc > 1) { - $handicap = $a->argv[1]; + elseif(DI::args()->getArgc() > 1) { + $handicap = DI::args()->get(1); $dimen = 3; } else { diff --git a/widgets/widgets.php b/widgets/widgets.php index 319a8a78..3ddddd5e 100644 --- a/widgets/widgets.php +++ b/widgets/widgets.php @@ -82,7 +82,7 @@ function _randomAlphaNum($length){ function widgets_content(&$a) { if (!isset($_GET['k'])) { - if($a->argv[2]=="cb"){header('HTTP/1.0 400 Bad Request'); exit();} + if(DI::args()->get(2)=="cb"){header('HTTP/1.0 400 Bad Request'); exit();} return; } @@ -90,7 +90,7 @@ function widgets_content(&$a) { DBA::escape($_GET['k']) ); if (!count($r)){ - if($a->argv[2]=="cb"){header('HTTP/1.0 400 Bad Request'); exit();} + if(DI::args()->get(2)=="cb"){header('HTTP/1.0 400 Bad Request'); exit();} return; } $conf = []; @@ -99,11 +99,11 @@ function widgets_content(&$a) { $o = ""; - $widgetfile =dirname(__file__)."/widget_".$a->argv[1].".php"; + $widgetfile =dirname(__file__)."/widget_".DI::args()->get(1).".php"; if (file_exists($widgetfile)){ require_once($widgetfile); } else { - if($a->argv[2]=="cb"){header('HTTP/1.0 400 Bad Request'); exit();} + if(DI::args()->get(2)=="cb"){header('HTTP/1.0 400 Bad Request'); exit();} return; } @@ -111,9 +111,9 @@ function widgets_content(&$a) { //echo "
"; var_dump($a->argv); die();
-	if ($a->argv[2]=="cb"){
+	if (DI::args()->get(2)=="cb"){
 		/*header('Access-Control-Allow-Origin: *');*/
-		$o .= call_user_func($a->argv[1].'_widget_content',$a, $conf);
+		$o .= call_user_func(DI::args()->get(1).'_widget_content',$a, $conf);
 
 	} else {
 
@@ -123,8 +123,8 @@ function widgets_content(&$a) {
 			$o .= "

Preview Widget

"; $o .= ''. DI::l10n()->t("Addon Settings") .''; - $o .= "

".call_user_func($a->argv[1].'_widget_name')."

"; - $o .= call_user_func($a->argv[1].'_widget_help'); + $o .= "

".call_user_func(DI::args()->get(1).'_widget_name')."

"; + $o .= call_user_func(DI::args()->get(1).'_widget_help'); $o .= "

"; $o .= "') ."";