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:
if(trim($ret[‘result’]) && strpos($validkeys, trim($ret[‘result’]))){

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

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

HTH others


You did not indicate what version of FreePBX.

Please file a bug report, on our bug tracker.

You can find the bug tracker here:


I’ve opened the bug