diff options
Diffstat (limited to 'src/SemanticScuttle/Service/Bookmark.php')
-rw-r--r-- | src/SemanticScuttle/Service/Bookmark.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/SemanticScuttle/Service/Bookmark.php b/src/SemanticScuttle/Service/Bookmark.php index ea8762d..8a8946a 100644 --- a/src/SemanticScuttle/Service/Bookmark.php +++ b/src/SemanticScuttle/Service/Bookmark.php @@ -504,7 +504,9 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService 'bPrivateNote' => $privateNote, 'bStatus' => intval($status), 'bHash' => $this->getHash($address), - 'bShort' => $short + 'bShort' => $short, + 'bVoting' => 0, + 'bVotes' => 0, ); $sql = 'INSERT INTO '. $this->getTableName() @@ -738,7 +740,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService $tags = []; } - $tagcount = count($tags); + $tagcount = empty($tags) ? 0 : count($tags); for ($i = 0; $i < $tagcount; $i ++) { $tags[$i] = trim($tags[$i]); } @@ -861,7 +863,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService } // Search terms in tags as well when none given - if (!count($tags)) { + if (!empty($tags)) { $query_2 .= ' LEFT JOIN '. $b2tservice->getTableName() .' AS T' . ' ON B.bId = T.bId'; $dotags = true; @@ -1144,7 +1146,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService // Delete final / if (substr($address, -1) == '/') { - $address = substr($address, 0, count($address)-2); + $address = substr($address, 0, strlen($address)-2); } return $address; |