Commit Graph

23 Commits

Author SHA1 Message Date
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
678baec68b Moving modules from utf8::encode to encode_utf8 2016-06-22 15:37:04 +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
bf559ed705 Translation: not deleted: without trailing space 2015-10-14 12:32:25 +02:00
Alex Schroeder
0ec8dd44e6 use v5.10 everywhere + enabled test in meta.t 2015-08-18 10:48:03 +02:00
Alex Schroeder
b39835331c Replace GetRemoteHost with $q->remote_addr() 2015-07-31 09:35:51 +02:00
Alex Schroeder
5d2db4b547 No more "use vars"! 2015-04-10 13:31:28 +03:00
Alex Schroeder
a4e0e5a9be "use strict;" in modules (some modules have problems) 2015-03-27 03:01:01 +02:00
Alex Schroeder
e6d3ad8382 Fixed typo in AddModuleDescription sub name 2014-08-21 22:23:23 +02:00
Alex Schroeder
17bd795ef0 Automatically reformatted modules 2014-08-21 07:29:46 +03:00
Alex Schroeder
1a19abd1c6 admin.pl: Get rid of CreatePageDir. 2014-06-23 12:54:39 +02:00
Alex Schroeder
c9e39a4c19 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
52f971fcef (AdminPower): Add class to menu entries and add
label for input field.
2006-08-06 11:44:55 +00:00
Alex Schroeder
def0dd3817 *** empty log message *** 2005-02-01 20:53:41 +00:00
Alex Schroeder
042cb83d1f Remove extra space in a text. 2005-02-01 20:48:09 +00:00
Alex Schroeder
805b1bf87e (AdminPowerRename): Add more tests because
ReportError will remove locks before exiting, unlink index file at
the beginning.
2005-01-24 17:00:58 +00:00
Alex Schroeder
f409f6e742 (AdminPowerDelete): Fix log message, unlink
$IndexFile.
(AdminPowerRename): Call FreeToNormal on both parameters, don't
test the new filename using ValidIdOrDie.
(NewAdminPowerGetAdminBar): Deleted.
(AdminPower): New, using @MyAdminCode.
2005-01-05 01:14:36 +00:00
Alex Schroeder
33381ecd9b (AdminPowerRename): Use FreeToNormal and
ValidOrDie to make sure no invalid filename can be used.
2004-09-20 23:49:02 +00:00
Alex Schroeder
738f36d83c added missing closing parenthesis to modules/admin.pl 2004-07-16 01:02:02 +00:00
Alex Schroeder
aa2b106d24 (AdminPowerDelete): Only write rc log when
delete was successful.  Depends on the change to DeletePage in
wiki.pl.
2004-06-12 11:24:57 +00:00
Alex Schroeder
d06510f12b (AdminPowerRename): Bugfix, test -f $newfname, not -f $new. 2004-05-29 20:51:34 +00:00
Alex Schroeder
765fd3c115 fixed lots of bugs 2004-05-26 00:43:56 +00:00
Alex Schroeder
ddd32d4629 new 2004-05-25 23:51:07 +00:00