countries: move flag images into data/, ignore
[sheet.git] / browser.plp
index 7355aa721a505e3afe8b494dbae1924a5ef21632..04599d01b14377465b285b8b0df3b645e17e08c9 100644 (file)
@@ -16,12 +16,12 @@ Html({
                ie internet explorer firefox chrome safari webkit opera
        '],
        stylesheet => [qw'circus dark mono red light'],
-       data => ['browser-support.inc.pl'],
+       data => ['data/browser/support.inc.pl'],
 });
 
 say "<h1>Browser compatibility</h1>\n";
 
-my $caniuse = do 'browser-support.inc.pl' or die $! || $@;
+my $caniuse = do 'data/browser/support.inc.pl' or die $! || $@;
 $_->{verrelease} = {
        # mark last three (future) versions as unreleased, ensure current isn't
        map {
@@ -87,11 +87,11 @@ given ($get{usage} // 'wm') {
        when (!$_) {
                # none
        }
-       when (!/^[a-z][\w-]+$/) {
+       when (!m{ \A [a-z]\w+ (?:/\d[\d-]*\d)? \z }x) {
                printf "<p>Invalid browser usage data request: <em>%s</em>",
                        'identifier must be alphanumeric name or <q>0</q>';
        }
-       $canihas = do "browser-usage-$_.inc.pl" or do {
+       $canihas = do "data/browser/usage-$_.inc.pl" or do {
                printf "<p>Browser usage data not found: <em>%s</em>", $! || $@;
                break;
        };