A long time ago, $NewComment was the default text for the comment form,
ie. aftertext. That's why the code still had some comparisons of
aftertext with $NewComment. Now that $NewComment is a label in the
comment form and no longer the content of the text area, these tests can
be removed.
To facilitate future debugging, STDERR now also gets the UTF-8 layer.
Apparently CGI does not decode UTF-8 encoded URL parameters. Handle this
case in GetParam.
PageHtml can be called when STDOUT already has the UTF-8 layer. It needs
to be able to handle both cases. That's why we call binmode without any
layers and then we call binmode with the UTF-8 layer again. Now it will
work for RSS files as well.
Unrelated fix: In order to force a decent Etag header even if no index
file exists (and thus $LastUpdate is undef), we use $Now as an
alternative.
binmode adding utf8 layer to STDOUT resulted in double encoded pages
included via PageHtml. On my homepage I was appending the comments to
every page using the following code:
my $target = $CommentsPrefix . $id;
my $page = '';
$page = PageHtml($target) if $IndexHash{$target};
print $q->div({-class=>'comment'},
$q->h2(T('Comments')),
$page);
Previously, if calling GetHeader with 'nocache', this would get passed
on to GetHttpHeader as $ts. The code would then produce an etag header
with a value of 'nocache'. This is now fixed. A long comment now
explains how it is supposed to work to reduce confusion in the future.
This option should allow automatic encoding and decoding of
parameters. This saves a few lines and solves an encoding error:
previously, searching for a text containing non-ASCII characters would
result in double-encoded text fields.
It turns out that one of the tests in lock.t relied on the exact wording
of the error message. I decided to use the same wording for all
instances: "Editing not allowed: %s is read-only" and no longer using
"Editing not allowed for %s".
Closes bug #41625 "ban-quick-editors.pl can hide the error message".
DoPost now uses the same code as DoEdit and thus it will display the
error message, which solves the issue for ban-quick-editors.pl. Added a
test to demonstrate it.
The prepare target didn't handle wiki.pl itself correctly. This has been
fixed. The command to add the git tag was changed from sed to perl, like
for the other targets. As emoji.pl and smiles.pl refer to permanent
anchors, the addition of the anchor parameter to AddModuleDescription
was obviously misguided and I reverted it.
The Makefile didn't add tag information for translation files when
running 'make prepare'. This has been fixed. As we cannot have a slash
in the file name, as slashes get escaped in UrlEncode, a new parameter
was added to AddModuleDescription and the Makefile will now set this
parameter for translation files such that the source link will point to
the correct directory ("translations/").
This makes sure that "make prepare" works once again by allowing an
optional argument to AddModuleDescription with the tag.
AddModuleDescription now also takes an optional anchor which is used by
emoji.pl and smiles.pl.
This commit also updates all the translation files and makes sure that
they all use AddModuleDescription.
The commit "RcHtml: fix generating More... links" introduced a bug. The
first page after clicking a More... link was the default page again. The
computation of the new FROM parameter wasn't working when neither UPTO
nor DAYS was set (as is the case when you look at the default Recent
Changes). A simple defaulting to $RcDefault did the trick.
This applies to the calls of diff and diff3. -- is required to
indicate the end of command line arguments, so that filenames that
start with dashes will not cause any trouble. Of course, since no one
will ever set his $TempDir to something like that, it is not critical.
OpenHtmlEnvironment now accepts fourth parameter that defines similar
tags.
creole.pl now passes 'ol|ul' as fourth parameter to OpenHtmlEnvironment.
In addition to that, the creole.pl code was refactored a little bit to
remove copy-pasted part.
When using days for RecentChanges, the More... links after the first
one reverted to $RcDefault instead of keeping the same time period.
This is now fixed.
If you set 0 as the number of entries for More... pages, the More...
button will be disabled completely (e.g. <journal 3,0> to show only 3
entries without giving a link to other pages).
You can specify initial offset by using journal:OFFSET (e.g. <journal:3
5 "News_\d+"> will skip first three news pages).
The :OFFSET syntax might be confusing, but it is quite easy to remember:
in bash ${arr:3:5} will get five elements of array arr starting with the
third index (fourth element, thus the offset is 3). Therefore, to make
it even more confusing, it is now possible to write previous example as
<journal:3:5 "News_\d+">.
Now you can use <titles> to get links without displaying the contents.
It accepts exactly the same arguments as <journal>. For example
<titles:3 5 "News_\d+">.
In some recent versions of Perl such as v5.18.0, when $foo is undef,
utf8::decode($foo) modifies $foo to '' (defined null string). This
causes problems. When the Preview button is clicked, for example, a
nomal page is shown instead of the preview, because of this. Thus, we
need to avoid calling utf8::decode on undefined value.
Previously, the pageidx file contained the serialized hash. If we had
two pages A and B, it contained A 1 B 1. When you install this version,
your wiki will report extra pages of "1" until you delete your pageidx
file, or until you create a new page (which will delete your pageidx
file).
If you looked at an URL like the following, you wouldn't know which
items referred to minor changes and which didn't. They all looked the
same.
http://localhost/cgi-bin/wiki.pl?action=rc;showedit=1;raw=1
This change adds "minor: 1" to items caused by minor changes, and
oddmuse-curl.el (the Oddmuse Mode for Emacs), handles this.