Forgot this, needed with r36153
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 10 Jun 2008 15:38:13 +0000 (15:38 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 10 Jun 2008 15:38:13 +0000 (15:38 +0000)
includes/Status.php

index ed1455c..185ea6e 100644 (file)
@@ -179,4 +179,16 @@ class Status {
                }
                return $result;
        }
+
+       /**
+        * Returns true if the specified message is present as a warning or error
+        */
+       function hasMessage( $msg ) {
+               foreach ( $this->errors as $error ) {
+                       if ( $error['message'] === $msg ) {
+                               return true;
+                       }
+               }
+               return false;
+       }
 }