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
29header( 'Content-Type: text/css; charset=utf-8' );
30
39function 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
52sleep( $wait );
53
60$selector {
61 $property: $value;
62}
63";
64
65echo trim( $css ) . "\n";
$selector
cssfilter( $val)
Allows characters in ranges [a-z], [A-Z] and [0-9], in addition to a dot ("."), dash ("-"),...
$property
$params