Browse Source

Deprecate is_empty()

master
Skylar Ittner 4 months ago
parent
commit
4f1b81ff4b
4 changed files with 5 additions and 4 deletions
  1. 2
    2
      app.php
  2. 1
    1
      index.php
  3. 1
    1
      mobile/index.php
  4. 1
    0
      required.php

+ 2
- 2
app.php View File

@@ -13,7 +13,7 @@ if ($_SESSION['loggedin'] != true) {
13 13
 require_once __DIR__ . "/pages.php";
14 14
 
15 15
 $pageid = "home";
16
-if (isset($_GET['page']) && !is_empty($_GET['page'])) {
16
+if (!empty($_GET['page'])) {
17 17
     $pg = strtolower($_GET['page']);
18 18
     $pg = preg_replace('/[^0-9a-z_]/', "", $pg);
19 19
     if (array_key_exists($pg, PAGES) && file_exists(__DIR__ . "/pages/" . $pg . ".php")) {
@@ -68,7 +68,7 @@ header("Link: <static/js/bootstrap.bundle.min.js>; rel=preload; as=script", fals
68 68
         if (!empty($_GET['msg'])) {
69 69
             if (array_key_exists($_GET['msg'], MESSAGES)) {
70 70
                 // optional string generation argument
71
-                if (!isset($_GET['arg']) || is_empty($_GET['arg'])) {
71
+                if (empty($_GET['arg'])) {
72 72
                     $alertmsg = $Strings->get(MESSAGES[$_GET['msg']]['string'], false);
73 73
                 } else {
74 74
                     $alertmsg = $Strings->build(MESSAGES[$_GET['msg']]['string'], ["arg" => strip_tags($_GET['arg'])], false);

+ 1
- 1
index.php View File

@@ -47,7 +47,7 @@ if (Login::checkLoginServer()) {
47 47
                         $username_ok = true;
48 48
                         break;
49 49
                     default:
50
-                        if (!is_empty($error)) {
50
+                        if (!empty($error)) {
51 51
                             $alert = $error;
52 52
                         } else {
53 53
                             $alert = $Strings->get("login error", false);

+ 1
- 1
mobile/index.php View File

@@ -75,7 +75,7 @@ if (mobile_enabled() !== TRUE) {
75 75
 }
76 76
 
77 77
 // Make sure we have a username and access key
78
-if (is_empty($VARS['username']) || is_empty($VARS['key'])) {
78
+if (empty($VARS['username']) || empty($VARS['key'])) {
79 79
     http_response_code(401);
80 80
     die(json_encode(["status" => "ERROR", "msg" => "Missing username and/or access key."]));
81 81
 }

+ 1
- 0
required.php View File

@@ -133,6 +133,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
133 133
 }
134 134
 
135 135
 /**
136
+ * @deprecated
136 137
  * Checks if a string or whatever is empty.
137 138
  * @param $str The thingy to check
138 139
  * @return boolean True if it's empty or whatever.

Loading…
Cancel
Save