All to use HTML tags like <em>. Add "PASS_THROUGH" see https://api.drupal.org/api/drupal/modules!node!node.pages.inc/function/n...

function node_page_edit($node) {
  $type_name = node_type_get_name($node);
  drupal_set_title(t('<em>Edit @type</em> @title', array('@type' => $type_name, '@title' => $node->title)), PASS_THROUGH);
  return drupal_get_form($node->type . '_node_form', $node);
}

Comments

jasom created an issue. See original summary.

jasom’s picture

Issue summary: View changes
jasom’s picture

Issue summary: View changes
ravi.kiran’s picture

Assigned: Unassigned » ravi.kiran
ravi.kiran’s picture

Hi @jasom, I have created a patch to allow using of HTML tags in the 'Node Add Title' fields.
I have also updated the description of the fields accordingly. Please review.

ravi.kiran’s picture

Assigned: ravi.kiran » Unassigned
Status: Active » Needs review
laxman.ghavte’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed! Patch looks good to me.

  • jcmartinez committed 4f90cb0 on 7.x-1.x
    Issue #2595625 by ravi.kiran: All to use  HTML tags like <em>
    
jcmartinez’s picture

Thank you for the suggested implementation of this request.

The problem I see with the #5 patch is that it doesn't seem safe. If we allow PASS_THROUGH there won't be filtering of malicious code on the title of the node and that is usually user generated content.

In D6 there used to be an XSS vulnerability with drupal_set_title that was corrected for D7 (See: https://www.drupal.org/node/28984). As I understand, adding PASS_THROUGH basically brings the vulnerability back and therefore the content of the title has to be filtered.

I used some of the elements suggested above and added some code filtering in order to make it safer. I hope I didn't over do it. If I did, please suggest a new patch.

This has been added to the dev version.

jcmartinez’s picture

Status: Reviewed & tested by the community » Fixed
jasom’s picture

@jcmartinez @ravi.kiran

I found this "PASS_THROUGH" in current D7 core when I was trying to find out how D7 allows <em> to pass through and then I made a custom module, means I don't use "Node Add Tittle" anymore. Ravi.kiran, your code inspired me, tnx.

Status: Fixed » Closed (fixed)

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