Disable links to username and date One of my tasks requires me to disable the links to username and date fields generated from diff_diffs_show() whose output is rendered as in the following screenshot.



The code outputting those links is the following one.
// Generate table header (date, username, log message).
$old_header = t('!date by !username', array(
  '!date' =&gt; l(format_date($old_node-&gt;revision_timestamp), &quot;node/$node-&gt;nid/revisions/$old_node-&gt;vid/view&quot;, array('absolute' =&gt; 1)),
  '!username' =&gt; theme('username', array('account' =&gt; $node_revisions[$old_vid])),
));
$new_header = t('!date by !username', array(
  '!date' =&gt; l(format_date($new_node-&gt;revision_timestamp), &quot;node/$node-&gt;nid/revisions/$new_node-&gt;vid/view&quot;, array('absolute' =&gt; 1)),
  '!username' =&gt; theme('username', array('account' =&gt; $node_revisions[$new_vid])),
));

How I can change the output of the function so that it doesn't output links?
Basically, I want the username  and date fields in plain texts instead of links.
diff_diffs_show() is the page callback for the node/%node/revisions/view route. The only way to change the output for that route is changing the page callback with hook_menu_alter().
function mymodule_menu_alter(&amp;$items) {
  $items['node/%node/revisions/view']['page callback'] = 'mymodule_diffs_show';
}

function mymodule_diffs_show($node, $old_vid, $new_vid, $state = NULL) {
  // Attaches the CSS.
  $build['#attached'] = diff_build_attachments();

  $default_state = variable_get('diff_default_state_node', 'raw');
  if (empty($state)) {
    $state = $default_state;
  }
  $state = str_replace('-', '_', $state);
  if (!array_key_exists($state, diff_available_states())) {
    $state = $default_state;
  }

  // Same title as the 'Revisions' tab. Blocked by non-page requests.
  if (node_is_page($node)) {
    drupal_set_title(t('Revisions for %title', array('%title' =&gt; $node-&gt;title)), PASS_THROUGH);
  }
  $node_revisions = node_revision_list($node);

  $old_node = node_load($node-&gt;nid, $old_vid);
  $new_node = node_load($node-&gt;nid, $new_vid);

  // Generate table header (date, username, log message).
  $old_header = t('!date by !username', array(
    '!date' =&gt; format_date($old_node-&gt;revision_timestamp),
    '!username' =&gt; format_username($node_revisions[$old_vid]),
  ));
  $new_header = t('!date by !username', array(
    '!date' =&gt; (format_date($new_node-&gt;revision_timestamp),
    '!username' =&gt; format_username($node_revisions[$new_vid]),
  ));

  $old_log = $old_node-&gt;log != '' ? '&lt;p class=&quot;revision-log&quot;&gt;' . filter_xss($old_node-&gt;log) . '&lt;/p&gt;' : '';
  $new_log = $new_node-&gt;log != '' ? '&lt;p class=&quot;revision-log&quot;&gt;' . filter_xss($new_node-&gt;log) . '&lt;/p&gt;' : '';

  // Generate previous diff/next diff links.
  $nav_suffix = ($default_state != $state) ? '/' . str_replace('_', '-', $state) : '';
  $next_vid = _diff_get_next_vid($node_revisions, $new_vid);
  if ($next_vid) {
    $next_link = l(t('Next difference &gt;'), 'node/' . $node-&gt;nid . '/revisions/view/' . $new_vid . '/' . $next_vid . $nav_suffix, array('absolute' =&gt; 1));
  }
  else {
    $next_link = '';
  }
  $prev_vid = _diff_get_previous_vid($node_revisions, $old_vid);
  if ($prev_vid) {
    $prev_link = l(t('&lt; Previous difference'), 'node/' . $node-&gt;nid . '/revisions/view/' . $prev_vid . '/' . $old_vid . $nav_suffix, array('absolute' =&gt; 1));
  }
  else {
    $prev_link = '';
  }

  $header = _diff_default_header($old_header, $new_header);
  $rows = array();
  if ($old_log || $new_log) {
    $rows['logs'] = array(
      array(
        'data' =&gt; $old_log,
        'colspan' =&gt; 2,
      ),
      array(
        'data' =&gt; $new_log,
        'colspan' =&gt; 2,
      ),
    );
  }
  $rows['navigation'] = array(
    array(
      'data' =&gt; $prev_link,
      'class' =&gt; array('diff-prevlink'),
      'colspan' =&gt; 2,
    ),
    array(
      'data' =&gt; $next_link,
      'class' =&gt; array('diff-nextlink'),
      'colspan' =&gt; 2,
    ),
  );

  $links = array();
  foreach (diff_available_states('node') as $alternative_state =&gt; $label) {
    $links[$alternative_state] = array(
      'title' =&gt; $label,
      'href' =&gt; &quot;node/{$node-&gt;nid}/revisions/view/{$old_vid}/{$new_vid}&quot; . ($alternative_state == $default_state ? '' : '/' . str_replace('_', '-', $alternative_state)),
    );
  }
  if (count($links) &gt; 1) {
    $state_links = theme('links', array(
      'links' =&gt; $links,
      'attributes' =&gt; array('class' =&gt; array('links', 'inline')),
    ));
    $rows['states'] = array(
      array(
        'data' =&gt; $state_links,
        'class' =&gt; 'diff-links',
        'colspan' =&gt; 4,
      ),
    );
  }
  $rows = array_merge($rows, _diff_body_rows($old_node, $new_node, $state));

  $build['diff_table'] = array(
    '#theme' =&gt; 'table__diff__standard',
    '#header' =&gt; $header,
    '#rows' =&gt; $rows,
    '#attributes' =&gt; array('class' =&gt; array('diff')),
    '#colgroups' =&gt; _diff_default_cols(),
    '#sticky' =&gt; FALSE,
  );

  // Allow users to hide or set the display mode of the preview.
  if (node_is_page($node) &amp;&amp; $view_mode = variable_get('diff_view_mode_preview_node_' . $new_node-&gt;type, 'full')) {
    $header = '';
    if ($node-&gt;vid == $new_vid) {
      $header .= '&lt;div class=&quot;diff-section-title&quot;&gt;' . t('Current revision:') . '&lt;/div&gt;';
    }
    else {
      $header .= '&lt;div class=&quot;diff-section-title&quot;&gt;' . t('Revision of @new_date:', array('@new_date' =&gt; format_date($new_node-&gt;revision_timestamp))) . '&lt;/div&gt;';
    }
    $build['diff_preview']['header']['#markup'] = $header;
    // Don't include node links or comments when viewing the diff.
    $build['diff_preview']['content'] = function_exists('entity_view') ? entity_view('node', array($new_node), $view_mode) : node_view($new_node, $view_mode);
    if (isset($build['diff_preview']['content']['links'])) {
      unset($build['diff_preview']['content']['links']);
    }
    if (isset($build['diff_preview']['content']['comments'])) {
      unset($build['diff_preview']['content']['comments']);
    }
  }
  return $build;
}

The part getting the username is simplified: The code should check the username length, and truncate it if it's longer than 20 characters; the username should also be sanitized via check_plain().
See template_preprocess_username() to understand how that can be implemented.
I would rather not implement the code shown in this answer, since:

The node/%node/revisions/view route is accessible by the users who have the administer nodes permission, who should be allowed to see any link to revision pages
The users without the access user profiles permission wouldn't see links to user accounts in any case, but the users with the administer users permission should be allowed to see link to user accounts in any page, as that simplifies their work