From: Joey Hess Date: Sun, 6 Jul 2008 21:34:30 +0000 (-0400) Subject: Merge branch 'master' into tova X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/17fdb8028bfb2722c120b229c2131598affbddd6?hp=abf9f16f09da1b494856a1803f848ed51f10fdb8 Merge branch 'master' into tova --- diff --git a/IkiWiki.pm b/IkiWiki.pm index 03b4b666e..0b420e824 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -596,7 +596,7 @@ sub htmllink ($$$;@) { #{{{ return " "create", - page => pagetitle(lc($link), 1), + page => lc($link), from => $lpage ). "\" rel=\"nofollow\">?$linktext" diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 07e92322f..99cead64f 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -301,10 +301,9 @@ sub cgi_editpage ($$) { #{{{ }); decode_form_utf8($form); - # This untaint is safe because titlepage removes any problematic - # characters. + # This untaint is safe because we check file_pruned. my $page=$form->field('page'); - $page=titlepage(possibly_foolish_untaint($page)); + $page=possibly_foolish_untaint($page); if (! defined $page || ! length $page || file_pruned($page, $config{srcdir}) || $page=~/^\//) { error("bad page name"); @@ -354,7 +353,7 @@ sub cgi_editpage ($$) { #{{{ $form->field(name => "from", type => 'hidden'); $form->field(name => "rcsinfo", type => 'hidden'); $form->field(name => "subpage", type => 'hidden'); - $form->field(name => "page", value => pagetitle($page, 1), force => 1); + $form->field(name => "page", value => $page, force => 1); $form->field(name => "type", value => $type, force => 1); $form->field(name => "comments", type => "text", size => 80); $form->field(name => "editcontent", type => "textarea", rows => 20, @@ -486,8 +485,8 @@ sub cgi_editpage ($$) { #{{{ $form->tmpl_param("page_select", 1); $form->field(name => "page", type => 'select', - options => [ map { pagetitle($_, 1) } @editable_locs ], - value => pagetitle($best_loc, 1)); + options => [ map { [ $_, pagetitle($_, 1) ] } @editable_locs ], + value => $best_loc); $form->field(name => "type", type => 'select', options => \@page_types); $form->title(sprintf(gettext("creating %s"), pagetitle($page))); diff --git a/IkiWiki/Plugin/editdiff.pm b/IkiWiki/Plugin/editdiff.pm index b8ecaa3d7..9872e9686 100644 --- a/IkiWiki/Plugin/editdiff.pm +++ b/IkiWiki/Plugin/editdiff.pm @@ -46,11 +46,11 @@ sub diff ($$) { #{{{ sub formbuilder_setup { #{{{ my %params=@_; my $form=$params{form}; - my $page=$form->field("page"); - return if $form->field("do") ne "edit"; + return if defined ! $form->field("do") || $form->field("do") ne "edit"; - $page = IkiWiki::titlepage(IkiWiki::possibly_foolish_untaint($page)); + my $page=$form->field("page"); + $page = IkiWiki::possibly_foolish_untaint($page); return unless exists $pagesources{$page}; push @{$params{buttons}}, "Diff"; diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 344620ebe..8890e5ed0 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -70,12 +70,12 @@ sub sessioncgi () { #{{{ my $session=shift; if ($q->param('do') eq 'blog') { - my $page=decode_utf8($q->param('title')); - $page=~s/\///g; # no slashes in blog posts + my $page=IkiWiki::titlepage(decode_utf8($q->param('title'))); + $page=~s/(\/)/"__".ord($1)."__"/eg; # don't create subdirs # if the page already exists, munge it to be unique my $from=$q->param('from'); my $add=""; - while (exists $IkiWiki::pagecase{lc($from."/".IkiWiki::titlepage($page).$add)}) { + while (exists $IkiWiki::pagecase{lc($from."/".$page.$add)}) { $add=1 unless length $add; $add++; } @@ -278,7 +278,7 @@ sub preprocess_inline (@) { #{{{ } if (length $config{cgiurl} && defined $type) { $template->param(have_actions => 1); - $template->param(editurl => cgiurl(do => "edit", page => pagetitle($page, 1))); + $template->param(editurl => cgiurl(do => "edit", page => $page)); } } diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 5184be2df..c241fd40b 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -80,7 +80,7 @@ sub genpage ($$) { #{{{ my $actions=0; if (length $config{cgiurl}) { - $template->param(editurl => cgiurl(do => "edit", page => pagetitle($page, 1))); + $template->param(editurl => cgiurl(do => "edit", page => $page)); $template->param(prefsurl => cgiurl(do => "prefs")); $actions++; } diff --git a/debian/NEWS b/debian/NEWS index d3597ebb4..4aac33b80 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,6 +1,14 @@ +ikiwiki (2.52) unstable; urgency=low + + All wikis need to be rebuilt on upgrade to this version. If you listed your + wiki in /etc/ikiwiki/wikilist this will be done automatically when the + Debian package is upgraded. Or use ikiwiki-mass-rebuild to force a rebuild. + + -- Joey Hess Sun, 06 Jul 2008 15:10:05 -0400 + ikiwiki (2.49) unstable; urgency=low - The search plugin no longer uses hyperestrair. Instead, to use it you + The search plugin no longer uses hyperestraier. Instead, to use it you will now need to install xapian-omega, and the Search::Xapian, HTML::Scrubber, and Digest::SHA1 perl modules. Ie, `apt-get install xapian-omega libsearch-xapian-perl libhtml-scrubber-perl libdigest-sha1-perl` diff --git a/debian/changelog b/debian/changelog index e6ffa17de..1e82ee70c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,14 @@ ikiwiki (2.52) UNRELEASED; urgency=low * toggle: Fix to work in preview mode. * toggle: Add javascript to top of page, not to end. This avoids flicker since closed toggles will not be displayed as the page is loading. + * The editpage form now uses the raw page name, not the page title, in its + 'page' cgi parameter. Using the title was ambiguous and made it + impossible to tell between some pages, like "foo/bar" and "foo__47__bar", + sometimes causing the wrong page to be edited. + * This change means that some edit links need to be updated. + Force a rebuild on upgrade to this version. + * Above change also allowed really fixing escaped slashes from the blogpost + form. -- Joey Hess Mon, 30 Jun 2008 19:56:28 -0400 diff --git a/debian/postinst b/debian/postinst index 26c44a88b..0a836a0b2 100755 --- a/debian/postinst +++ b/debian/postinst @@ -4,7 +4,7 @@ set -e # Change this when some incompatible change is made that requires # rebuilding all wikis. -firstcompat=2.30 +firstcompat=2.52 if [ "$1" = configure ] && \ dpkg --compare-versions "$2" lt "$firstcompat"; then diff --git a/doc/bugs/CGI_edit_and_slash_in_page_title.mdwn b/doc/bugs/CGI_edit_and_slash_in_page_title.mdwn new file mode 100644 index 000000000..ec5763924 --- /dev/null +++ b/doc/bugs/CGI_edit_and_slash_in_page_title.mdwn @@ -0,0 +1,18 @@ +Try clicking the Edit link for + +The link produces a query string that the edit CGI interprets to +mean `edit.mdwn` in an `Add showdown GUI input` subpage. + +There's something there now, but only because I created it. When +I first tried it, it came up blank. I tried several different ways +of altering the escaping of the query string to get the real page to +come up, but I never succeeded, so I just grabbed the original text +from git and pasted it into the new page.... + +So somehow the generation of Edit links and the CGI for doing the +editing need to get in agreement on just how they're going to +escape slashes in a page title. + +--Chapman Flack + +> bleh. [[Fixed|done]] --[[joey]] diff --git a/doc/bugs/git_fails_to_compile.mdwn b/doc/bugs/git_fails_to_compile.mdwn new file mode 100644 index 000000000..fdd1df533 --- /dev/null +++ b/doc/bugs/git_fails_to_compile.mdwn @@ -0,0 +1,30 @@ +Background: I'm running ikiwiki on OS X leopard, (a laptop), and I have the wiki running locally, as it's mostly for note taking and personal stuff. Anyway. + +I'd been using svn, but I'm making the leap to git (finally) and moving the wiki over as well... + +The git works great, I am in fact, quite pleased. Here's the problem. When I try and run `ikiwiki --setup [setupfile]` I get the following message: + + Can't exec "git": No such file or directory at /opt/local/lib/perl5/vendor_perl/5.8.8/IkiWiki/Rcs/git.pm line 29. + /Users/tychoish/.ikiwiki/ikiwiki.setup: Cannot exec 'git log --max-count=50 --pretty=raw --raw --abbrev=40 --always -c -r HEAD -- .': No such file or directory + BEGIN failed--compilation aborted at (eval 6) line 139. + + /Users/$HOME/.ikiwiki/ikiwiki.setup: 'git log --max-count=50 --pretty=raw --raw --abbrev=40 --always -c -r HEAD -- .' failed: + BEGIN failed--compilation aborted at (eval 6) line 139. + +--- + +I can get the wiki to compile if: I take the git stuff out of the setup file, if I put `rcs => ""` **or** if I set the the git_master_branch to "". + +I think the problem is that ikiwiki can't deal with the onslaught of such a large quantity of history/log information at once, somehow, because the repository came to this moment with a lot of history that the compiler has to crunch through. How to remedy this, is beyond my skill insight... + +Thanks. + +-- [[tychoish]] + +> It looks like it can't find git; what is $PATH set to when ikiwiki is run, and is git in one of those directories? --[[bma]] +>> Yeah, ikiwiki and git are both installed underneath macports, which is in the path and works just fine most of the time, and I use macports stuff a lot. + +>>> The PATH is set at the top of the ikiwiki program; so the system's PATH +>>> setting, or one in the environment will be ignored. (This is done for +>>> security since ikiwiki can be run setuid.) If you need to use +>>> a nonstandard path, you'll need to edit that. --[[Joey]] diff --git a/doc/bugs/ikiwiki_is_not_truly_localizable.mdwn b/doc/bugs/ikiwiki_is_not_truly_localizable.mdwn new file mode 100644 index 000000000..11bf1cab5 --- /dev/null +++ b/doc/bugs/ikiwiki_is_not_truly_localizable.mdwn @@ -0,0 +1,38 @@ +A lot of strings in ikiwiki are hardcoded and not taken for locales resources through gettext. This is bad because ikiwiki is thus difficult to spread for non-english users. + +I mean that, for instance in CGI.pm, line like: + +`my @buttons=("Save Page", "Preview", "Cancel");` + +should be written as + +`my @buttons=(gettext("Save Page"), gettext("Preview"), gettext("Cancel"));` + +> Yes, these need to be fixed. But note that the localised texts come back +> into ikiwiki and are used in various places, including plugins. +> Including, possibly, third-party plugins. So localising the buttons would +> seem to require converting from the translations back into the C locale +> when the form is posted. --[[Joey]] + +In standards templates things seems wrongly written too. For instance in page.tmpl line like: + +`
  • Edit
  • ` + +should be written as + +`
  • ` + +with EDITURL_TEXT variable initialized in Render.pm through a gettext call. + +Am I wrong ? + +> No, that's not a sane way to localise the templates. The templates can be +> translated by making a copy and modifying it, or by using a tool to +> generate .mo files from the templates, and generate translated templates +> from .po files. (See [[todo/l10n]] for one attempt.) But pushing the +> localisation of random strings in the templates through the ikiwiki +> program defeats the purpose of having templates at all. --[[Joey]] + +If not I can spend some time preparing patches for such corrections if it can help. + +-- [[/users/bbb]] diff --git a/doc/bugs/recentchanges_feed_links.mdwn b/doc/bugs/recentchanges_feed_links.mdwn index 32073415f..eb543587c 100644 --- a/doc/bugs/recentchanges_feed_links.mdwn +++ b/doc/bugs/recentchanges_feed_links.mdwn @@ -26,3 +26,9 @@ to turn on? --Chapman Flack >>> "recentchanges#someid" will probably work. Probably first by addressing the >>> todo about [[todo/ability_to_force_particular_UUIDs_on_blog_posts]], >>> and then by just using that new ability in the page. --[[Joey]] + +>>>> Ah. The prerequisite todo looks like more than I'd like to take on. +>>>> In the meantime, would it be very involved to change whatever bug now +>>>> optimizes away the change pages, or to simply have all the links in the +>>>> feed point to the recentchanges page itself, with no fragment id? +>>>> Either would be a bit nicer than having broken links in the feed. --Chap diff --git a/doc/news/version_2.49.mdwn b/doc/news/version_2.49.mdwn index 36bfa315c..4c95b50dd 100644 --- a/doc/news/version_2.49.mdwn +++ b/doc/news/version_2.49.mdwn @@ -1,6 +1,6 @@ News for ikiwiki 2.49: - The search plugin no longer uses hyperestrair. Instead, to use it you + The search plugin no longer uses hyperestraier. Instead, to use it you will now need to install xapian-omega, and the [[cpan Search::Xapian]], [[cpan HTML::Scrubber]], and [[cpan Digest::SHA1]] perl modules. Ie, `apt-get install xapian-omega libsearch-xapian-perl libhtml-scrubber-perl libdigest-sha1-perl` diff --git a/doc/plugins/toggle/discussion.mdwn b/doc/plugins/toggle/discussion.mdwn index 22a09685d..5426a62fc 100644 --- a/doc/plugins/toggle/discussion.mdwn +++ b/doc/plugins/toggle/discussion.mdwn @@ -1,4 +1,4 @@ -# Nested plugins +## Nested plugins Is it possible to use another plugin into your toggle plugin? For example, I want to have toggleable table and try to use Victor Moral's table plugin, @@ -14,4 +14,4 @@ but no success. How can I do it? >> --PTecza -# [[bugs/Bug_when_toggling_in_a_preview_page]] +## [[bugs/Bug_when_toggling_in_a_preview_page]] diff --git a/doc/todo/Add_showdown_GUI_input__47__edit.mdwn b/doc/todo/Add_showdown_GUI_input__47__edit.mdwn index 4a20a37c7..a3db94bdd 100644 --- a/doc/todo/Add_showdown_GUI_input__47__edit.mdwn +++ b/doc/todo/Add_showdown_GUI_input__47__edit.mdwn @@ -13,3 +13,8 @@ A demo is at > Since we have semi-working wikiwgy and it's better, I'm considering this > todo item as [[done]] or rather, will-not-be-done.. + +>> Given the unfortunate state of affairs for the wikiwyg project, could it +>> be worthwhile to consider this option again? It seems to have a companion +>> product (wmd) with formatting widgets and a live preview pane, that is +>> promised to be MIT licensed as of the next release.... --Chapman Flack diff --git a/doc/todo/attachments.mdwn b/doc/todo/attachments.mdwn index 08052f368..8c5c28615 100644 --- a/doc/todo/attachments.mdwn +++ b/doc/todo/attachments.mdwn @@ -1,7 +1,6 @@ Stuff the [[plugins/attachment]] plugin is currently missing, that might be nice to add: -* `mimetype()` pagespecs. (Using a mime type sniffer.) * Virus scanning. * Add a progress bar for attachment uploads (needs AJAX stuff..) * Maybe optimise the "Insert Links" button with javascript, so, if diff --git a/doc/todo/comment_by_mail.mdwn b/doc/todo/comment_by_mail.mdwn index a1d364f11..ed9db0621 100644 --- a/doc/todo/comment_by_mail.mdwn +++ b/doc/todo/comment_by_mail.mdwn @@ -62,3 +62,8 @@ Any comments? Write them here or send them to [[DavidBremner]] >>[test](mailto:bremner@somewhere.ca?body=X-Iki-Page:%20test%0AX-Iki-thread:%20foobar). I hesitate to use the subject because every mail admin in the >> world seems to want to add things to the front of it. >> -- [[DavidBremner]] +>>> Although it is in python, just from reading the Debian ITP, it +>>> looks like +>>> [mnemosyne-blog](http://www.red-bean.com/~decklin/mnemosyne/) +>>> might be an interesting backend to use or at least steal ideas +>>> from :-) --[[David Bremner]] diff --git a/doc/todo/wikiwyg/discussion.mdwn b/doc/todo/wikiwyg/discussion.mdwn index cea64e951..cbf969471 100644 --- a/doc/todo/wikiwyg/discussion.mdwn +++ b/doc/todo/wikiwyg/discussion.mdwn @@ -75,7 +75,7 @@ changes.diff: /usr/share/ikiwiki/wikiwyg/ for the files. * When is the WIKIWYG variable in misc.tmpl used? * The WIKIWYG variable in misc.tmpl is used for the edit page. I believe that is what - you wanted me to do (Check [Revision 3840][]). + you wanted me to do (Check Revision 3840). * Ah, right. * Could you move the code that handles saving a page of the page into the plugin? I just added an editcontent hook, which should allow you to do @@ -153,10 +153,6 @@ Even just some of the smaller changes would be much easier for you to do than for me, and it would be nice to get them sorted out before I merge it into ikiwiki. --[[Joey] - -[Revision 3840]: http://ikiwiki.info/cgi-bin/viewvc.cgi?view=rev&root=ikiwiki&revision=3840 - - None of the links for the WYSIWYG editor work anymore. Does anyone have an up to date link? Thanks, [[Greg]] @@ -170,3 +166,12 @@ Thanks, [[Greg]] >> wikiwyg-specific stuff from git, it looks like I'd need to ask git for >> a diff between the wikiwyg branch and its branch point; is there a nice way to do >> that with gitweb, or would I need to install a full-fledged git client? --Chapman Flack + +>>> I think that the largest missing thing was support for using ikiwiki +>>> to render page previews. +>>> +>>> Erm.. I seem to have screwed up the creation or pushing out of the +>>> wikiwyg branch. It doesn't seem to have any of the wikiwyg changes in +>>> it, and at this point, I don't know where to find them anymore! Damn, +>>> damn, damn. I suspect I did that right when I was learning git, and +>>> screwed up pushing the branch. :-( --[[Joey]] diff --git a/doc/users/bbb.mdwn b/doc/users/bbb.mdwn new file mode 100644 index 000000000..4bda44b58 --- /dev/null +++ b/doc/users/bbb.mdwn @@ -0,0 +1,5 @@ +[[meta title="Bruno Beaufils"]] + +Bruno Beaufils is ****. + +You can find me at [work](http://www.lifl.fr/~beaufils) or at [home](http://bruno.boulgour.com). diff --git a/doc/users/tychoish.mdwn b/doc/users/tychoish.mdwn new file mode 100644 index 000000000..3439afdb3 --- /dev/null +++ b/doc/users/tychoish.mdwn @@ -0,0 +1,5 @@ +I'm [tycho](http://www.tychoish.com/). + +I use ikiwiki *a lot* on my local machine to organize thoughts, stage writing projects, and collect information. It's a great thing for me. Someday I'll probably get around to using it to powersome sort of collaborative fiction project. Someday. + +Talk to you soon. diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 8f64da8f7..d052f0b98 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-07-02 18:08-0400\n" +"POT-Creation-Date: 2008-07-06 15:30-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -24,7 +24,7 @@ msgstr "" msgid "login failed, perhaps you need to turn on cookies?" msgstr "" -#: ../IkiWiki/CGI.pm:190 ../IkiWiki/CGI.pm:526 +#: ../IkiWiki/CGI.pm:190 ../IkiWiki/CGI.pm:525 msgid "Your login session has expired." msgstr "" @@ -44,30 +44,30 @@ msgstr "" msgid "Preferences saved." msgstr "" -#: ../IkiWiki/CGI.pm:326 +#: ../IkiWiki/CGI.pm:325 #, perl-format msgid "%s is not an editable page" msgstr "" -#: ../IkiWiki/CGI.pm:437 ../IkiWiki/Plugin/brokenlinks.pm:24 +#: ../IkiWiki/CGI.pm:436 ../IkiWiki/Plugin/brokenlinks.pm:24 #: ../IkiWiki/Plugin/inline.pm:266 ../IkiWiki/Plugin/opendiscussion.pm:17 #: ../IkiWiki/Plugin/orphans.pm:28 ../IkiWiki/Render.pm:95 #: ../IkiWiki/Render.pm:162 msgid "discussion" msgstr "" -#: ../IkiWiki/CGI.pm:493 +#: ../IkiWiki/CGI.pm:492 #, perl-format msgid "creating %s" msgstr "" -#: ../IkiWiki/CGI.pm:511 ../IkiWiki/CGI.pm:539 ../IkiWiki/CGI.pm:549 -#: ../IkiWiki/CGI.pm:583 ../IkiWiki/CGI.pm:628 +#: ../IkiWiki/CGI.pm:510 ../IkiWiki/CGI.pm:538 ../IkiWiki/CGI.pm:548 +#: ../IkiWiki/CGI.pm:582 ../IkiWiki/CGI.pm:627 #, perl-format msgid "editing %s" msgstr "" -#: ../IkiWiki/CGI.pm:722 +#: ../IkiWiki/CGI.pm:721 msgid "You are banned." msgstr "" diff --git a/templates/editpage.tmpl b/templates/editpage.tmpl index f8eda1b47..7f6c2a97a 100644 --- a/templates/editpage.tmpl +++ b/templates/editpage.tmpl @@ -1,3 +1,4 @@ +