Browse Source

Remove is_empty()

master
Skylar Ittner 6 months ago
parent
commit
13b60de915
1 changed files with 0 additions and 42 deletions
  1. 0
    42
      required.php

+ 0
- 42
required.php View File

@@ -132,16 +132,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
132 132
     define("GET", true);
133 133
 }
134 134
 
135
-/**
136
- * @deprecated
137
- * Checks if a string or whatever is empty.
138
- * @param $str The thingy to check
139
- * @return boolean True if it's empty or whatever.
140
- */
141
-function is_empty($str) {
142
-    return (is_null($str) || !isset($str) || $str == '');
143
-}
144
-
145 135
 
146 136
 function dieifnotloggedin() {
147 137
     if ($_SESSION['loggedin'] != true) {
@@ -166,38 +156,6 @@ function checkDBError($specials = []) {
166 156
     }
167 157
 }
168 158
 
169
-/*
170
- * http://stackoverflow.com/a/20075147
171
- */
172
-if (!function_exists('base_url')) {
173
-
174
-    function base_url($atRoot = FALSE, $atCore = FALSE, $parse = FALSE) {
175
-        if (isset($_SERVER['HTTP_HOST'])) {
176
-            $http = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';
177
-            $hostname = $_SERVER['HTTP_HOST'];
178
-            $dir = str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
179
-
180
-            $core = preg_split('@/@', str_replace($_SERVER['DOCUMENT_ROOT'], '', realpath(dirname(__FILE__))), NULL, PREG_SPLIT_NO_EMPTY);
181
-            $core = $core[0];
182
-
183
-            $tmplt = $atRoot ? ($atCore ? "%s://%s/%s/" : "%s://%s/") : ($atCore ? "%s://%s/%s/" : "%s://%s%s");
184
-            $end = $atRoot ? ($atCore ? $core : $hostname) : ($atCore ? $core : $dir);
185
-            $base_url = sprintf($tmplt, $http, $hostname, $end);
186
-        } else
187
-            $base_url = 'http://localhost/';
188
-
189
-        if ($parse) {
190
-            $base_url = parse_url($base_url);
191
-            if (isset($base_url['path']))
192
-                if ($base_url['path'] == '/')
193
-                    $base_url['path'] = '';
194
-        }
195
-
196
-        return $base_url;
197
-    }
198
-
199
-}
200
-
201 159
 function redirectIfNotLoggedIn() {
202 160
     if ($_SESSION['loggedin'] !== TRUE) {
203 161
         header('Location: ' . URL . '/index.php');

Loading…
Cancel
Save