What is the current behavior?
When redirected from a super long(>200 chars, I guess) URL, the program encounters an error
This is a bug because it does not redirect the browser do the long URL.
What is the expected or desired behavior?
It should redirect to the long URL.
Fatal error: Uncaught PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'referrer' at row 1 in /data/dy-pages/store-1/704/2049704/www/includes/vendor/aura/sql/src/ExtendedPdo.php:748 Stack trace: #0 /data/dy-pages/store-1/704/2049704/www/includes/vendor/aura/sql/src/ExtendedPdo.php(748): PDOStatement->execute() #1 /data/dy-pages/store-1/704/2049704/www/includes/vendor/aura/sql/src/ExtendedPdo.php(306): Aura\Sql\ExtendedPdo->perform('INSERT INTO `yo...', Array) #2 /data/dy-pages/store-1/704/2049704/www/includes/functions.php(869): Aura\Sql\ExtendedPdo->fetchAffected('INSERT INTO `yo...', Array) #3 /data/dy-pages/store-1/704/2049704/www/yourls-go.php(27): yourls_log_redirect('1') #4 /data/dy-pages/store-1/704/2049704/www/index.php(37): require_once('/data/dy-pages/...') #5 {main} thrown in /data/dy-pages/store-1/704/2049704/www/includes/vendor/aura/sql/src/ExtendedPdo.php on line 748
That's it.
Yep. The same problem would happen with really long user-agents, except those are truncated in yourls_get_user_agent(). YOURLS should probably do the same with the referrer, if not widen the referrer database column…
Anyone fix it? Sadly I don't know much php.
I have same problem.
Just go to the database and change the length of referrer.
ALTER TABLE yourls_log MODIFY referrer VARCHAR(1000)
I think this has been fixed somewhere along the road. Closing.
I am not so sure it has. I'm running 1.7.4 though (and have been since deployment 2019 Q4) so unless the scripts that make the tables have been changed since then, then it's not fixed. Just had a user report this error yesterday and going in the table to update the referrer field manually now
Most helpful comment
Yep. The same problem would happen with really long user-agents, except those are truncated in
yourls_get_user_agent(). YOURLS should probably do the same with the referrer, if not widen the referrer database column…