$adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
//if(local_user() && x($a->user,'email') && x($a->config,'admin_email') && ($a->user['email'] === $a->config['admin_email']))
+ /// @TODO This if() + 2 returns can be shrinked into one return
if (local_user() && x($a->user, 'email') && x($a->config, 'admin_email') && in_array($a->user['email'], $adminlist)) {
return true;
}
{
$rn = '';
for ($i = 0; $i < $digits; $i++) {
- /// @TODO rand() is different to mt_rand() and maybe lesser "random"
+ /// @TODO Avoid rand/mt_rand, when it comes to cryptography, they are generating predictable (seedable) numbers.
$rn .= rand(0, 9);
}
return $rn;
$server = "https://dir.friendica.social";
}
- return($server);
+ return $server;
}
function get_temppath()
$cache = get_itemcachepath();
if ((!$cache) || (!is_dir($cache))) {
- return("");
+ return "";
}
$subfolder = $cache . "/" . substr($file, 0, 2);
}
}
- /// @TODO no need to put braces here
return $cachepath;
}
return "";
}
-
if (!function_exists('exif_imagetype')) {
function exif_imagetype($file)
{
}
// Simply return flag
- return ($valid);
+ return $valid;
}
function current_load()