Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4145911
UrlInsertablesSuggester.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
721 B
Referenced Files
None
Subscribers
None
UrlInsertablesSuggester.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Extension\Translate\TranslatorInterface\Insertable
;
/**
* Suggester for URLs
* @author Jon Harald Søby
* @license GPL-2.0-or-later
* @since 2022.01
*/
class
UrlInsertablesSuggester
implements
InsertablesSuggester
{
/** @var InsertablesSuggester */
private
$suggester
;
public
function
__construct
()
{
$this
->
suggester
=
new
RegexInsertablesSuggester
(
[
'regex'
=>
'~(?<domain>(https?:)?//([
\w\-
]+
\.
)+[
\w\-
]{2,})(?<slug>(/[
\w\-
/_?&#$%()!?=.:]*|
\b
))?~'
,
'display'
=>
'$domain/'
,
'pre'
=>
'$domain$slug'
,
'post'
=>
''
,
]
);
}
public
function
getInsertables
(
string
$text
):
array
{
return
$this
->
suggester
->
getInsertables
(
$text
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 19 2026, 17:49 (5 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
08/61/dd58876359a5014a8353651b3fba
Default Alt Text
UrlInsertablesSuggester.php (721 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment