When i try to translate on /admin/build/translate page this string:
Published by !username on !datetime
then i get this error message:
"The submitted string contains disallowed HTML: ..."

Comments

Benwick’s picture

the string again:
Published by <span class="author">!username</span> on <time datetime="!fulldatetime">!datetime</time>

andregriffin’s picture

Whoops. Try replacing the functions with these:

/**
 * Allow theming of publishing information.
 */
function framework_node_submitted($node) {
  return t('Published by !username on !datetime',
    array(
      '!username' => '<span class="author">'. theme('username', $node). '</span>',
      '!datetime' => '<time datetime="!fulldatetime">'. format_date($node->created). '</time>',
      '!fulldatetime' => format_date($node->created, 'custom', 'Y-m-d\TH:i:sZ')
    ));
}

function framework_comment_submitted($comment) {
  return t('!username | !datetime',
    array(
      '!username' => '<span class="author">'. theme('username', $comment). '</span>',
      '!datetime' => '<time datetime="!fulldatetime">'. format_date($comment->timestamp). '</time>',
      '!fulldatetime' => format_date($comment->created, 'custom', 'Y-m-d\TH:i:sZ')
    ));
}

Let me know if that fixes the problem!

Benwick’s picture

Status: Active » Reviewed & tested by the community

yes,
it works properly.

tnx

andregriffin’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

ledo’s picture

Component: Code » CSS/HTML markup

For me works perfect without any errors in HTML 5 validator.w3.org :

/**
 * Allow theming of publishing information.
 */
function framework_node_submitted($node) {
  return t('Published by !username on !datetime',
    array(
      '!username' => '<span class="author">'. theme('username', $node). '</span>',
      '!datetime' => '<time datetime="'. format_date($node->created, 'custom', 'Y-m-d\TH:i:s'). '">'. format_date($node->created). '</time>',
      '!fulldatetime' => format_date($node->created, 'custom', 'Y-m-d\TH:i:s')
    ));
}

function framework_comment_submitted($comment) {
  return t('!username | !datetime',
    array(
      '!username' => '<span class="author">'. theme('username', $comment). '</span>',
      '!datetime' => '<time datetime="'. format_date($node->created, 'custom', 'Y-m-d\TH:i:s'). '">'. format_date($comment->timestamp). '</time>',
      '!fulldatetime' => format_date($comment->created, 'custom', 'Y-m-d\TH:i:s')
    ));
}