Commit b9d339a1 authored by IKEDA Soji's avatar IKEDA Soji
Browse files

Followup to PR #427 d74b70bb:

Copying timestamp of original css.tt2 confuses browser cache.  Older timestamp of css.tt2 should be avoided by measures in release and install process.
parent d74b70bb
......@@ -1861,6 +1861,20 @@ sub upgrade {
}
}
# Clean style sheets with earlier timestamp so that they will be recreated
# with recent timestamp.
if (lower_version($previous_version, '6.2.41b.1')
and not lower_version($previous_version, '6.2.26')) {
if ($Conf::Conf{'css_path'} and -d $Conf::Conf{'css_path'}) {
my @robot_ids = Sympa::List::get_robots();
foreach my $robot_id (@robot_ids) {
my $dir = $Conf::Conf{'css_path'} . '/' . $robot_id;
next unless -e $dir . '/style.css';
unlink $dir . '/style.css';
}
}
}
return 1;
}
......
......@@ -790,7 +790,7 @@ sub _get_css_url {
} elsif (
(exists $hash{$lang || '_main'})
? ($hash{$lang || '_main'} eq $hash)
: ($template_mtime == Sympa::Tools::File::get_mtime($path))
: ($template_mtime < Sympa::Tools::File::get_mtime($path))
) {
return ($url, $hash);
}
......@@ -894,8 +894,6 @@ sub _get_css_url {
return;
}
# Set mtime of source template to detect update of it.
utime $template_mtime, $template_mtime, $path;
return ($url, $hash);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment