-
Notifications
You must be signed in to change notification settings - Fork 3
/
skin.php
37 lines (30 loc) · 892 Bytes
/
skin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
header("Content-type: text/css");
$id = $_GET['widget_id'];
$id = clean($id);
$skin = $_GET['skin'];
$skin = clean($skin);
if(!empty($skin)){
$skin .= '.css';
$css = file_get_contents('./skins/' . $skin );
$widget_skin = preg_replace('/%ID%/',$id, $css);
echo $widget_skin;
}
?>
<?php
function clean($str = '', $html = false) {
if (empty($str)) return;
if (is_array($str)) {
foreach($str as $key => $value) $str[$key] = clean($value, $html);
} else {
if (get_magic_quotes_gpc()) $str = stripslashes($str);
if (is_array($html)) $str = strip_tags($str, implode('', $html));
elseif (preg_match('|<([a-z]+)>|i', $html)) $str = strip_tags($str, $html);
elseif ($html !== true) $str = strip_tags($str);
$str = trim($str);
$str = str_replace(".", "", $str);
$str = str_replace("/", "", $str);
}
return $str;
}
?>