Hi,

the title of my node used for the terms of use is « Conditions d'utilisation ». On the «accept modification» page, the « ' » came out like this : d'Utilisation.

Is there a way to correct this?

Thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bisonbleu’s picture

Issue summary: View changes
Related issues: +#1889928: i18n localization

Same issue.

iva2k’s picture

Of course it can be fixed... if someone provides a patch. I'm tied up in too many projects now and won't have bandwidth any time soon.

Dev1.addweb’s picture

PFA patch and screenshots with Before and after proof.

Dev1.addweb’s picture

Status: Active » Needs review
iva2k’s picture

Status: Needs review » Needs work

I'm afraid it will not pass Drupal security audit.

bisonbleu’s picture

Status: Needs work » Needs review

@iva2k, although you are right in thinking that check_plain is a security requirement (my initial thought), I believe @Deepali_Agarwal's patch is perfectly sound and the proper fix in the current context.

Explanation: as the api suggests, check_plain is not needed in the current context because drupal_set_title also uses check_plain. So site_disclaimer_confirm (below) is currently double-encoding the title.

function site_disclaimer_confirm($form, $form_state, $langcode = NULL, $preview = FALSE) {
  global $user;

  $title = check_plain(variable_get('site_disclaimer_title', SITE_DISCLAIMER_DEFAULT_TITLE));
  if (!$preview) {
    drupal_set_title($title);
  }

Changing the title assignment to the following fixes this issue ans is secure.

$title = variable_get('site_disclaimer_title', SITE_DISCLAIMER_DEFAULT_TITLE);

Dev1.addweb’s picture

Thanks for confirmation @bisonbleu.

@Scott: Can you please take a pull and commit the patch contributed. Would be awaiting for the credit.

Dev1.addweb’s picture

Status: Needs review » Reviewed & tested by the community

Scott Robertson’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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