MediaWiki REL1_35
UploadStashException.php
Go to the documentation of this file.
1<?php
29 protected $messageSpec;
30
37 public function __construct( $messageSpec, $code = 0, Throwable $previous = null ) {
38 $this->messageSpec = $messageSpec;
39
40 $msg = $this->getMessageObject()->text();
41 $msg = preg_replace( '!</?(var|kbd|samp|code)>!', '"', $msg );
42 $msg = Sanitizer::stripAllTags( $msg );
43 parent::__construct( $msg, $code, $previous );
44 }
45
46 public function getMessageObject() {
47 return Message::newFromSpecifier( $this->messageSpec );
48 }
49}
MediaWiki exception.
static newFromSpecifier( $value)
Transform a MessageSpecifier or a primitive value used interchangeably with specifiers (a message key...
Definition Message.php:452
string array MessageSpecifier $messageSpec
getMessageObject()
Return a Message object for this exception.
__construct( $messageSpec, $code=0, Throwable $previous=null)
Interface for MediaWiki-localized exceptions.
Stable for implementing.