Posts from the xml-rpc blogapi get whatever is the default input format, which in a typical case is the same as for anonymous users - making it the most restrictive. At the same time, blogapi posting is typically performed by trusted users. Bad combination.

This patch produces a new option in the blogapi configuration, allowing adminstrators to select an input filter format for blogapi postings. This format will be checked against user's permissions at posting time, and the default format used if permission is not granted.

Comments

drumm’s picture

Status: Needs review » Needs work

The added for loop in the 5th hunk needs some work. Proper indentation, always use {}, and it looks like it should be a foreach.

The comments might need some work too. As a general rule, they should all be full sentences and properly capitalized.

The ternary in the first hunk is a bit hard to read, maybe it should be a a full if statement.

It looks like a choice of filter formats is removed in blogapi_mt_supported_text_filters(), I'm not sure that is the right thing to do.

drumm’s picture

It looks like it is filters usable by anonymous only because the XML-RPC call (http://www.movabletype.org/siteuk/docs/mtmanual_programmatic.html#item_m...) doesn't contain any identifying information about the user, so permissions cannot be chacked at that time.

arru@boombox.se’s picture

Version: 4.7.2 » 4.6.8

Blogapi-clients format text a certain way, which has to be dealt with. Basically 3 options listed in increasing order of "goodness":

  1. treat the whole post (which is authenticated) as anonymous. This is the current approach.
  2. give admins a choice of default filter for blogapi, which can be different from default filter for anonymous users. What this patch does.
  3. present all filters, but then only permit allowed filters at posting time. Not sure this is possible technically though.

Note that 3. would take us back to square one with blogapi clients that do not support filter selection (Flock, Dashboard widgets to name just two). So the optimal solution would be combining 2. and 3. Actually I'm curious if there is even one single drupal admin running both blogapi and anonymous comments with the way it's working now. I'll check the comments on the code when time permits.

magico’s picture

Version: 4.6.8 » 4.6.9
magico’s picture

Version: 4.6.9 » 5.x-dev
Status: Needs work » Postponed (maintainer needs more info)

I cannot test this. I'm moving to this queue so it an get some attention, and confirmation if this bug exists in the current development version.

lifepillar’s picture

Version: 5.x-dev » 6.x-dev
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new2.75 KB

Patch re-rolled for Drupal 6.x-dev. Please review.

john franklin’s picture

I love the Drupal community. More often than not, whenever I identify an issue with one of my Drupal sites, a quick search finds a module or a patch to fix it.

The input format madness was the latest. I've got the patch in #6 working on my site. (D6.19+PGSQL8.4) It applied cleanly and worked flawlessly.

Thanks for the patch!

Status: Needs review » Needs work

The last submitted patch, blogapi-input-format-72414-6.patch, failed testing.

lifepillar’s picture

Project: Drupal core » Blog API
Version: 6.x-dev » 7.x-1.x-dev
Component: blogapi.module » Code
Status: Needs work » Needs review
StatusFileSize
new3.24 KB

Moving this issue to the Blog API project, as this module has been removed from core. Attached you find the (untested) patch for the latest dev code. Please review.

Status: Needs review » Needs work

The last submitted patch, blogapi-input-format-72414-9.patch, failed testing.

cweagans’s picture

Status: Needs work » Needs review

#9: blogapi-input-format-72414-9.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, blogapi-input-format-72414-9.patch, failed testing.

shane birley’s picture

I just noticed this and it is very annoying. Every post accepts the default input filter without any checks to other modules, settings, etc. It should have some sort of check against Better Formats or other related modules.

damienmckenna’s picture

Priority: Normal » Major
Issue tags: +Release blocker

tag.

lifepillar’s picture

StatusFileSize
new3.89 KB

Patch re-rolled for the latest dev code. There is some (new?) code in blogapi_mt_blogapi_post_alter() related to input formats, which this patch does not affect. That code seems fine for me, but it should be checked more carefully.

shane birley’s picture

Does this module respect defaults established by non-core modules such as default modules (re: better_formats.module)?

cweagans’s picture

Title: Blogapi posts get anonymous input format » Allow choosing default input format for posts created via BlogAPI
Version: 7.x-1.x-dev » 7.x-2.x-dev
Category: bug » feature
Priority: Major » Normal

Fixing issue metadata. This will be included in the 2.x rewrite.

shane birley’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)