aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/editpage.pm
Commit message (Collapse)AuthorAge
* Force CGI::FormBuilder->field to scalar context where necessarySimon McVittie2016-12-28
| | | | | | | | | | | | | | | | | | | | | | | | | | CGI::FormBuilder->field has behaviour similar to the CGI.pm misfeature we avoided in f4ec7b0. Force it into scalar context where it is used in an argument list. This prevents two (relatively minor) commit metadata forgery vulnerabilities: * In the comments plugin, an attacker who was able to post a comment could give it a user-specified author and author-URL even if the wiki configuration did not allow for that, by crafting multiple values to other fields. * In the editpage plugin, an attacker who was able to edit a page could potentially forge commit authorship by crafting multiple values for the rcsinfo field. The remaining plugins changed in this commit appear to have been protected by use of explicit scalar prototypes for the called functions, but have been changed anyway to make them more obviously correct. In particular, checkpassword() in passwordauth has a known prototype, so an attacker cannot trick it into treating multiple values of the name field as being the username, password and field to check for. OVE-20161226-0001
* Process .md like .mdwn, but disallow web creation.Amitai Schlair2016-03-08
|
* Do not pass ignored sid parameter to checksessionexpirySimon McVittie2014-10-12
| | | | | | | | checksessionexpiry's signature changed from (CGI::Session, CGI->param('sid')) to (CGI, CGI::Session) in commit 985b229b, but editpage still passed the sid as a useless third parameter, and this was later cargo-culted into remove, rename and recentchanges.
* protect $@ whenever a block using $@ is non-trivialSimon McVittie2014-02-21
| | | | | | | | | | | | | | | | | | | | | | | | As noted in the Try::Tiny man page, eval/$@ can be quite awkward in corner cases, because $@ has the same properties and problems as C's errno. While writing a regression test for definetemplate in which it couldn't find an appropriate template, I received <span class="error">Error: failed to process template <span class="createlink">deftmpl</span> </span> instead of the intended <span class="error">Error: failed to process template <span class="createlink">deftmpl</span> template deftmpl not found</span> which turned out to be because the "catch"-analogous block called gettext before it used $@, and gettext can call define_gettext, which uses eval. This commit alters all current "catch"-like blocks that use $@, except those that just do trivial things with $@ (string interpolation, string concatenation) and call a function (die, error, print, etc.)
* add comment subscription checkbox to editpageJoey Hess2012-04-13
| | | | Reworded template, which also called the commit message a "comment".
* prune: do not prune beyond an optional base directory, and add a testSimon McVittie2012-04-07
| | | | | | | | Previously, prune("wiki/srcdir/sandbox/test.mdwn") could delete srcdir or even wiki, if they happened to be empty. This is rarely what you want: there's usually some base directory (destdir, srcdir, transientdir or another subdirectory of wikistatedir) beyond which you do not want to delete.
* editpage: Fix FormattingHelp link on Discussion pages.Joey Hess2011-11-27
| | | | | | | In 875d550f1278215e6c87d3b78ff87db24c6d76b3 I for some reason made $page be changed when creating a discussion page, which broke the link on the edit page. Changing page seems unnecessary, so reverted that part of the change.
* Fix handling of discussion page creation links to make discussion pages in ↵Joey Hess2011-11-06
| | | | | | the right place and with the right case. Broken by page case preservation feature added in 3.20110707.
* Preserve mixed case in page creation links, and when creating a page whose ↵Joey Hess2011-06-29
| | | | title is mixed case, allow selecting between the mixed case and all lower-case names.
* editpage: Avoid inheriting internal page types.Joey Hess2011-02-01
|
* fix uninitilized value warning on bad page nameJoey Hess2011-01-23
| | | | properly this time
* Revert "fix uninitilized value warning on bad page name"Joey Hess2011-01-23
| | | | | | This reverts commit 5d3998555ffbeb1c20b84dd4cdc46c825c07bec8. That broke posting via blog form.
* fix uninitilized value warning on bad page nameJoey Hess2011-01-22
|
* add cgitemplateJoey Hess2011-01-05
| | | | | | | | | | | | cgitemplate is a modified misctemplate that takes an optional cgi object and uses it to set the baseurl, and also optionally the forcebaseurl, if a page is provided. If no cgi object is provided, it will fall back to using $config{url}. I expect this will only be needed in exceptional cases where that doesn't much matter, such as cgierror(). showform uses cgitemplate, so there is no more need for showform_preview.
* Fix base url when previewing. Was broken by urlto changes in last release.Joey Hess2011-01-05
| | | | | Added a showform_preview that is like showform, but sets forcebaseurl to point to the page being previewed.
* editpage, comment: Clean up title when editing or creating a page or comment.Joey Hess2010-12-25
| | | | | | Now that page.tmpl is used for cgi, the parentlinks are able to be displayed even when creating or editing a page. So it's redundant to include the path to the page in the title, remove it.
* use one-parameter form of urltoJoey Hess2010-11-29
|
* Use local paths for most references to pagesSimon McVittie2010-11-23
|
* Use local paths for the CGI URLSimon McVittie2010-11-23
|
* Use local paths for redirection where possibleSimon McVittie2010-11-23
|
* rcs_commit and rcs_commit_staged api changesJoey Hess2010-06-23
| | | | | | | | | | | Using named parameters for these is overdue. Passing the session in a parameter instead of passing username and IP separately will later allow storing other session info, like username or part of the email. Note that these functions are not part of the exported API, and the prototype change will catch (most) skew, so I am not changing API versions. Any third-party plugins that call them will need updated though.
* stop using REMOTE_ADDRJoey Hess2010-06-23
| | | | | | | | | | | Everywhere that REMOTE_ADDR was used, a session object is available, so instead use its remote_addr method. In IkiWiki::Receive, stop setting a dummy REMOTE_ADDR. Note that it's possible for a session cookie to be obtained using one IP address, and then used from another IP. In this case, the first IP will now be used. I think that should be ok.
* editpage, comments: Fix broken links in sidebar (due to forcebaseurl). ↵Joey Hess2010-06-14
| | | | (Thanks, privat)
* editpage: Rename "comments" field to avoid CSS conflict with the comments div.Joey Hess2010-06-12
|
* editpage: Avoid storing accidental state changes when previewing pages.Joey Hess2010-06-09
| | | | | This is a slow, safe, stupid approach. Could make deep copies of the data structures as backups instead of re-loading the index from disk.
* Fix display of sidebar when previewing page edit. (Thanks, privat)Joey Hess2010-06-09
| | | | | On second thought, only display a page's personal sidebar when previewing it, not when editing normally.
* When editing a page, show that page's sidebar. (Thanks, privat)Joey Hess2010-06-09
|
* remove unused indexlink function and template variableJoey Hess2010-05-05
|
* template() - return params in list contextJoey Hess2010-04-24
| | | | | I forgot CGI::Formbuilder's horrible interface that needs template parameters instead of a constructed object.
* look for templates in srcdir and underlays, firstJoey Hess2010-04-22
| | | | | | | | | | | | | | | This entailed changing template_params; it no longer takes the template filename as its first parameter. Add template_depends to api and replace calls to template() with template_depends() in appropriate places, where a dependency should be added on the template. Other plugins don't use template(), so will need further work. Also, includes are disabled for security. Enabling includes only when using templates from the templatedir would be nice, but would add a lot of complexity to the implementation.
* typoJoey Hess2010-04-20
|
* remove explicit absolute testJoey Hess2010-04-20
| | | | file_pruned now tests for that
* clarify why absolute is tested & stripped hereJoey Hess2010-04-20
| | | | file_prune also fails on absolute filenames now
* unfinished file_prune revampJoey Hess2010-04-17
| | | | | | | | | Many calls to file_prune were incorrectly calling it with 2 parameters. In cases where the filename being checked is relative to the srcdir, that is not needed. Made absolute filenames be pruned. (This won't work for the 2 parameter call style.)
* Group related plugins into sections in the setup file, and drop unused rcs ↵Joey Hess2010-02-11
| | | | plugins from the setup file.
* reorder canedit checks during page creation to have best_loc firstJoey Hess2010-02-11
| | | | | | | | | | | | | | | | | | | | | | | | | | When creating a page, multiple locations are tested to see if they can be edited. If all fail, one of the failure subs is called, to log the user in to allow them to proceed with the edit. So far so good. But, what if some pages fail for one reason, and some for another? This occurs when httpauth_pagespec is used in conjunction with signinedit (and openid or something). When the user is not signed in at all The former will fail to edit a page because the user was not httpauthed. The latter will fail to edit a different page, because the user was not signed in. One of their failure methods gets to run first. The page creation code always ran the failure method corresponding to the topmost page location. So, when editing a foo/Discussion page, and with httpauth_pagespec => "*!/Discussion", it ran the httpauth failure method, which was exactly the wrong thing to do. I fixed this by making it instead run the failure method for the *best* page location. In the above example, that's foo/Discussion, so signinedit runs, as desired, and we get the signin page. This seems like it will be the right choice, or at least an acceptable choice. If a user wants to use httpauth they can always choose it on the signin page.
* factor out a userpage functionJoey Hess2010-02-04
| | | | Not yet exported, as only 4 quite core plugins use it.
* Add discussionpage configuration settingJoey Hess2009-08-13
| | | | | | By adding this setting, we get both more configurability, and a minor optimisation too, since gettext does not need to be called continually to get the Discussion value.
* fix further places where translated discussion case was assumedJoey Hess2009-06-04
| | | | | Another benefit is that consistently using gettext("Discussion") eliminates the need to translate one string.
* support longname for page types in commands and renameJoey Hess2009-05-21
| | | | Also, sort the list of page types.
* tidy up new page_types codeJon Dowland2009-05-16
|
* check for longname for each syntax pluginJon Dowland2009-05-16
| | | | | | | | We build an array of [ plugin name, long name ] pairs, where long name is an optional argument to hook(). So, a syntax plugin could define long "friendly" name, such as "Markdown" instead of mdwn, and we would then pass this array to formbuilder to populate the drop-down on the edit page.
* move check_canedit, check_content to IkiWiki library from editpageJoey Hess2009-02-12
| | | | | | | | | | | | It no longer makes sense to keep these functions in editpage, because serveral plugins now exist that use them, and users may want to disable editpage, while leaving those plugins enabled. Most notably, comments uses both functions, and it's entirely appropriate to disable editpage but still want to have comments enabled. Less likely, attachments, rename, and remove all use check_canedit -- but it would be unusual indeed to want to use these w/o editpage.
* comments: If comment content checks fail, store the comment (in ↵Joey Hess2009-01-25
| | | | .ikiwiki/comments_pending) for moderator review.
* checkcontent: New hook, can be used to implement arbitrary content filters, ↵Joey Hess2009-01-16
| | | | including spam filters.
* remove cruftJoey Hess2008-12-19
| | | | wtf does it do? absolutely nothing
* Coding style change: Remove explcit vim folding markers.Joey Hess2008-12-17
|
* checksessionexpiry: reworkJoey Hess2008-12-17
| | | | | This function as factored out was a bit confusing, I think this makes more sense.
* editpage: factor out checksessionexpiry into IkiWiki::CGISimon McVittie2008-12-11
|
* more work on untrusted committersJoey Hess2008-10-23
| | | | | Wired up check_canedit and check_canremove, still need to deal with check_canattach, and test.