mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-02 00:00:15 +00:00
Add @static* annotations where they are missing.
Initialize all static vars that are not, most to `null`. See #32444. git-svn-id: https://develop.svn.wordpress.org/trunk@32650 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -118,13 +118,16 @@ $is_iis7 = $is_IIS && intval( substr( $_SERVER['SERVER_SOFTWARE'], strpos( $_SER
|
||||
/**
|
||||
* Test if the current browser runs on a mobile device (smart phone, tablet, etc.)
|
||||
*
|
||||
* @staticvar bool $is_mobile
|
||||
*
|
||||
* @return bool true|false
|
||||
*/
|
||||
function wp_is_mobile() {
|
||||
static $is_mobile;
|
||||
static $is_mobile = null;
|
||||
|
||||
if ( isset($is_mobile) )
|
||||
if ( isset( $is_mobile ) ) {
|
||||
return $is_mobile;
|
||||
}
|
||||
|
||||
if ( empty($_SERVER['HTTP_USER_AGENT']) ) {
|
||||
$is_mobile = false;
|
||||
|
||||
Reference in New Issue
Block a user