Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7404026
ExpandToAbsoluteUrls.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
652 B
Referenced Files
None
Subscribers
None
ExpandToAbsoluteUrls.php
View Options
<?php
namespace
MediaWiki\OutputTransform\Stages
;
use
MediaWiki\Linker\Linker
;
use
MediaWiki\OutputTransform\ContentTextTransformStage
;
use
MediaWiki\Parser\ParserOptions
;
use
MediaWiki\Parser\ParserOutput
;
/**
* Expand relative links to absolute URLs
* @internal
*/
class
ExpandToAbsoluteUrls
extends
ContentTextTransformStage
{
public
function
shouldRun
(
ParserOutput
$po
,
?
ParserOptions
$popts
,
array
$options
=
[]
):
bool
{
return
$options
[
'absoluteURLs'
]
??
false
;
}
protected
function
transformText
(
string
$text
,
ParserOutput
$po
,
?
ParserOptions
$popts
,
array
&
$options
):
string
{
return
Linker
::
expandLocalLinks
(
$text
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 21, 18:56 (1 d, 12 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
5d/b6/a6b223d0c3fd55c6323bfb77bba3
Default Alt Text
ExpandToAbsoluteUrls.php (652 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment