db_create_set_function - parsing bug

Project:phpAlbum.net
Version:0.4.1-14
Component:Code
Category:bug
Priority:normal
Assigned:Unassigned
Status:new
Description

Took me 6 hrs to find this.... :-)

1) If you have a group that happens to be named a php reserved word
2) You have nested folders in /photo
3) You attempt to change the group permissions in the parent folder

db_create_set_function creates a parsing error because the second index- the "group name" (which in this case is the labeled the reserved word is not encased in quotes.

Here is an extract of the code generated:

if($data["inh_groups"][guest]==1002){unset($data["inh_groups"][guest]);}if($data["inh_groups"][superuser]==1002){unset($data["inh_groups"][superuser]);}if($data["inh_groups"][Friends]==1002){unset($data["inh_groups"][Friends]);}if($data["inh_groups"][Family]==1002){unset($data["inh_groups"][Family]);}if($data["inh_groups"][NoAccess]==1002){unset($data["inh_groups"][NoAccess]);}if(!isset($data["inh_groups"][default])){$data["inh_groups"][default]=1002;};array_walk($data,'db_remove_uvodzovky_slash');

Please note: $data["inh_groups"][default] --> :-)

"default" was the name of my group.

the parsing error is "unexpected ']'"

:) - Your welcome


style="display:inline-block;width:468px;height:60px"
data-ad-client="ca-pub-8698264690166658"
data-ad-slot="4417389723">