Commit Graph

22 Commits

Author SHA1 Message Date
Alex Schroeder
a91ef8602f Moving modules from utf8::encode to encode_utf8 2016-06-22 15:37:04 +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
7d6138107f Translation: not deleted: without trailing space 2015-10-14 12:32:25 +02:00
Alex Schroeder
58e9a1e240 use v5.10 everywhere + enabled test in meta.t 2015-08-18 10:48:03 +02:00
Alex Schroeder
823f518615 Replace GetRemoteHost with $q->remote_addr() 2015-07-31 09:35:51 +02:00
Aleks-Daniel Jakimenko
6f8d281d79 No more "use vars"! 2015-04-10 13:31:28 +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
fe7a5e564a admin.pl: Get rid of CreatePageDir. 2014-06-23 12:54:39 +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
2f961a7b0b (AdminPower): Add class to menu entries and add
label for input field.
2006-08-06 11:44:55 +00:00
Alex Schroeder
41f9cb34f7 *** empty log message *** 2005-02-01 20:53:41 +00:00
Alex Schroeder
b4368ff476 Remove extra space in a text. 2005-02-01 20:48:09 +00:00
Alex Schroeder
e0cb925f48 (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
07da7a8b97 (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
00f520c98e (AdminPowerRename): Use FreeToNormal and
ValidOrDie to make sure no invalid filename can be used.
2004-09-20 23:49:02 +00:00
Sebastian Blatt
6005ad5a9c added missing closing parenthesis to modules/admin.pl 2004-07-16 01:02:02 +00:00
Alex Schroeder
0f8d0c2214 (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
2795e21ed8 (AdminPowerRename): Bugfix, test -f $newfname, not -f $new. 2004-05-29 20:51:34 +00:00
Alex Schroeder
59022e8f60 fixed lots of bugs 2004-05-26 00:43:56 +00:00
Alex Schroeder
c92cd663ea new 2004-05-25 23:51:07 +00:00