Author: Mathias Reker ⚡️ (MathiasReker) Committer: GitHub (web-flow) Pusher: cmb69 Date: 2022-06-17T16:29:04+02:00
Commit: https://github.com/php/web-php/commit/11866535bfec72743420123f34f5dc8d864d1a7c Raw diff: https://github.com/php/web-php/commit/11866535bfec72743420123f34f5dc8d864d1a7c.diff Combine consecutive issets Using isset($var) && multiple times should be done in one call. Co-authored-by: Andreas Möller <a...@localheinz.com> Closes GH-542. Changed paths: M manual/vote-note.php M my.php Diff: diff --git a/manual/vote-note.php b/manual/vote-note.php index 787d96b8c..a9600eb4b 100644 --- a/manual/vote-note.php +++ b/manual/vote-note.php @@ -42,7 +42,7 @@ if (json_last_error() == JSON_ERROR_NONE && isset($r->status) && $r->status && isset($r->votes)) { $response["success"] = true; $response["update"] = (int)$r->votes; - } elseif (json_last_error() == JSON_ERROR_NONE && isset($r->status) && isset($r->message) && $r->status == false) { + } elseif (json_last_error() == JSON_ERROR_NONE && isset($r->status, $r->message) && $r->status == false) { $response["success"] = false; $response["msg"] = $r->message; } else { diff --git a/my.php b/my.php index 428a8846d..67fd2bdeb 100644 --- a/my.php +++ b/my.php @@ -10,7 +10,7 @@ $options = array(); // We have post data, and it is an available language -if (isset($_POST['my_lang']) && isset($langs[$_POST['my_lang']])) { +if (isset($_POST['my_lang'], $langs[$_POST['my_lang']])) { // Set the language preference myphpnet_language($_POST['my_lang']); -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php