Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4097178
styleTest.css.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
895 B
Referenced Files
None
Subscribers
None
styleTest.css.php
View Options
<?php
/**
* Dynamically create a simple stylesheet for unit tests in MediaWiki.
*
* @license GPL-2.0-or-later
* @file
*/
// This file doesn't run as part of MediaWiki
// phpcs:disable MediaWiki.Usage.SuperGlobalsUsage.SuperGlobals
header
(
'Cache-Control: private, no-cache, must-revalidate'
);
header
(
'Content-Type: text/css; charset=utf-8'
);
// Do basic sanitization
$params
=
array_map
(
static
function
(
$val
)
{
return
is_string
(
$val
)
?
preg_replace
(
'/[^A-Za-z0-9
\.\-
#]/'
,
''
,
$val
)
:
null
;
},
$_GET
);
// Defaults
$selector
=
$params
[
'selector'
]
??
'.mw-test-example'
;
$property
=
$params
[
'prop'
]
??
'float'
;
$value
=
$params
[
'val'
]
??
'right'
;
$wait
=
isset
(
$params
[
'wait'
]
)
?
(
int
)
$params
[
'wait'
]
:
0
;
// seconds
sleep
(
$wait
);
$css
=
"
/**
* Generated "
.
gmdate
(
'r'
)
.
".
* Waited {$wait}s.
*/
$selector {
$property: $value;
}
"
;
echo
trim
(
$css
)
.
"
\n
"
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 14:43 (3 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1c/89/66859e4c4a5cc8d371a35e370b6a
Default Alt Text
styleTest.css.php (895 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment