summaryrefslogtreecommitdiff
path: root/includes/Status.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
commit222b01f5169f1c7e69762e0e8904c24f78f71882 (patch)
tree8e932e12546bb991357ec48eb1638d1770be7a35 /includes/Status.php
parent00ab76a6b686e98a914afc1975812d2b1aaa7016 (diff)
update to MediaWiki 1.16.0
Diffstat (limited to 'includes/Status.php')
-rw-r--r--includes/Status.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/includes/Status.php b/includes/Status.php
index 185ea6e5..a07a4b81 100644
--- a/includes/Status.php
+++ b/includes/Status.php
@@ -84,6 +84,13 @@ class Status {
$this->ok = false;
}
+ /**
+ * Sanitize the callback parameter on wakeup, to avoid arbitrary execution.
+ */
+ function __wakeup() {
+ $this->cleanCallback = false;
+ }
+
protected function cleanParams( $params ) {
if ( !$this->cleanCallback ) {
return $params;
@@ -152,7 +159,7 @@ class Status {
if ( $longContext ) {
$s = wfMsgNoTrans( $longContext, $s );
} elseif ( $shortContext ) {
- $s = wfMsgNoTrans( $shortContext, "\n* $s\n" );
+ $s = wfMsgNoTrans( $shortContext, "\n$s\n" );
}
}
return $s;
@@ -170,12 +177,15 @@ class Status {
$this->successCount += $other->successCount;
$this->failCount += $other->failCount;
}
-
+
function getErrorsArray() {
$result = array();
foreach ( $this->errors as $error ) {
if ( $error['type'] == 'error' )
- $result[] = $error['message'];
+ if( $error['params'] )
+ $result[] = array_merge( array( $error['message'] ), $error['params'] );
+ else
+ $result[] = $error['message'];
}
return $result;
}