dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
e99524c
)
Merge "Log when Message::__toString has an unexpected format"
author
jenkins-bot
<jenkins-bot@gerrit.wikimedia.org>
Fri, 23 Sep 2016 15:18:12 +0000
(15:18 +0000)
committer
Gerrit Code Review
<gerrit@wikimedia.org>
Fri, 23 Sep 2016 15:18:12 +0000
(15:18 +0000)
includes/Message.php
patch
|
blob
|
history
diff --git
a/includes/Message.php
b/includes/Message.php
index
c2c954a
..
c1a12aa
100644
(file)
--- a/
includes/Message.php
+++ b/
includes/Message.php
@@
-852,6
+852,12
@@
class Message implements MessageSpecifier, Serializable {
* @return string
*/
public function __toString() {
+ if ( $this->format !== 'parse' ) {
+ $ex = new LogicException( __METHOD__ . ' using implicit format: ' . $this->format );
+ \MediaWiki\Logger\LoggerFactory::getInstance( 'message-format' )->warning(
+ $ex->getMessage(), [ 'exception' => $ex, 'format' => $this->format, 'key' => $this->key ] );
+ }
+
// PHP doesn't allow __toString to throw exceptions and will
// trigger a fatal error if it does. So, catch any exceptions.