[imp] concatenatederrormessages in imp/lib/Folder.php

Leena Heino Leena.Heino at uta.fi
Thu Nov 27 03:57:58 PST 2003


It seems that server's error message is concatenated to localized string,
therefore some errormessages look strange:
"The folder "x" was not created. This is what the server saidInvalid
mailbox name"

"The folder "x" was not created. This is what the server said" is the
localized part and "Invalid mailbox name" is the error message from
the server.

Attached to this mail is a patch to releng version that adds ': ' before
the server's error message.

Attached to this mail is a patch to head version that changes ' :' to
': '.

-- 
  Leena Heino              University of Tampere / Computer Centre
  ( liinu at uta.fi )      ( http://www.uta.fi/laitokset/tkk )
-------------- next part --------------
--- imp/lib/Folder.php.orig	Thu Nov  6 15:28:44 2003
+++ imp/lib/Folder.php	Thu Nov 27 13:42:29 2003
@@ -266,7 +266,7 @@
         foreach ($folder_array as $folder) {
             if (!imap_deletemailbox($stream, $server . $folder)) {
                 Horde::raiseMessage(sprintf(_("The folder \"%s\" was not deleted. This is what the server said"), IMP::displayFolder($folder)) .
-                                    imap_last_error(), HORDE_ERROR);
+                                    ': ' . imap_last_error(), HORDE_ERROR);
                 $return_value = false;
             } else {
                 if ($subscribe && in_array($server . $folder, $subscribed_folders) &&
@@ -312,7 +312,7 @@
         /* Attempt to create the mailbox */
         if (!imap_createmailbox($stream, IMP::serverString() . $folder)) {
             Horde::raiseMessage(sprintf(_("The folder \"%s\" was not created. This is what the server said"), IMP::displayFolder($folder)) .
-                            imap_last_error(), HORDE_ERROR);
+                            ': ' . imap_last_error(), HORDE_ERROR);
             return false;
         }
 
@@ -378,7 +378,7 @@
             return true;
         } else {
             Horde::raiseMessage(sprintf(_("Renaming \"%s\" to \"%s\" failed. This is what the server said"), IMP::displayFolder($old), IMP::displayFolder($new)) .
-                                imap_last_error(), HORDE_ERROR);
+                                ': ' . imap_last_error(), HORDE_ERROR);
             return false;
         }
     }
@@ -402,7 +402,7 @@
                 if ($folder != ' ') {
                     if (!imap_subscribe($stream, IMP::serverString() . $folder)) {
                         Horde::raiseMessage(sprintf(_("You were not subscribed to \"%s\". Here is what the server said"), IMP::displayFolder($folder)) .
-                                            imap_last_error(), HORDE_ERROR);
+                                            ': ' . imap_last_error(), HORDE_ERROR);
                         $return_value = false;
                     } else {
                         Horde::raiseMessage(sprintf(_("You were successfully subscribed to \"%s\""), IMP::displayFolder($folder)), HORDE_SUCCESS);
@@ -436,7 +436,7 @@
                 if ($folder != ' ') {
                     if (!imap_unsubscribe($stream, IMP::serverString() . $folder)) {
                         Horde::raiseMessage(sprintf(_("You were not unsubscribed from \"%s\". Here is what the server said"), IMP::displayFolder($folder)) .
-                                        imap_last_error(), HORDE_ERROR);
+                                        ': ' . imap_last_error(), HORDE_ERROR);
                         $return_value = false;
                     } else {
                         Horde::raiseMessage(sprintf(_("You were successfully unsubscribed from \"%s\""), IMP::displayFolder($folder)), HORDE_SUCCESS);
-------------- next part --------------
--- imp/lib/Folder.php.orig	Thu Nov  6 15:32:31 2003
+++ imp/lib/Folder.php	Thu Nov 27 13:54:58 2003
@@ -512,7 +512,7 @@
             return true;
         } else {
             $notification->push(sprintf(_("Renaming \"%s\" to \"%s\" failed. This is what the server said"), IMP::displayFolder($old), IMP::displayFolder($new)) .
-                                ' :' . imap_last_error(), 'horde.error');
+                                ': ' . imap_last_error(), 'horde.error');
             return false;
         }
     }


More information about the imp mailing list