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.

CommentFileSizeAuthor
deslash.patch2.35 KBjames.cartledge
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

james.cartledge’s picture

Status: Active » Needs review
nicholasThompson’s picture

Version: 6.x-1.1 » 5.x-1.x-dev
Assigned: Unassigned » nicholasThompson
Priority: Normal » Critical
Status: Needs review » Patch (to be ported)

Fixed 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...

nicholasThompson’s picture

Status: Patch (to be ported) » Fixed

Applied fixes to DRUPAL-5 - will be in next major release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.