Udefined index and offset
-
I GOT:
Undefined index: HTTP_REFERER
…./wp-content/plugins/wp-statistics/includes/classes/statistics.class.php Row: 118
Undefined offset: 1
…./wp-content/plugins/wp-statistics/includes/classes/hits.class.php Row: 124
Undefined offset: 1
…./wp-content/plugins/wp-statistics/includes/classes/hits.class.php Row: 125PROPOSED SOLUTIONS:
statistics.class.php Row 111:
if( isset($_SERVER[‘HTTP_REFERER’]) ) { //NEW LINE
if( $default_referr ) {
if( !esc_sql(strip_tags($_SERVER[‘HTTP_REFERER’])) ) {
return get_bloginfo(‘url’);
} else {
return esc_sql(strip_tags($_SERVER[‘HTTP_REFERER’]));
}
} else {
return esc_sql(strip_tags($_SERVER[‘HTTP_REFERER’]));
}
} //NEW LINEhits.class.php Row 124:
if( isset($ip_arr[1]) ) { //NEW LINE
$x = ip2long($ip_arr[1]);
$mask = long2ip($x) == $ip_arr[1] ? $x : 0xffffffff << (32 – $ip_arr[1]);
$ip_long = ip2long($ip);// echo “>”.$ip_arr[1].”> “.decbin($mask).”\n”;
return ($ip_long & $mask) == ($network_long & $mask);
} //NEW LINE
- The topic ‘Udefined index and offset’ is closed to new replies.