MediaWiki master
UploadStashException.php
Go to the documentation of this file.
1<?php
24
29class UploadStashException extends RuntimeException implements ILocalizedException {
31 protected $messageSpec;
32
39 public function __construct( $messageSpec, $code = 0, Throwable $previous = null ) {
40 $this->messageSpec = $messageSpec;
41
42 $msg = $this->getMessageObject()->text();
43 $msg = preg_replace( '!</?(var|kbd|samp|code)>!', '"', $msg );
44 $msg = Sanitizer::stripAllTags( $msg );
45 parent::__construct( $msg, $code, $previous );
46 }
47
48 public function getMessageObject() {
49 return Message::newFromSpecifier( $this->messageSpec );
50 }
51}
The Message class deals with fetching and processing of interface message into a variety of formats.
Definition Message.php:150
HTML sanitizer for MediaWiki.
Definition Sanitizer.php:46
string array MessageSpecifier $messageSpec
getMessageObject()
Return a Message object for this exception.
__construct( $messageSpec, $code=0, Throwable $previous=null)
Interface for MediaWiki-localized exceptions.