]> git.mxchange.org Git - friendica.git/commitdiff
Remove x() function
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 30 Nov 2018 14:07:02 +0000 (09:07 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Fri, 30 Nov 2018 14:07:02 +0000 (09:07 -0500)
boot.php

index 9d72863cc83a3b98392f4de5f8c902a2acb5c228..c6ef3aed9023441d06ad08619a9935f5dc54e982 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -338,42 +338,6 @@ function get_app()
        return BaseObject::getApp();
 }
 
-/**
- * @brief Multi-purpose function to check variable state.
- *
- * Usage: x($var) or x($array, 'key')
- *
- * returns false if variable/key is not set
- * if variable is set, returns 1 if has 'non-zero' value, otherwise returns 0.
- * e.g. x('') or x(0) returns 0;
- *
- * @deprecated since version 2018.12
- * @param string|array $s variable to check
- * @param string       $k key inside the array to check
- *
- * @return bool|int
- */
-function x($s, $k = null)
-{
-       if ($k != null) {
-               if ((is_array($s)) && (array_key_exists($k, $s))) {
-                       if ($s[$k]) {
-                               return (int) 1;
-                       }
-                       return (int) 0;
-               }
-               return false;
-       } else {
-               if (isset($s)) {
-                       if ($s) {
-                               return (int) 1;
-                       }
-                       return (int) 0;
-               }
-               return false;
-       }
-}
-
 /**
  * Return the provided variable value if it exists and is truthy or the provided
  * default value instead.