MediaWiki master
UploadStashException.php
Go to the documentation of this file.
1<?php
22
27class UploadStashException extends RuntimeException implements ILocalizedException {
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}
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.