<(common.inc.plp)><:
-if ($Request and $Request =~ s{^edit/?}{}) {
- Include 'writer.plp';
- exit;
+our $lang = $get{lang} || 'en';
+our $wordlistbase = "data/wordlist.$lang";
+
+if ($Request and $Request =~ m{\A([^/]+)}) {
+ my $page = "word/$1.plp";
+ utf8::downgrade($page); # unicode filename breaks contents encoding
+ if (-e $page) {
+ Include $page;
+ exit;
+ }
}
-my $lang = $get{lang} || 'en';
-my $wordlist = "data/wordlist.$lang.inc.pl";
+my $wordlist = "$wordlistbase.inc.pl";
my $limit = $get{v} // (exists $get{v} ? 4 : 3);
Html({
say '<ul>';
for my $row (@_) {
my ($id, $level, $title) = split /:/, $row, 3;
+ $id or die "empty reference"; # assertion to prevent loops
my @type;
push @type, 'parent' if defined $table->{$id};
push @type, 'large' if $level =~ s/c$//;