Skip to content

Commit 27499f9

Browse files
authored
Merge pull request #738 from pupi1985/patch-129
Fix negative upvoteCount wrongly displayed
2 parents cca361f + 9e07a03 commit 27499f9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

qa-include/app/format.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ function qa_post_html_fields($post, $userid, $cookieid, $usershtml, $dummy, $opt
495495

496496
// schema.org microdata - vote display might be formatted (e.g. '2k') so we use meta tag for true count
497497
if ($microdata) {
498-
$fields['netvotes_view']['suffix'] .= ' <meta itemprop="upvoteCount" content="' . qa_html($netvotes) . '"/>';
498+
$fields['netvotes_view']['suffix'] .= ' <meta itemprop="upvoteCount" content="' . qa_html($upvotes - $downvotes) . '"/>';
499499
$fields['upvotes_view']['suffix'] .= ' <meta itemprop="upvoteCount" content="' . qa_html($upvotes) . '"/>';
500500
}
501501

0 commit comments

Comments
 (0)