Anders Jenbo - 2010-01-06 17:26:42
This function didn't work properly as it incorectly splits the data if there are more then one " value in per line.
function list_mailbox($ref_mail_box="",$wild_card="*")
{
if($this->state == "AUTHORIZATION")
{
$this->error = "Error : User is not authorised or logged in.!<br>";
return false;
}
if(trim($ref_mail_box) == "")
$ref_mail_box = '""';
if($this->put_line($this->tag." LIST $ref_mail_box $wild_card"))
{
$response=$this->get_server_responce();
if(substr($response,strpos($response,"$this->tag ")+strlen($this->tag)+1,2)!="OK")
{
$this->error= "Error : $response !<br>";
return false;
}
}
else
{
$this->error= "Error : Could not send User request. <br>";
return false;
}
return array_slice(preg_replace('/.*"([^"]*)"/', '$1', explode("\r\n", $response)), 1, -1);
}