[buddypress-trac] [BuddyPress Trac] #8283: Bug in groups count
buddypress-trac
noreply at wordpress.org
Sat Apr 25 12:20:09 UTC 2020
#8283: Bug in groups count
--------------------------+-----------------------------
Reporter: etatus | Owner: (none)
Type: defect (bug) | Status: new
Priority: high | Milestone: Awaiting Review
Component: Templates | Version: 5.2.0
Severity: major | Keywords:
--------------------------+-----------------------------
There is a bug in the groups counter when the number of groups is greater
than 999, becasue the thousand separator is not well managed and the
number is trunked because the separator is considered as a decimal number.
Possible fix (Buddypress 5.2.0):
In file:
**buddypress/bp-templates/bp-nouveau/includes/template-tags.php**
Line 1247:
{{{
$count = (int) $nav_item->count;
}}}
should be:
{{{
$count = (int) filter_var($nav_item->count, FILTER_SANITIZE_NUMBER_INT);
}}}
Line 1260:
{{{
$count = (int) substr( $nav_item->name, $count_start, $count_end -
$count_start );
}}}
should be:
{{{
$count = (int) filter_var(substr( $nav_item->name, $count_start,
$count_end - $count_start ), FILTER_SANITIZE_NUMBER_INT);
}}}
----
--> Maybe Legacy template also needs to be fixed.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8283>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list