mybbgroup / Thank-you-like-system

Thank you/Like system with MyAlerts support
https://mybb.group/Thread-Thank-you-like-system
GNU General Public License v3.0
11 stars 12 forks source link

Reputation not added in some cases #229

Closed panayotb closed 4 years ago

panayotb commented 4 years ago

In some cases (for example from Tapatalk) when a thank is given, reputation points are not added. I found that the problem is in thankyoulike.php

Reputation points are given on line 280: https://github.com/mybbgroup/Thank-you-like-system/blob/master/thankyoulike.php#L280

But this line is unreachable because of the code above the reputation block (when execution goes to the "else" statement:

if($mybb->input['ajax'])
{
    // Do nothing here
}
else
{
    // Go back to the post
    $url = get_post_link($pid, $tid)."#pid{$pid}";
    redirect($url, $lang->sprintf($lang->tyl_redirect_tyled, $pre).$lang->tyl_redirect_back);
    exit;
}

Above code needs to be after reputation block.

Same thing happens when deleting reputation.

If you wonder how tapatalk gets to the else statement, it does the following:

$_GET['action'] = 'add';
include('thankyoulike.php');
SvePu commented 4 years ago

@Eldenroot : Pls test changes

Eldenroot commented 4 years ago

@SvePu - do you plan to add anything else to this fix? Or to anything else reported here in GitHub issues list?