Skip to content
This repository was archived by the owner on Apr 16, 2019. It is now read-only.

Commit 259874b

Browse files
committed
Fixed fatal error when liking a script.
1 parent a470031 commit 259874b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

assets/scriptrepo.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,7 @@ public function getVariables($path){
667667
$queryLike = $this->queryDatabase("SELECT * FROM repo_likes WHERE pubID='$pubID' AND author='$user'");
668668
if($queryLike->num_rows==0){
669669
$existRow = $existQuery->fetch_assoc();
670-
if(!isset($existRow)){ $existRow=0; }
671-
$this->queryDatabase("UPDATE repo_entries SET likes='".($existRow+1)."' WHERE pubID='$pubID'");
670+
$this->queryDatabase("UPDATE repo_entries SET likes='".($existRow['likes']+1)."' WHERE pubID='$pubID'");
672671
$this->queryDatabase("INSERT INTO repo_likes (id, pubID, author) VALUES ('NULL', '$pubID', '$user')");
673672
$_SESSION['viewSuccess'] = "You have successfully liked this script.";
674673
}

0 commit comments

Comments
 (0)