Bug in directory library

I was having some issue where when being presented with a list of entries in the directory to select from, I pressed # and then was pressing 1 to select the first user. This would result in an endless loop to nowhere.

After a bunch of debugging statements the bug appeared in directory.agi around line 112.

The culprit was:
[php]
if(trim($ret[‘result’]) && strpos($validkeys, trim($ret[‘result’]))){
[/php]

where strpos of 1 in validkeys 12 would return 0 which would translate into false

the solution, changed the line to:
[php]
if(trim($ret[‘result’]) && strpos($validkeys, trim($ret[‘result’])) !==false){
[/php]

HTH others

Cheers,
Alain

You did not indicate what version of FreePBX.

Please file a bug report, on our bug tracker.

You can find the bug tracker here:

http://www.freepbx.org/trac/newticket

I’ve opened the bug