Commit Graph

2121 Commits

Author SHA1 Message Date
Alex Schroeder
30e5828b40 calendar.pl: allow previous and next month
Stefan Kamphausen provided a reason for liking the deprecated cal3
extension: he likes cal3 because it also displays the next and
previous month as opposed to calendar.pl which only displays the
current month.

This commit allows users to get the same behaviour by setting
$CalendarOnEveryPage to values greater than 1: 1 shows the current
month on every page, but 2 shows the previous and the current month on
every page, and 3 shows the previous, the current and the next month
on every page.
2016-08-31 13:44:07 +02:00
Alex Schroeder
07947e3d48 Merge branch 'master' of github.com:kensanata/oddmuse 2016-08-26 13:50:13 +02:00
Alex Schroeder
24377a8cb9 Changed nearly remaining code from GPLv2 to GPLv3
There were some files that did not offer "or (at your option) any later
version" in their license and these had to be left alone. This should
solve the incorrect FSF address issue #4 on GitHub.
2016-08-16 18:01:26 +02:00
Alex Schroeder
d2db3d849e Fixed erroneous edits from previous commit
The keyboard macro did not deal kindly with two files... This should
address comments by @m4z for the incorrect FSF address issue #4 on
GitHub.
2016-08-16 16:43:21 +02:00
Alex Schroeder
12fe760cd0 Changed nearly all modules from GPLv2 to GPLv3
There were some modules that did not offer "or (at your option) any
later version" in their license and these had to be left alone.
This should solve the incorrect FSF address issue #4 on GitHub.
2016-08-16 15:04:47 +02:00
Alex Schroeder
51950f7fbf namespaces.pl: more changes to get it working
Encoding of namespace and page name under Mojolicious is not OK and I
don't know why. I added some tests that try to at least prove that the
workaround in the config file is OK.
2016-08-11 17:14:14 +02:00
Alex Schroeder
c0b92664d6 Revert "NamespacesInitVariables not decoding path_info"
This reverts commit 5fce7f4b63.

Same as the previous revert for wiki.pl.
2016-08-11 14:20:45 +02:00
Alex Schroeder
384ba6396e banned-regexps.pl: exclude urls 2016-08-08 11:31:06 +02:00
Alex Schroeder
c761a85d31 upload.pl: fix meta.t complaint 2016-08-08 11:30:27 +02:00
Alex Schroeder
6de51bee7f ban-contributors.pl: rely on inetnum 2016-08-05 12:24:36 +02:00
Alex Schroeder
45246af50c translations: updated with new strings 2016-08-02 11:55:39 +02:00
Alex Schroeder
ab3db4e36e german-utf8.pl: updated 2016-08-02 11:54:15 +02:00
Alex Schroeder
3b3c975a69 sort.pl: delete trailing whitespace 2016-08-02 11:49:41 +02:00
Alex Schroeder
6742ac38e2 sort.pl: be more explicit about the sorting
Clearly print how the result is sorted right now.
2016-08-02 11:48:17 +02:00
Alex Schroeder
48cf9f941a sort.pl: Offer link to sort alphabetically
Don't show the link to the current sort order.
2016-08-02 11:43:08 +02:00
Alex Schroeder
d01b5e1460 Skip pages that no longer exist 2016-08-02 11:38:44 +02:00
Alex Schroeder
f2c00d02a6 creationdate.pl: fix typo 2016-08-02 11:26:02 +02:00
Alex Schroeder
d87302f74f creationdate.pl: now with admin menu to add dates
This is done by parsing rc.log files and adding the information to the
page database.
2016-08-02 11:21:38 +02:00
Alex Schroeder
fe217ea2d5 sort.pl: new module to sort search results 2016-08-02 10:58:37 +02:00
Alex Schroeder
a22117dd12 ban-contributors: switch to Net::Whois::Parser
This one is available in a Debian package.
2016-07-27 12:51:47 +02:00
Alex Schroeder
ad7e83b8fb ban-contributors: fixed failing meta.t tests 2016-07-26 09:37:20 +02:00
Alex Schroeder
2c6f0f0c59 ban-contributors: better regexp
Now able to handle the range 77.56.180.0 - 77.57.70.255.
2016-07-26 09:25:58 +02:00
Alex Schroeder
524dda2e64 Document the number range being banned 2016-07-26 09:10:22 +02:00
Alex Schroeder
80f7c0eea8 ban-contributors.pl now with Net::Whois::IP
We use a whois query to suggest a regular expression that bans the
entire network, not just a single IP.
2016-07-25 15:37:34 +02:00
Alex Schroeder
7ad11d3520 NamespacesInitVariables not decoding path_info
On a new server with Debian Jessie (8), Apache 2.4, Perl 5.25.1 and CGI
4.28 I'm getting double-decoded namespaces. An Umlaut will thus turn
into an undisplayable character (a questionmark in a black diamond).
Decoding of path_info was necessary on my old server with Debian
Wheezy (7), Apache 2.2, Perl 5.14.2 and CGI 3.52.

If you're still in the unfortunate situation, you can copy the old
implementation of NamespacesInitVariables into your config file.
2016-07-25 09:03:33 +02:00
Alex Schroeder
ef7c5a2f10 translation-links.pl: prevent spam from saving
When using banned-regexps.pl, we want to ban certain pages from getting
created. This only works if we test source and target page for spam.
2016-07-09 00:03:18 +02:00
Alex Schroeder
7c9a1c60d4 Get rid of -r 2016-06-27 12:05:37 +02:00
Alex Schroeder
fd18de2b9e Fix issues discovered by meta.t 2016-06-23 00:34:56 +02:00
Alex Schroeder
2588e5e835 toc.pl: use ToString and don't double-decode
ToString now takes more arguments.
2016-06-22 16:24:07 +02:00
Alex Schroeder
678baec68b Moving modules from utf8::encode to encode_utf8 2016-06-22 15:37:04 +02:00
Alex Schroeder
47de199dd5 Moving from utf8::encode to encode_utf8 2016-06-22 14:43:28 +02:00
Alex Schroeder
7ca2d5eb3b Changing $foo/$bar to "$foo/$bar"
Why did this not cause a syntax error?
2016-06-19 15:56:34 +02:00
Alex Schroeder
cd14410ed2 latex.pl: Globbing nil requires double quotes to work 2016-06-19 15:55:46 +02:00
Alex Schroeder
e7b7aec76f opendir also requires bytes 2016-06-19 15:55:03 +02:00
Alex Schroeder
94b8a1c4d8 All open and tie calls need utf8::encode 2016-06-19 13:51:11 +02:00
Alex Schroeder
d30f701266 bsd_glob replaced with Glob 2016-06-19 11:55:58 +02:00
Alex Schroeder
116f1d1fcb tags.pl: Storable also needs bytes in filename 2016-06-19 00:10:39 +02:00
Alex Schroeder
46cb69a6c3 Use helper functions for accessing the file system
As we derive a lot of filenames from strings in UTF-8 encoded files, we
need to make sure that any filename that might might be set by a user –
including all the filenames containing a directory deriving from
$DataDir – are passed through utf8::encode. That is, every character
gets replaced with a sequence of one or more characters that represent
the individual bytes of the character and the UTF8 flag is turned off.

In other words, -d $DataDir might not work if $DataDir contains a UTF-8
encoded string. The solution is to use the following replacements:

-f $name            IsFile($name)
-e $name            IsFile($name)
-d $name            IsDir($name)
(stat($name))[9]    Modified($name)
-M $name            $Now - Modified($name)
-z $name            ZeroSize($name)
unlink $name        Unlink($name)
mkdir $name         CreateDir($name)
rmdir $name         RemoveDir($name)

(Using IsFile for -e is probably not ideal?)

If you don’t, and Oddmuse gets used with Mojolicious, and you use the
Namespaces Extension, and a namespace contains non-ASCII characters such
as ä, ö, or ü, these characters will end up as part of $DataDir and
trigger the problem.

I also wonder whether we should be using some other Perl library.
2016-06-17 14:49:34 +02:00
Alex Schroeder
5a5e293e2d Simplify namespaces.pl initialization 2016-06-12 21:24:43 +02:00
Alex Schroeder
2009e65944 Fix typo: substring → substr 2016-06-05 18:00:01 +02:00
Alex Schroeder
7a0f48ccaf Add Spanish national days 2016-05-28 13:58:57 +02:00
Alex Schroeder
e2ae0b38d6 load-lang.pl: Fix code and add test
If you're accept-language settings included something for which no file
exists (such as "de-ch"), then the test for the file would
succeed (testing for the existence of "$LoadLanguageDir/") even though
no actual file will be loaded. This is fixed. Also: implemented actual
testing.
2016-05-28 09:30:59 +02:00
Alex Schroeder
10346e8f55 static-copy.pl: Fix non-ascii links
It seems like it is operating on url-encoded strings, so all we have to
do is to decode it. This, however, does not mean that we should print
decoded strings. ‘href’ attribute still has to be encoded (or so it seems).
2016-02-02 20:22:06 +02:00
Alex Schroeder
d5053f8f3e load-lang.pl: Add Estonian translation 2015-12-30 15:45:41 +02:00
Alex Schroeder
0978882383 Estonian translation 2015-12-30 15:11:57 +02:00
Alex Schroeder
bc3ec732bf typo 2015-11-29 10:25:15 +01:00
Alex Schroeder
adb7430573 supplementing the German transltion 2015-11-29 10:10:47 +01:00
Alex Schroeder
c9557736a2 nosearch.pl: code style
It seems like oddtrans does not pick up the strings with double quotes?
It's weird, but it does not matter anyway, because we will switch to gettext
sooner or later.
2015-10-31 02:58:00 +02:00
Alex Schroeder
3d38db2ae6 Updates to Russian translation (70% → 85%) 2015-10-31 02:56:39 +02:00
Alex Schroeder
a99959e0cc Full support for arrayref in $StyleSheet 2015-10-26 01:03:42 +02:00