My specific problem surfaces when a user is logging into my Durpal website with a long-ish URL. Specifically, the URL is 92 characters long. After entering login information, a watchdog message is sent stating that my legacy password was edited. Watchdog then creates the location and referrer data to insert into the database. These fields are 128 characters each, causing the location field to overflow and put up warnings coming from the database module.
Normally I would just expand the field in the database or update the code to have a maximum length, but these both fall under the Drupal Core. It would be great to see one of these two options be put into Drupal Core.
Thanks!
Comments
Comment #1
maastrix commentedYeah, the urls should have some kind of wordwrap so it can be managed how long they are allowed to be. Some design require smaller widths than others so this should be a setting or so. It can't be changed by css because only IE provides an word-wrap or word-break option.
Comment #2
magico commentedChecked.
Comment #3
bdragon commentedIn HEAD, location is now a 'text' field in the db, so length should no longer be a problem..
Referrer is still 128 long though...
Is this sufficient?
Comment #4
fractile81 commentedInteresting solution. A couple of points:
The biggest offenders on my site now are search result pages. The amount of GET data that an advanced search can put out tends to make my search-related URLs rather long. Start clicking through pages, and you can see why I had problems with the referrer as well.
After looking around, TEXT probably is the right type for the fields. I only hesitate because I'm uncertain as to the performance impact that type might have on such a heavily utilized table.
Comment #5
damiancugley commentedThis is also an issue
(1) when logging in with OpenID, since OpenID involves very long URLs,
(2) when a security tester attempts a cross-site scripting attack.
One of the side effects of the error message being issued is that the names of one of the tables in the database is revealed; while this is not exactly secret (Drupal being free software), our customer feels it is a security concern.
URLs in general are officially allowed to be of arbitrary length; Internet Explorer imposes a limit of 2083 characters. So 128 characters is a fairly low limit. Either the watchdog module should clip values (if the assumption is that long URLs are not worth recording) or the database limits need changing.
Comment #6
bdragon commentedlocation was fixed by #98551: regression (default TEXT) by too long file urls causes watchdog errors. (pre drupal 5.0-beta2.)
referer was fixed by #107824: Convert {watchdog}.referer and {accesslog}.url from VARCHAR to TEXT. (during d6 maintenance cycle)