return $this->mDisabled;
}
+ /**
+ * Whether this formatter can handle printing API errors. If this returns
+ * false, then on API errors the default printer will be instantiated.
+ * @since 1.23
+ * @return bool
+ */
+ public function canPrintErrors() {
+ return true;
+ }
+
/**
* Initialize the printer function and prepare the output headers, etc.
* This method must be the first outputting method during execution.
// identify requests to api.php
$text = preg_replace( '#^(\s*)(api\.php\?[^ <\n\t]+)$#m', '\1<a href="\2">\2</a>', $text );
if ( $this->mHelp ) {
- // make strings inside * bold
- $text = preg_replace( "#\\*[^<>\n]+\\*#", '<b>\\0</b>', $text );
+ // make lines inside * bold
+ $text = preg_replace( '#^(\s*)(\*[^<>\n]+\*)(\s*)$#m', '$1<b>$2</b>$3', $text );
}
// Armor links (bug 61362)
return true;
}
+ /**
+ * ChannelFeed doesn't give us a method to print errors in a friendly
+ * manner, so just punt errors to the default printer.
+ * @return false
+ */
+ public function canPrintErrors() {
+ return false;
+ }
+
/**
* This class expects the result data to be in a custom format set by self::setResult()
* $result['_feed'] - an instance of one of the $wgFeedClasses classes