Skip to content

Commit 9402474

Browse files
committed
Null value attribute problem fixed
1 parent 6990abb commit 9402474

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/IMAP/Message.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,14 @@ public function __call($method, $arguments) {
232232
if(strtolower(substr($method, 0, 3)) === 'get') {
233233
$name = snake_case(substr($method, 3));
234234

235-
if(isset($this->attributes[$name])) {
235+
if(in_array($name, $this->attributes)) {
236236
return $this->attributes[$name];
237237
}
238238

239239
}elseif (strtolower(substr($method, 0, 3)) === 'set') {
240240
$name = snake_case(substr($method, 3));
241241

242-
if(isset($this->attributes[$name])) {
242+
if(in_array($name, $this->attributes)) {
243243
$this->attributes[$name] = array_pop($arguments);
244244

245245
return $this->attributes[$name];
@@ -950,7 +950,7 @@ public function getContainingFolder(Folder $folder = null) {
950950
* @param bool $expunge
951951
* @param bool $create_folder
952952
*
953-
* @return Message
953+
* @return null|Message
954954
* @throws Exceptions\ConnectionFailedException
955955
* @throws InvalidMessageDateException
956956
*/
@@ -964,6 +964,7 @@ public function moveToFolder($mailbox = 'INBOX', $expunge = false, $create_folde
964964
$status = imap_mail_move($this->client->getConnection(), $this->uid, $mailbox, IMAP::CP_UID);
965965
if($status === true){
966966
if($expunge) $this->client->expunge();
967+
$this->client->openFolder($target_folder);
967968

968969
return $target_folder->getMessage($target_status->uidnext);
969970
}

0 commit comments

Comments
 (0)