An illegal choice has been detected. Please contact the site administrator.

Johnny vd Laar - June 25, 2009 - 13:13
Project:Publish Content
Version:6.x-1.1
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:aaronbauman
Status:needs review
Description

when assigning the publish/unpublish permissions i received the following error:
An illegal choice has been detected. Please contact the site administrator.

when i looked at the module code i found that sometimes the permissions have spaces in front of them:
$perms[] = ' publish '. check_plain($type->type) .' content';
$perms[] = ' publish own '. check_plain($type->type) .' content';
$perms[] = 'unpublish '. check_plain($type->type) .' content';
$perms[] = 'unpublish own '. check_plain($type->type) .' content';

when i removed the spaces everywhere everything was working again without the error

our webserver is protected by the suhosin layer (http://www.hardened-php.net/suhosin/) so perhaps that module strips the post variables after the submit

#1

aaronbauman - July 28, 2009 - 21:32

+1

#2

aaronbauman - July 29, 2009 - 13:59
Assigned to:Anonymous» aaronbauman
Status:active» needs review

There are more instances of leading spaces than documented above.

here's a patch.

AttachmentSize
501968-publishcontent.module.patch 2.14 KB
 
 

Drupal is a registered trademark of Dries Buytaert.