Changeset 31972 for extensions


Ignore:
Timestamp:
12/31/18 11:29:24 (11 months ago)
Author:
romanf
Message:

Protect access to $_SERVER with isset()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/MenuRandomPhoto/main.inc.php

    r31883 r31972  
    22/* 
    33Plugin Name: Menu Random Photo 
    4 Version: 2.8.0 
     4Version: 2.8.5 
    55Description: Adds a random picture block into menu 
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=778 
     
    124124        $returned=array(); 
    125125 
    126         if (preg_match('/(Googlebot|bingbot|Baiduspider|yandex|AhrefsBot|msnbot|NCollector)/', $_SERVER["HTTP_USER_AGENT"])) 
     126        if (!isset($_SERVER["HTTP_USER_AGENT"]) || 
     127        preg_match('/(Googlebot|bingbot|Baiduspider|yandex|AhrefsBot|msnbot|NCollector)/', $_SERVER["HTTP_USER_AGENT"])) 
    127128        { 
    128129                return($returned); 
Note: See TracChangeset for help on using the changeset viewer.