Commit Graph

26 Commits

Author SHA1 Message Date
Alex Schroeder
89fa22d1c9 Introducing @MyFormChanges
GetEditForm and GetCommentForm will now call all the subs in
@FormChanges in order to let them change the generated HTML. This is
used by all the modules that used to hook into either of these two
functions.

A typical change from questionasker.pl:

push(@MyFormChanges, \&QuestionAddTo);

sub QuestionAddTo {
  my ($form, $type, $upload) = @_;
  if (not $upload
      and not QuestionaskerException(GetId())
      and not $QuestionaskerRememberAnswer && GetParam($QuestionaskerSecretKey, 0)
      and not UserIsEditor()) {
    my $question = QuestionaskerGetQuestion();
    $form =~ s/(.*)<p>(.*?)<label for="username">/$1$question<p>$2<label for="username">/;
  }
  return $form;
}

This commit als moves from &$foo to $foo->() based on a recommendation
in Modern Perl by Conway.
2015-08-18 11:11:13 +02:00
Alex Schroeder
58e9a1e240 use v5.10 everywhere + enabled test in meta.t 2015-08-18 10:48:03 +02:00
Alex Schroeder
bd39fe5d38 recaptcha.pl: same fix as questionasker.pl
We need to replace the old reference in @MyFooters with the new code
reference.
2015-08-18 09:44:43 +02:00
Aleks-Daniel Jakimenko
6ccf5b7c14 Getting rid of %InvisibleCookieParameters
This is no longer required because we don't print cookies nowadays.
2015-08-08 03:40:23 +03:00
Alex Schroeder
823f518615 Replace GetRemoteHost with $q->remote_addr() 2015-07-31 09:35:51 +02:00
Aleks-Daniel Jakimenko
f993903c8c Revert changes in modules/recaptcha.pl, I did not mean this 2015-07-15 01:07:54 +03:00
Aleks-Daniel Jakimenko
a5ecd94393 File BUGS is deleted.
According to "git blame BUGS" all these bug reports are more than 10 years old.
2015-07-15 01:04:54 +03:00
Aleks-Daniel Jakimenko
df87ff82c3 No more redundant 'package OddMuse;' 2015-04-27 17:41:59 +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
Alex Schroeder
cfc811c2e0 recaptcha.pl uses strict
Same fix as for gd_security_image.pl.
2015-03-29 17:53:08 +02: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
f276ae6469 Don't store host names.
Get rid of the option $UseLookup. Remove GetRemoteHost and rename
GetRemoteAddress to GetRemoteHost. Thus, it now returns IP number only.
2014-07-11 19:09:33 +02:00
Alex Schroeder
53566c8434 Use a function instead of $ENV{REMOTE_ADDR}
When the webserver is behind a reverse proxy, $ENV{REMOTE_ADDR} is not
the actual remote client's address but the reverse proxy's address. The
actual remote client's address is available from an environment
variable. The name of this variable depends on the proxy, e.g. pound
uses $ENV{HTTP_X_FORWARDED_FOR}.

As suggested by tyatsumi on the wiki, all access $ENV{REMOTE_ADDR} now
happens via a new function which allows users to override it in their
config file.
2014-06-16 09:50:05 +02:00
Alex Schroeder
1ebc5192ff ReCAPTCHA introduced HTML escaping problems. 2013-10-20 20:27:12 +02:00
Alex Schroeder
4504ef43ac Avoid the use of $q->hidden() and use $q->input and GetParam() instead. 2013-10-09 23:09:47 +02:00
Alex Schroeder
cd2b4d624e Remove $HttpCharset and moved everything to UTF-8
This also required some changes to the tests where explicit UTF-8
encoding had been used in the past.
2012-05-22 11:50:23 +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
Brian Curry
c0d70cb033 * modules/recaptcha.pl (ReCaptchaQuestionAddTo): Patched with a
Wiki-provided correction, courtesy Bayle Shanks. Apparently, the
previous regular expression in this function failed to match the
Comment form's HTML. This patch corrects that! The reCAPTCHA widget
is now properly displayed by both the Comment and Edit forms.
Thanks, Bayle. (http://bayleshanks.com)
2008-11-27 06:00:25 +00:00
Brian Curry
e3a1130301 (NewReCaptchaDoPost): Prevent display of the reCAPTCHA if an administrator. 2008-09-29 11:53:33 +00:00
Brian Curry
38a7d51350 * modules/recaptcha.pl: New perldoc-style documentation.
($ReCaptchaTheme): New option.
($ReCaptchaTabIndex): New option.
(ReCaptchaGetQuestionHtml): New function. Permits site-specific
customization of module-emitted HTML and CSS.
(ReCaptchaGetQuestion): Rewritten so as to leverage the two new options and
one new function.
2008-09-29 07:33:32 +00:00
Alex Schroeder
99015c87ff (NewReCaptchaDoPost): Prevent a preview
from setting the cookie analogous to the questionasker.pl edit
dated 2008-06-11.
2008-09-10 09:51:33 +00:00
Alex Schroeder
7424863587 (QuestionAddTo): Use $ReCaptchaSecretKey
instead of 'question'.
(NewReCaptchaDoPost, NewReCaptchaDoPost, ReCaptchaQuestionAddTo):
Renamed QuestionAddTo to ReCaptchaQuestionAddTo.
2008-09-06 13:07:12 +00:00
Brock Wilcox
e70fbb9913 Initial add of reCAPTCHA (http://recaptcha.net/) module. Works! 2008-03-06 04:49:42 +00:00