8 Commits

Author SHA1 Message Date
Markus Lude
932fa71cb5 some preparations for 1.0.4: bump version 2016-10-25 19:43:21 +02:00
Markus Lude
e9341a3ee5 GetPageLockLink, GetAdminBar: move function to allow defered compilation again.
This was already broken in 1.0, possibly since addition of the AdminBar code.
missed in 027da87d33
2016-10-25 19:41:18 +02:00
Markus Lude
4364cd7da3 updated barnesandnoble.com search URL
noted by Oddmuse:FletcherPenny on Oddmuse:Comments_on_Usemod_Markup_Extension
2016-10-25 19:38:50 +02:00
Markus Lude
d71565c85b GetRc, GetRcRss, GetRssRcLine, EmailNotify: added some missing ScriptLinkChar()
instead of "?"
2016-10-25 19:37:25 +02:00
Markus Lude
1275491365 fixed bug: make GotoBars at top and bottom look the same on the edit page
the one at the top was lacking the main page when editing subpages
2016-10-25 19:35:52 +02:00
Markus Lude
027da87d33 GetPageLockLink, GetAdminBar: move function to allow defered compilation again.
This was already broken in 1.0, possibly since addition of the AdminBar code.
2016-10-25 19:34:28 +02:00
Markus Lude
730799f93d QuoteHtml: move function to allow defered compilation again.
This was broken with WikiPatches/XssFix (adding QuoteHtml to Ts/Tss calls)
2016-10-25 19:33:11 +02:00
Markus Lude
54bb8f0f22 fixed WikiBugs/NoDisplayFooterInActionLink
reported and fix contributed by JuanMtnezPineda (JuanmaMP)
2016-10-25 19:31:56 +02:00
5 changed files with 98 additions and 86 deletions

View File

@@ -1,18 +1,28 @@
Changes for bugfix release 1.0.4 (December 1, 2007):
* fixed bug NoDisplayFooterInActionLink
fix contributed by JuanMtnezPineda
* QuoteHtml, GetPageLockLink, GetAdminBar: move function to allow defered
compilation again
* fixed bug: make GotoBars at top and bottom look the same on the edit page
* added some missing ScriptLinkChar() instead of "?"
* updated barnesandnoble.com search URL
Changes for bugfix release 1.0.3 (September 12, 2007):
* fixed bug IntermapedGifNotInlinedForLink
* fixed bug AuthenicationFailedNoHeader
* fixed bug BacklinksMissesSomeFreeLinks
fix contributed by BrianHunter
* fix bug EmptyTableElements
* fixed bug EmptyTableElements
fix contributed by StefanTrcek
* fix bug MiscTranslation
* fixed bug MiscTranslation
fix contributed by JuanMtnezPineda
* added more translation strings
* DoRC: when using rcidonly text was quoted too much
noticed by CliffordAdams (bug was introduced with XssFix in 1.0.1)
* fix bug UrlEncoding
* fixed bug UrlEncoding
fix contributed by StefanTrcek
Changes for bugfix release 1.0.2 (August 26, 2007):

4
README
View File

@@ -1,5 +1,5 @@
README for UseModWiki 1.0.3
Last updated: September 12, 2007
README for UseModWiki 1.0.4
Last updated: December 1, 2007
Release notes:

4
config
View File

@@ -1,5 +1,5 @@
# == Configuration =======================================================
# Original version from UseModWiki 1.0.3
# Original version from UseModWiki 1.0.4
$CookieName = "Wiki"; # Name for this wiki (for multi-wiki sites)
$SiteName = "Wiki"; # Name of site (used for titles)
@@ -110,7 +110,7 @@ $BracketImg = 1; # 1 = [url url.gif] becomes image link, 0 = no img
# Names of sites. (The first entry is used for the number link.)
@IsbnNames = ('bn.com', 'amazon.com', 'search');
# Full URL of each site before the ISBN
@IsbnPre = ('http://shop.barnesandnoble.com/bookSearch/isbnInquiry.asp?isbn=',
@IsbnPre = ('http://search.barnesandnoble.com/booksearch/isbninquiry.asp?isbn=',
'http://www.amazon.com/exec/obidos/ISBN=',
'http://www.pricescan.com/books/BookDetail.asp?isbn=');
# Rest of URL of each site after the ISBN (usually '')

View File

@@ -91,6 +91,24 @@ Database is stored in temporary directory %s
Config file error:
Administration
Unlock page
Lock page
Delete this page
Edit Banned List
Run Maintenance
Edit/Rename pages
Unlock site
Lock site
Search:
Go!
@@ -487,24 +505,6 @@ Rename: old page %s does not exist--nothing done.
Displaying Wiki Version
Administration
Unlock page
Lock page
Delete this page
Edit Banned List
Run Maintenance
Edit/Rename pages
Unlock site
Lock site
Delete %s
Confirm deletion of %s by following this link:

124
wiki.pl
View File

@@ -1,5 +1,5 @@
#!/usr/bin/perl
# UseModWiki version 1.0.3 (September 12, 2007)
# UseModWiki version 1.0.4 (December 1, 2007)
# Copyright (C) 2000-2003 Clifford A. Adams <caadams@usemod.com>
# Copyright (C) 2002-2003 Sunir Shah <sunir@sunir.org>
# Based on the GPLed AtisWiki 0.3 (C) 1998 Markus Denker
@@ -179,7 +179,7 @@ $BracketImg = 1; # 1 = [url url.gif] becomes image link, 0 = no img
# Names of sites. (The first entry is used for the number link.)
@IsbnNames = ('bn.com', 'amazon.com', 'search');
# Full URL of each site before the ISBN
@IsbnPre = ('http://shop.barnesandnoble.com/bookSearch/isbnInquiry.asp?isbn=',
@IsbnPre = ('http://search.barnesandnoble.com/booksearch/isbninquiry.asp?isbn=',
'http://www.amazon.com/exec/obidos/ISBN=',
'http://www.pricescan.com/books/BookDetail.asp?isbn=');
# Rest of URL of each site after the ISBN (usually '')
@@ -394,6 +394,16 @@ sub Tss {
return $text;
}
sub QuoteHtml {
my ($html) = @_;
$html =~ s/&/&amp;/g;
$html =~ s/</&lt;/g;
$html =~ s/>/&gt;/g;
$html =~ s/&amp;([#a-zA-Z0-9]+);/&$1;/g; # Allow character references
return $html;
}
# == Normal page-browsing and RecentChanges code =======================
$BrowseCode = ""; # Comment next line to always compile (slower)
#$BrowseCode = <<'#END_OF_BROWSE_CODE';
@@ -545,7 +555,7 @@ sub BrowsePage {
}
$MainPage = $id;
$MainPage =~ s|/.*||; # Only the main page name (remove subpage)
$fullHtml = &GetHeader($id, &QuoteHtml($id), $oldId);
$fullHtml = &GetHeader($id, &QuoteHtml($id), $oldId, 1);
if ($revision ne '') {
if (($revision eq $Page{'revision'}) || ($goodRevision ne '')) {
$fullHtml .= '<b>' . Ts('Showing revision %s', $revision) . "</b><br>";
@@ -739,7 +749,7 @@ sub GetRc {
my ($showedit, $link, $all, $idOnly, $headItem, $item);
my ($ts, $pagename, $summary, $isEdit, $host, $kind, $extraTemp);
my ($rcchangehist, $tEdit, $tChanges, $tDiff);
my ($headList, $historyPrefix, $diffPrefix);
my ($headList, $pagePrefix, $historyPrefix, $diffPrefix);
my %extra = ();
my %changetime = ();
my %pagecount = ();
@@ -765,8 +775,9 @@ sub GetRc {
$tEdit = T('(edit)');
$tDiff = T('(diff)');
$tChanges = T('changes');
$diffPrefix = $QuotedFullUrl . &QuoteHtml("?action=browse\&diff=4\&id=");
$historyPrefix = $QuotedFullUrl . &QuoteHtml("?action=history\&id=");
$pagePrefix = $QuotedFullUrl . &ScriptLinkChar();
$diffPrefix = $pagePrefix . &QuoteHtml("action=browse&diff=4&id=");
$historyPrefix = $pagePrefix . &QuoteHtml("action=history&id=");
foreach $rcline (@outrc) {
($ts, $pagename) = split(/$FS3/, $rcline);
$pagecount{$pagename}++;
@@ -807,7 +818,7 @@ sub GetRc {
($headItem, $item) = &GetRssRcLine($pagename, $ts, $host,
$extra{'name'}, $extra{'id'}, $summary, $isEdit,
$pagecount{$pagename}, $extra{'revision'},
$diffPrefix, $historyPrefix);
$diffPrefix, $historyPrefix, $pagePrefix);
$headList .= $headItem;
$result .= $item;
} else { # HTML
@@ -891,7 +902,7 @@ sub GetRcRss {
>
<channel rdf:about="$ChannelAbout">
<title>${\(&QuoteHtml($SiteName))}</title>
<link>${\($QuotedFullUrl . &QuoteHtml("?$RCName"))}</link>
<link>${\($QuotedFullUrl . &ScriptLinkChar() . &QuoteHtml("$RCName"))}</link>
<description>${\(&QuoteHtml($SiteDescription))}</description>
<wiki:interwiki>
<rdf:Description link="$QuotedFullUrl">
@@ -919,8 +930,8 @@ RSS
}
sub GetRssRcLine{
my ($pagename, $timestamp, $host, $userName, $userID, $summary,
$isEdit, $pagecount, $revision, $diffPrefix, $historyPrefix) = @_;
my ($pagename, $timestamp, $host, $userName, $userID, $summary, $isEdit,
$pagecount, $revision, $diffPrefix, $historyPrefix, $pagePrefix) = @_;
my ($pagenameEsc, $itemID, $description, $authorLink, $author, $status,
$importance, $date, $item, $headItem);
@@ -937,7 +948,7 @@ sub GetRssRcLine{
$host = &QuoteHtml($host);
if ($userName) {
$author = &QuoteHtml($userName);
$authorLink = "link=\"$QuotedFullUrl?$author\"";
$authorLink = 'link="' . $QuotedFullUrl . &ScriptLinkChar() . $author . '"';
} else {
$author = $host;
}
@@ -953,7 +964,7 @@ sub GetRssRcLine{
$item = <<RSS ;
<item rdf:about="$itemID">
<title>$pagename</title>
<link>$QuotedFullUrl?$pagenameEsc</link>
<link>$pagePrefix$pagenameEsc</link>
<description>$description</description>
<dc:date>$date</dc:date>
<dc:contributor>
@@ -1284,7 +1295,7 @@ sub GetHistoryLink {
}
sub GetHeader {
my ($id, $title, $oldId) = @_;
my ($id, $title, $oldId, $backlinks) = @_;
my $header = "";
my $logoImage = "";
my $result = "";
@@ -1310,7 +1321,7 @@ sub GetHeader {
}
$header = &ScriptLink($HomePage, "<$logoImage>");
}
if ($id ne '') {
if ($id and $backlinks) {
$result .= $q->h1($header . &GetBackLinksSearchLink($id));
} else {
$result .= $q->h1($header . $title);
@@ -1504,6 +1515,39 @@ sub GetGotoBar {
return $bartext;
}
# Admin bar contributed by ElMoro (with some changes)
sub GetPageLockLink {
my ($id, $status, $name) = @_;
if ($FreeLinks) {
$id = &FreeToNormal($id);
}
return &ScriptLink("action=pagelock&set=$status&id=$id", $name);
}
sub GetAdminBar {
my ($id) = @_;
my ($result);
$result = T('Administration') . ': ';
if (-f &GetLockedPageFile($id)) {
$result .= &GetPageLockLink($id, 0, T('Unlock page'));
}
else {
$result .= &GetPageLockLink($id, 1, T('Lock page'));
}
$result .= " | " . &GetDeleteLink($id, T('Delete this page'), 0);
$result .= " | " . &ScriptLink("action=editbanned", T("Edit Banned List"));
$result .= " | " . &ScriptLink("action=maintain", T("Run Maintenance"));
$result .= " | " . &ScriptLink("action=editlinks", T("Edit/Rename pages"));
if (-f "$DataDir/noedit") {
$result .= " | " . &ScriptLink("action=editlock&set=0", T("Unlock site"));
} else {
$result .= " | " . &ScriptLink("action=editlock&set=1", T("Lock site"));
}
return $result;
}
sub GetSearchForm {
my ($result);
@@ -1808,16 +1852,6 @@ sub UriEscape {
return $uri;
}
sub QuoteHtml {
my ($html) = @_;
$html =~ s/&/&amp;/g;
$html =~ s/</&lt;/g;
$html =~ s/>/&gt;/g;
$html =~ s/&amp;([#a-zA-Z0-9]+);/&$1;/g; # Allow character references
return $html;
}
sub ParseParagraph {
my ($text) = @_;
@@ -3246,7 +3280,7 @@ sub DoEdit {
}
$editRows = &GetParam("editrows", 20);
$editCols = &GetParam("editcols", 65);
print &GetHeader('', &QuoteHtml($header), '');
print &GetHeader($id, &QuoteHtml($header), '');
if ($revision ne '') {
print "\n<b>"
. Ts('Editing old revision %s.', $revision) . " "
@@ -3792,7 +3826,7 @@ sub DoLinks {
print "<hr><pre>\n\n\n\n\n"; # Extra lines to get below the logo
&PrintLinkList(&GetFullLinkList());
print "</pre>\n";
print &GetMinimumFooter();
print &GetCommonFooter();
}
sub PrintLinkList {
@@ -4122,6 +4156,7 @@ sub EmailNotify {
close(EMAIL);
my $home_url = $q->url();
my $page_url = $home_url . &ScriptLinkChar() . &UriEscape($id);
my $pref_url = $home_url . &ScriptLinkChar() . "action=editprefs";
my $editors_summary = $q->param("summary");
if (($editors_summary eq "*") or ($editors_summary eq "")){
$editors_summary = "";
@@ -4140,7 +4175,7 @@ sub EmailNotify {
so only do that if you mean to.
To remove yourself from this list, visit
${home_url}?action=editprefs .)
$pref_url .)
END_MAIL_CONTENT
my $subject = "The $id page at $SiteName has been changed.";
# I'm setting the "reply-to" field to be the same as the "to:" field
@@ -4904,43 +4939,10 @@ sub RenamePage {
sub DoShowVersion {
print &GetHeader('', T('Displaying Wiki Version'), '');
print "<p>UseModWiki version 1.0.3</p>\n";
print "<p>UseModWiki version 1.0.4</p>\n";
print &GetCommonFooter();
}
# Admin bar contributed by ElMoro (with some changes)
sub GetPageLockLink {
my ($id, $status, $name) = @_;
if ($FreeLinks) {
$id = &FreeToNormal($id);
}
return &ScriptLink("action=pagelock&set=$status&id=$id", $name);
}
sub GetAdminBar {
my ($id) = @_;
my ($result);
$result = T('Administration') . ': ';
if (-f &GetLockedPageFile($id)) {
$result .= &GetPageLockLink($id, 0, T('Unlock page'));
}
else {
$result .= &GetPageLockLink($id, 1, T('Lock page'));
}
$result .= " | " . &GetDeleteLink($id, T('Delete this page'), 0);
$result .= " | " . &ScriptLink("action=editbanned", T("Edit Banned List"));
$result .= " | " . &ScriptLink("action=maintain", T("Run Maintenance"));
$result .= " | " . &ScriptLink("action=editlinks", T("Edit/Rename pages"));
if (-f "$DataDir/noedit") {
$result .= " | " . &ScriptLink("action=editlock&set=0", T("Unlock site"));
} else {
$result .= " | " . &ScriptLink("action=editlock&set=1", T("Lock site"));
}
return $result;
}
# Thanks to Phillip Riley for original code
sub DoDeletePage {
my ($id) = @_;