PHP Notice: Undefined offset: 1
-
Found in the log db such error
peter-zarubin.ru [Sat Apr 29 11:59:28 2017] [error] [client 37.195.67.92] PHP Notice: Undefined offset: 1 in /public_html/wp-content/plugins/easy-social-share-buttons3/public/get-noapi-counts.php on line 92, referer: https://peter-zarubin.ru/articles/
the code is
`function get_counter_number_odnoklassniki( $url ) {
$CHECK_URL_PREFIX = ‘https://www.odnoklassniki.ru/dk?st.cmd=extLike&uid=odklcnt0&ref=’;$check_url = $CHECK_URL_PREFIX . $url;
$data = parse( $check_url );
$shares = array();//print $check_url . ‘ = ‘ .$data;
preg_match( ‘/^ODKL\.updateCount\(\’odklcnt0\’,\'(\d+)\’\);$/i’, $data, $shares );return (int)$shares[ 1 ];
}`row 92 is
return (int)$shares[ 1 ];How to fix it?
- The topic ‘PHP Notice: Undefined offset: 1’ is closed to new replies.