Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CountString $Url param not passed through Url() #1904

Closed
x00 opened this issue May 6, 2014 · 0 comments · Fixed by #4057
Closed

CountString $Url param not passed through Url() #1904

x00 opened this issue May 6, 2014 · 0 comments · Fixed by #4057

Comments

@x00
Copy link
Contributor

x00 commented May 6, 2014

   function CountString($Number, $Url = '', $Options = array()) {
      if (is_string($Options))
         $Options = array('cssclass' => $Options);
      $Options = array_change_key_case($Options);
      $CssClass = GetValue('cssclass', $Options, '');

      if ($Number === NULL && $Url) {
         $CssClass = ConcatSep(' ', $CssClass, 'Popin TinyProgress');
         $Url = htmlspecialchars($Url);
         $Result = "<span class=\"$CssClass\" rel=\"$Url\"></span>";
      } elseif ($Number) {
         $Result = " <span class=\"Count\">$Number</span>";
      } else {
         $Result = '';
      }
      return $Result;
   }

In applications/vanilla/settings/class.hooks.php you have

 $CommentsLabel .= '<span class="Aside">'.CountString(GetValueR('User.CountComments', $Sender, NULL), "/profile/count/comments?userid=$UserID").'</span>';

With Popin this can cause rendering issues, where the forum is not on root. It will try pull content that may not exist or not to do with vanilla, and insert it in the page.

Probably want to do this

$Url = htmlspecialchars(Url($Url));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants