In the 6.x-1.1 release, the deslash preference set by the user is not honoured - deslashing is always performed.
To reproduce:
1. Navigate to admin/settings/globalredirect
2. Set Deslash to Off and click Save Configuration.
3. Confirm Deslash is now set to Off.
4. Click in the browser location field and add a slash to the end of the url e.g. admin/settings/globalredirect/
5. Press enter.
Expected result:
The URL in the location field ends admin/settings/globalredirect/
Actual result:
The URL in the location field ends admin/settings/globalredirect
There are three bugs contributing to the problem - the attached patch fixes them (I think.)
1. In globalredirect.admin.inc, 'deslash' is spelt 'deslah' in 2 places causing the database variable to be created with the wrong name. This means that later attempts to look up the variable with the correct name always return the default value ("-1".)
2. variable_get returns the variable as a string - "-1" - which evaluates to true in PHP. This is then cast to a bool which is always true. FIX: compare the value returned to GLOBALREDIRECT_FEATURE_DISABLED.
3. Some deslash logic in globalredirect.module does not take into account the user's preference. FIX: Check the user's preference before deslashing.
Please test.
Comment | File | Size | Author |
---|---|---|---|
deslash.patch | 2.35 KB | james.cartledge | |
Comments
Comment #1
james.cartledge CreditAttribution: james.cartledge commentedComment #2
nicholasThompsonFixed in 6.x-1.x-dev. Will be in next major release.
Thanks very much for pointing this out.
Fix needs porting to DRUPAL-5 branch too...
Comment #3
nicholasThompsonApplied fixes to DRUPAL-5 - will be in next major release.