Noticed this while playing with #1268416: Destination directory .../drupal-7.9 already exists..

Drush up gives me output like this:

Checking available update data ...
Checked available update data for <em class="placeholder">Administration menu</em>.

It should look saner:

Checking available update data ...
Checked available update data for Administration menu.

Patch attached below.

Comments

kotnik’s picture

StatusFileSize
new916 bytes

Patch attached.

moshe weitzman’s picture

Status: Needs review » Needs work

Please provide more detail. Drupal7 tries not to print html in its errors. What code is doing thle placeholder?

kotnik’s picture

Status: Needs work » Needs review

Unfortunately it still does leak HTML if it's batching. Code that outputs HTML is here, %placeholder returns HTML as you can see here.

greg.1.anderson’s picture

Maybe we need to add strip_tags to $value in includes/batch.inc?

class DrushBatchContext extends ArrayObject {
  function offsetSet($name, $value) {
    if ($name == 'message') {
      drush_log($value, 'ok');
    }
    elseif ($name == 'error_message') {
      drush_set_error('DRUSH_BATCH_ERROR', $value);
    }
    parent::offsetSet($name, $value);
  }
}
greg.1.anderson’s picture

(Only add strip_tags to the parameter $value as passed to drush_log and drush_set_error; do not perturb parent:offsetSet.)

kotnik’s picture

StatusFileSize
new901 bytes

Greg, you are right, this is better place to do it. Patch attached.

bforchhammer’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #6 works :)

(Tested with drush up command).

moshe weitzman’s picture

Version: » All-versions-4.x-dev
Status: Reviewed & tested by the community » Needs work

committed to master. seems safe for 4.x but does not apply cleanly.

greg.1.anderson’s picture

Status: Needs work » Patch (to be ported)

Set status.

kotnik’s picture

Batching approach changed in #687724: 'multithreaded' updatedb for better memory consumption and there is no need for this patch for 4.x, since there are no issues there with HTML output.

greg.1.anderson’s picture

Version: All-versions-4.x-dev »
Status: Patch (to be ported) » Fixed

Sounds right to me.

robloach’s picture

Status: Fixed » Needs review
StatusFileSize
new1.35 KB

What if instead calling strip_tags() all the time, we used dt()?

moshe weitzman’s picture

Status: Needs review » Fixed

Not going to translate arbitrary strings. Drupal doesn't do that either.

robloach’s picture

Component: Miscellaneous » Make
Status: Fixed » Needs review
StatusFileSize
new9.05 KB

The reason I bring that up is because this looks kind of silly.

robloach’s picture

StatusFileSize
new8.83 KB
new691 bytes

Ah, I understand. This is the same issue, but occurring in different places. I'm running into HTML being outputted when running through Drush Make's download factory. I think we have two options here...

1) drushmakehtml.patch
Stick a strip_tags() in the dt() function so that the <em> tags are removed.
2) checkplainInsteadOfEm.patch
Switch the dt() parameters to use @ instead of % so it uses check_plain() on the parameters instead of wrapping it in an em tag.

I think I prefer the #2 checkplainInsteadOfEm.patch approach more. Let's use @ instead of % for those dt() calls.

greg.1.anderson’s picture

Status: Needs review » Reviewed & tested by the community

I agree that #2 is preferable.

greg.1.anderson’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

vinmassaro’s picture

Status: Closed (fixed) » Active

I still see this with Drush 5.1:

$ drush urol "administrator" --uid=2
Added the <em class="placeholder">administrator</em> role to uid <em class="placeholder">2</em>                                                                           [success]
moshe weitzman’s picture

Status: Active » Closed (fixed)

Please use latest dev snapshot before reporting bugs. That might be fixed already. If still broken, feel free to reopen.

vinmassaro’s picture

My mistake, I did not see that this thread was related to Drush Make. This is an issue when using core commands. I'll open another issue.