Author: Kamil Tekiela (kamil-tekiela)
Committer: GitHub (web-flow)
Pusher: kamil-tekiela
Date: 2022-06-28T12:45:50+01:00

Commit: 
https://github.com/php/web-php/commit/4e251d69938cf63e4862fab711d7bbd84a07aaf4
Raw diff: 
https://github.com/php/web-php/commit/4e251d69938cf63e4862fab711d7bbd84a07aaf4.diff

Remove duplicated !isset($var) (#570)

Changed paths:
  M  cal.php
  M  git-php.php
  M  submit-event.php


Diff:

diff --git a/cal.php b/cal.php
index 3b5399959..984d5bb20 100644
--- a/cal.php
+++ b/cal.php
@@ -86,8 +86,8 @@
 }
 
 // Give defaults for the month and day values if they were invalid
-if (!isset($cm) || $cm == 0) { $cm = date("m"); }
-if (!isset($cy) || $cy == 0) { $cy = date("Y"); }
+if (empty($cm)) { $cm = date("m"); }
+if (empty($cy)) { $cy = date("Y"); }
 
 // Start of the month date
 $date = mktime(0, 0, 1, $cm, 1, $cy);
diff --git a/git-php.php b/git-php.php
index ddac98589..909562dd2 100644
--- a/git-php.php
+++ b/git-php.php
@@ -80,7 +80,7 @@
     if (empty($_POST['group']) || $_POST['group'] === 'none' || 
!isset($groups[$_POST['group']])) {
         $error .= "You did not fill out where to send the request. <br>";
     }
-    if (!isset($_POST['guidelines']) || !$_POST['guidelines']) {
+    if (empty($_POST['guidelines'])) {
         $error .= "You did not agree to follow the contribution guidelines. 
<br>";
     }
 
diff --git a/submit-event.php b/submit-event.php
index 769cec863..98892a77b 100644
--- a/submit-event.php
+++ b/submit-event.php
@@ -15,7 +15,7 @@
     'emonth', 'eyear', 'recur', 'recur_day'
 );
 foreach ($vars as $varname) {
-    if (!isset($_POST[$varname]) || empty($_POST[$varname])) {
+    if (empty($_POST[$varname])) {
         $_POST[$varname] = 0;
     }
 }

-- 
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to