MediaWiki
master
UploadStashException.php
Go to the documentation of this file.
1
<?php
21
use
MediaWiki\Message\Message
;
22
use
MediaWiki\Parser\Sanitizer
;
23
use
Wikimedia\Message\MessageSpecifier
;
24
29
class
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
}
MediaWiki\Message\Message
The Message class deals with fetching and processing of interface message into a variety of formats.
Definition
Message.php:150
MediaWiki\Parser\Sanitizer
HTML sanitizer for MediaWiki.
Definition
Sanitizer.php:46
UploadStashException
Definition
UploadStashException.php:29
UploadStashException\$messageSpec
string array MessageSpecifier $messageSpec
Definition
UploadStashException.php:31
UploadStashException\getMessageObject
getMessageObject()
Return a Message object for this exception.
Definition
UploadStashException.php:48
UploadStashException\__construct
__construct( $messageSpec, $code=0, Throwable $previous=null)
Definition
UploadStashException.php:39
ILocalizedException
Interface for MediaWiki-localized exceptions.
Definition
ILocalizedException.php:31
Wikimedia\Message\MessageSpecifier
Definition
MessageSpecifier.php:26
includes
upload
exception
UploadStashException.php
Generated on Mon Sep 16 2024 22:25:40 for MediaWiki by
1.10.0