mirror of https://github.com/aredn/aredn.git
check for .css file extension being passed
This commit is contained in:
parent
b8dcc50fb9
commit
09af80b17e
|
@ -61,6 +61,7 @@ sub html_header
|
||||||
print "<meta http-equiv='expires' content='0'>\n";
|
print "<meta http-equiv='expires' content='0'>\n";
|
||||||
print "<meta http-equiv='cache-control' content='no-cache'>\n";
|
print "<meta http-equiv='cache-control' content='no-cache'>\n";
|
||||||
print "<meta http-equiv='pragma' content='no-cache'>\n";
|
print "<meta http-equiv='pragma' content='no-cache'>\n";
|
||||||
|
# Prevent browser caching of the css file
|
||||||
my $rnum=`date +%s`;
|
my $rnum=`date +%s`;
|
||||||
chomp($rnum);
|
chomp($rnum);
|
||||||
print "<link id='stylesheet_css' rel=StyleSheet href='/style.css?", $rnum, "' type='text/css'>\n";
|
print "<link id='stylesheet_css' rel=StyleSheet href='/style.css?", $rnum, "' type='text/css'>\n";
|
||||||
|
|
|
@ -49,11 +49,14 @@ $config = "not set" if $config eq "" or not -d "/etc/config.$config";
|
||||||
read_postdata();
|
read_postdata();
|
||||||
|
|
||||||
# set up the style sheet
|
# set up the style sheet
|
||||||
system "rm -rf /www/style.css" if -f "/www/style.css"; # cleanup any actual file named style.css
|
mkdir "/tmp/web" unless -d "/tmp/web"; # make sure /tmp/web exists
|
||||||
system "ln -s /www/aredn.css /www/style.css" unless -l "/www/style.css";
|
# DO IN BUILD- unlink "/www/style.css" if -f "/www/style.css"; # cleanup any actual file named style.css in /www
|
||||||
|
# DO IN BUILD- symlink "/tmp/web/style.css","/www/style.css" unless -l "/www/style.css"; # fixed for web page
|
||||||
|
symlink "/www/aredn.css","/tmp/web/style.css" unless -l "/tmp/web/style.css"; # default to aredn.css
|
||||||
|
|
||||||
if($parms{css}) {
|
if($parms{css} and -f "/www/$parms{css}" and $parms{css} =~ /\.css$/i) {
|
||||||
system "ln -fs /www/$parms{css} /www/style.css" if -f "/www/$parms{css}";
|
unlink "/tmp/web/style.css";
|
||||||
|
symlink "/www/$parms{css}","/tmp/web/style.css";
|
||||||
}
|
}
|
||||||
|
|
||||||
# generate the page
|
# generate the page
|
||||||
|
|
Loading…
Reference in New Issue