[drupal-devel] [bug] user_access returns invalid data

javanaut drupal-devel at drupal.org
Thu Feb 3 21:32:50 UTC 2005


 Project:      Drupal
 Version:      <none>
 Component:    user.module
 Category:     bug reports
 Priority:     critical
 Assigned to:  javanaut
 Reported by:  javanaut
 Updated by:   javanaut
 Status:       patch
 Attachment:   http://drupal.org/files/issues/user_access_bug.patch (473 bytes)

The user_access function in user.module returns the results of the
*strstr()* function, which returns a string, not a Boolean like the
documentation suggests.  This was screwing things up for me since
flexinode relies on user_access for it's node_access('create'..)
functionality.
The attached patch uses strpos instead of strstr.  It was created from
a 4.5 codebase, but I noticed that the same issue is in HEAD as well. 
I'm using it on my dev site, and node_access('create'..) calls are now
working properly and nothing I'm using seems to have any problems with
it.


javanaut

-- 
View: http://drupal.org/node/16705
Edit: http://drupal.org/project/comments/add/16705





More information about the drupal-devel mailing list