Changeset 2166556 for wp-slimstat
- Timestamp:
- 10/01/2019 08:18:21 PM (6 years ago)
- File:
-
- 1 edited
-
wp-slimstat/trunk/wp-slimstat.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-slimstat/trunk/wp-slimstat.php
r2166555 r2166556 181 181 // Is this a new visitor, based on his fingerprint? 182 182 if ( !empty( self::$stat[ 'fingerprint' ] ) && self::_is_new_visitor( self::$stat[ 'fingerprint' ] ) ) { 183 self::$stat[ 'notes' ] [] = 'new:yes';183 self::$stat[ 'notes' ] = array( 'new:yes' ); 184 184 } 185 185 … … 273 273 // Is this a new visitor, based on his fingerprint? 274 274 if ( !empty( self::$stat[ 'fingerprint' ] ) && self::_is_new_visitor( self::$stat[ 'fingerprint' ] ) ) { 275 self::$stat[ 'notes' ] [] = 'new:yes';275 self::$stat[ 'notes' ] = array( 'new:yes' ); 276 276 } 277 277 … … 296 296 public static function slimtrack() { 297 297 self::$stat[ 'dt' ] = self::date_i18n( 'U' ); 298 self::$stat[ 'notes' ] = array(); 298 299 if ( empty( self::$stat[ 'notes' ] ) ) { 300 self::$stat[ 'notes' ] = array(); 301 } 299 302 300 303 // Allow third-party tools to initialize the stat array … … 1437 1440 1438 1441 // The 'notes' column stores multiple comma-separated values: we need to append the new value to the existing ones 1442 // Also, values are organized in an array, which we need to implode as a string 1439 1443 $notes = ''; 1440 1444 if ( !empty( $_data[ 'notes' ] ) && is_array( $_data[ 'notes' ] ) ) { 1441 $imploded_notes = '[' . esc_sql( implode( '][', $_data[ 'notes' ] ) ) . ']'; 1442 $notes = ( count( $_data ) > 1 ? ',' : '' ) . "notes=CONCAT( IFNULL( notes, '' ), '" . $imploded_notes . "' )"; 1445 $notes = ( count( $_data ) > 1 ? ',' : '' ) . "notes=CONCAT( IFNULL( notes, '' ), '[" . esc_sql( implode( '][', $_data[ 'notes' ] ) ) . "]' )"; 1443 1446 unset( $_data[ 'notes' ] ); 1444 1447 }
Note: See TracChangeset
for help on using the changeset viewer.