MediaWiki
REL1_32
styleTest.css.php
Go to the documentation of this file.
1
<?php
26
// This file doesn't run as part of MediaWiki
27
// phpcs:disable MediaWiki.Usage.SuperGlobalsUsage.SuperGlobals
28
29
header(
'Content-Type: text/css; charset=utf-8'
);
30
39
function
cssfilter
( $val ) {
40
return
preg_replace(
'/[^A-Za-z0-9\.\- #]/'
,
''
, $val );
41
}
42
43
// Do basic sanitization
44
$params
= array_map(
'cssfilter'
, $_GET );
45
46
// Defaults
47
$selector
=
$params
[
'selector'
] ??
'.mw-test-example'
;
48
$property
=
$params
[
'prop'
] ??
'float'
;
49
$value
=
$params
[
'val'
] ??
'right'
;
50
$wait
= isset(
$params
[
'wait'
] ) ? (int)
$params
[
'wait'
] : 0;
// seconds
51
52
sleep(
$wait
);
53
54
$css
=
"
60
$selector {
61
$property: $value;
62
}
63
";
64
65
echo trim(
$css
) .
"\n"
;
$value
$value
Definition
styleTest.css.php:49
$wait
$wait
Definition
styleTest.css.php:50
$selector
$selector
Definition
styleTest.css.php:47
$css
$css
Definition
styleTest.css.php:54
cssfilter
cssfilter( $val)
Allows characters in ranges [a-z], [A-Z] and [0-9], in addition to a dot ("."), dash ("-"),...
Definition
styleTest.css.php:39
$property
$property
Definition
styleTest.css.php:48
$params
$params
Definition
styleTest.css.php:44
tests
qunit
data
styleTest.css.php
Generated on Mon Nov 25 2024 15:59:06 for MediaWiki by
1.10.0