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