Skip to content
Permalink
Browse files

Trim overlong client information (#2574)

Trim HTTP referrer and user-agent as per mysql constraints
  • Loading branch information...
LorenzCK authored and ozh committed Nov 6, 2019
1 parent 27913fb commit 16db6245207b38d53e45927bb7f6ce1c736122ea
Showing with 2 additions and 2 deletions.
  1. +2 −2 includes/functions.php
@@ -888,8 +888,8 @@ function yourls_log_redirect( $keyword ) {
$binds = array(
'now' => date( 'Y-m-d H:i:s' ),
'keyword' => yourls_sanitize_string($keyword),
'referrer' => isset($_SERVER['HTTP_REFERER']) ? yourls_sanitize_url_safe($_SERVER['HTTP_REFERER']) : 'direct',
'ua' => yourls_get_user_agent(),
'referrer' => isset($_SERVER['HTTP_REFERER']) ? yourls_sanitize_url_safe(substr($_SERVER['HTTP_REFERER'], 0, 200)) : 'direct',
'ua' => substr(yourls_get_user_agent(), 0, 255),
'ip' => $ip,
'location' => yourls_geo_ip_to_countrycode($ip),
);

0 comments on commit 16db624

Please sign in to comment.
You can’t perform that action at this time.