MediaWiki master
UploadStashException.php
Go to the documentation of this file.
1<?php
23
28class UploadStashException extends RuntimeException implements ILocalizedException {
30 protected $messageSpec;
31
38 public function __construct( $messageSpec, $code = 0, Throwable $previous = null ) {
39 $this->messageSpec = $messageSpec;
40
41 $msg = $this->getMessageObject()->text();
42 $msg = preg_replace( '!</?(var|kbd|samp|code)>!', '"', $msg );
43 $msg = Sanitizer::stripAllTags( $msg );
44 parent::__construct( $msg, $code, $previous );
45 }
46
47 public function getMessageObject() {
48 return Message::newFromSpecifier( $this->messageSpec );
49 }
50}
The Message class deals with fetching and processing of interface message into a variety of formats.
Definition Message.php:158
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.