Commit Graph

20 Commits

Author SHA1 Message Date
Alex Schroeder
f230a64e7d 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
032c7aea73 bsd_glob replaced with Glob 2016-06-19 11:55:58 +02:00
Alex Schroeder
83f13a9a1a 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
58e9a1e240 use v5.10 everywhere + enabled test in meta.t 2015-08-18 10:48:03 +02:00
Alex Schroeder
7e27af5998 not-found-handler.pl passes perl -c
ToString needs parenthesis.
2015-07-03 14:33:24 +02:00
Aleks-Daniel Jakimenko
f782691e7e UTF-8, again! Also, new ToString sub. 2015-05-17 03:35:35 +03:00
Aleks-Daniel Jakimenko
40ec24349a No more "*Sub = *NewSub", \&NewSub used instead. (Partial progress) 2015-04-11 23:41:33 +03:00
Aleks-Daniel Jakimenko
6f8d281d79 No more "use vars"! 2015-04-10 13:31:28 +03:00
Aleks-Daniel Jakimenko
24f0590f7c not-found-handler.pl uses strict 2015-03-29 18:45:14 +03:00
Aleks-Daniel Jakimenko
4492ede096 "use strict;" in modules (some modules have problems) 2015-03-27 03:01:01 +02:00
Alex Schroeder
5aba2ae56f Fixed typo in AddModuleDescription sub name 2014-08-21 22:23:23 +02:00
Alex Jakimenko
ee932dee37 Automatically reformatted modules 2014-08-21 07:29:46 +03:00
Alex Schroeder
7ca0f6172b Use bsd_glob instead of glob.
Glob will split patterns on whitespace and non-breaking spaces are now
treated as whitespace.
2012-07-21 00:40:42 +02:00
Alex Schroeder
f11e2a8731 getting rid of $Id$ tags in $WikiDescription
Replaced the $Id$ tags in $WikiDescription for all the modules and wiki.pl itself with a link to the source and an appropriate wiki page, if possible. This is shown in action=version and should help users figure out what another wiki has installed.
2012-04-19 02:18:45 +02:00
Alex Schroeder
b4eccdb413 (WriteLinkDb): Removed lock.
(DoLinkDb): Added Lock.
(RefreshLinkDb): Rewrite.  It was full of bugs.
(NewNotFoundHandlerSave): Rewrite.
(NotFoundHandlerCacheUpdate): Rewrite.
2004-06-26 00:00:31 +00:00
Alex Schroeder
62eb8db787 ($LinkFile, %LinkDb): New variables.
(ReadLinkDb, WriteLinkDb, RefreshLinkDb): New.
(DoClearCache, DoLinkDb): New.
(NewNotFoundHandlerDoMaintain): Deleted.
(NewNotFoundHandlerSave): Use the new functionality.
Major rewrite using a link database!
2004-06-13 14:46:50 +00:00
Alex Schroeder
9332f5b81f (NewNotFoundHandlerDeletePage): Deleted again.
(NewNotFoundHandlerDoMaintain): New function.
2004-06-12 11:40:06 +00:00
Alex Schroeder
93c7bd0892 (NewNotFoundHandlerDeletePage, NewNotFoundHandlerSave): Delete
both the page, and the page with language extension due to content
negotiation, ie. PageName.en, PageName.de, etc.
2004-06-12 11:31:04 +00:00
Alex Schroeder
d8f142ea50 (NewNotFoundHandlerDeletePage): New
function to delete cached copies of pages that are deleted.
2004-06-12 11:27:27 +00:00
Alex Schroeder
d7a125ea53 New. 2004-06-05 00:31:23 +00:00