Title: [PATCH] Undefined Index HTTP_USER_AGENT
Last modified: August 22, 2016

---

# [PATCH] Undefined Index HTTP_USER_AGENT

 *  [Jay](https://wordpress.org/support/users/phyrax/)
 * (@phyrax)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/patch-undefined-index-http_user_agent/)
 * Error code I have:
 * > PHP Notice: Undefined index: HTTP_USER_AGENT in D:\home\site\wwwroot\wp-content\
   > plugins\wp-native-dashboard\wp-native-dashboard.php on line 159
 * Change This:
 *     ```
       $this->user_agent_is_wp_native_dashboard = ($_SERVER["HTTP_USER_AGENT"] == "WP_NATIVE_DASHBOARD");
       ```
   
 * To This:
 *     ```
       $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) && 'WP_NATIVE_DASHBOARD' == $_SERVER['HTTP_USER_AGENT'] ? true : false;
       $this->user_agent_is_wp_native_dashboard = $user_agent;
       ```
   
 * There are some instances where HTTP_USER_AGENT isn’t set, ie. from a firewall
   filter or some other means. This handles that.
 * [https://wordpress.org/plugins/wp-native-dashboard/](https://wordpress.org/plugins/wp-native-dashboard/)

The topic ‘[PATCH] Undefined Index HTTP_USER_AGENT’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-native-dashboard_d8d8d8.svg)
 * [WP Native Dashboard](https://wordpress.org/plugins/wp-native-dashboard/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-native-dashboard/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-native-dashboard/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-native-dashboard/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-native-dashboard/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-native-dashboard/reviews/)

## Tags

 * [undefined index](https://wordpress.org/support/topic-tag/undefined-index/)

 * 0 replies
 * 1 participant
 * Last reply from: [Jay](https://wordpress.org/support/users/phyrax/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/patch-undefined-index-http_user_agent/)
 * Status: not resolved