Skip to content

Commit

Permalink
Trim overlong client information (#2574)
Browse files Browse the repository at this point in the history
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 16db624
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
Expand Down

0 comments on commit 16db624

Please sign in to comment.