Browse Source

Fix annoying "Undefined index" warning in server error.log

Skylar Ittner 2 years ago
parent
commit
88175dbe9d
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      required.php

+ 2
- 2
required.php View File

@@ -9,7 +9,7 @@ session_start();
9 9
 
10 10
 header("Access-Control-Allow-Origin: *");
11 11
 
12
-if (strtolower($_GET['format']) == 'plain') {
12
+if (isset($_GET['format']) && strtolower($_GET['format']) == 'plain') {
13 13
     define("JSON", false);
14 14
     header('Content-Type: text/plain; charset=utf-8');
15 15
 } else {
@@ -65,5 +65,5 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
65 65
  * @return boolean True if it's empty or whatever.
66 66
  */
67 67
 function is_empty($str) {
68
-    return (!isset($str) || $str == '' || $str == null);
68
+    return (is_null($str) || !isset($str) || $str == '');
69 69
 }

Loading…
Cancel
Save