Skip to content

VIEWING_RECENT_TOPICS lang string leaves a literal %s inside a nested link on Who Is Online #199

Description

@avandenberghe

Summary

language/en/recenttopics.php defines:

'VIEWING_RECENT_TOPICS' => 'Viewing <a href="%s">Recent Topics</a>',

but event/listener.php::viewonline_overwrite_location() calls it with no argument:

$event['location'] = $this->language->lang('VIEWING_RECENT_TOPICS');
$event['location_url'] = $this->helper->route(...);

Core's Who Is Online page already wraps location in its own <a href="{U_LOCATION}"> using the separately-provided location_url/U_LOCATION. Since lang() is called with no %s argument, the literal string %s is left inside the <a href="%s"> markup, which then renders nested inside core's own link — producing a broken/empty inner anchor with a stray "%s" instead of a clean "Viewing Recent Topics" label.

Location

  • avathar/recenttopics/language/en/recenttopics.php: VIEWING_RECENT_TOPICS string
  • avathar/recenttopics/event/listener.php, viewonline_overwrite_location() (~lines 132, 137): calls lang('VIEWING_RECENT_TOPICS') with no args, sets location_url separately

Fix

Change VIEWING_RECENT_TOPICS to a plain string with no markup/placeholder (e.g. 'Viewing Recent Topics'), since location_url already supplies the link core wraps it in. Same applies to any other language file with the same <a href="%s"> pattern for this key.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcosmeticv3.0Version 3.0.x - maintenance releases

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions