permissions_revoke_permissions error

yejezkel - October 27, 2009 - 13:27
Project:Permissions API
Version:6.x-2.5
Component:Code
Category:bug report
Priority:critical
Assigned:ebeyrent
Status:active
Description

In the permissions_revoke_permissions function there is the following error:

<?php
foreach($new_permissions as $permission){
       
$index = array_search($permission, $permissions);       
        if(
$index >= FALSE){
        
/* The above question is a mistake because if the searched permission is not in the array you get FALSE that is converted to 0 so you revoke the
             first permission on the array.
             the code should be changed to if($index !== FALSE)
         */
         
unset($permissions[$index]);      
        }
      }
?>

I don't fix it my self because i dont know how to commit the change

#1

ebeyrent - October 28, 2009 - 03:13
Assigned to:Anonymous» ebeyrent

I'll take a look at this right away; thanks for the bug report!

#2

ebeyrent - October 28, 2009 - 03:46

This has been committed; I'll update the release soon.

 
 

Drupal is a registered trademark of Dries Buytaert.