diff options
Diffstat (limited to 'src/SemanticScuttle')
-rw-r--r-- | src/SemanticScuttle/Service/Bookmark.php | 6 | ||||
-rw-r--r-- | src/SemanticScuttle/Service/User.php | 20 | ||||
-rw-r--r-- | src/SemanticScuttle/header.php | 10 |
3 files changed, 23 insertions, 13 deletions
diff --git a/src/SemanticScuttle/Service/Bookmark.php b/src/SemanticScuttle/Service/Bookmark.php index 39ec4f0..17f91b1 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, + 'bVotes' => 0, + 'bVoting' => 0, ); $sql = 'INSERT INTO '. $this->getTableName() @@ -1136,7 +1138,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService // Delete final / if (substr($address, -1) == '/') { - $address = substr($address, 0, strlen($address)-2); + $address = substr($address, 0, -1); } return $address; diff --git a/src/SemanticScuttle/Service/User.php b/src/SemanticScuttle/Service/User.php index 917c7c9..68e8c11 100644 --- a/src/SemanticScuttle/Service/User.php +++ b/src/SemanticScuttle/Service/User.php @@ -103,7 +103,15 @@ class SemanticScuttle_Service_User extends SemanticScuttle_DbService GENERAL_ERROR, 'Could not get user', '', __LINE__, __FILE__, $query, $this->db ); - return false; + return [ 'uId' => 0, + 'username' => '', + 'name' => '', + 'email' => '', + 'homepage' => '', + 'content' => '', + 'datetime' => NULL, + 'isAdmin' => false, + 'privateKeey' => '' ]; } $row = $this->db->sql_fetchrow($dbresult); @@ -111,7 +119,15 @@ class SemanticScuttle_Service_User extends SemanticScuttle_DbService if ($row) { return $row; } else { - return false; + return [ 'uId' => 0, + 'username' => '', + 'name' => '', + 'email' => '', + 'homepage' => '', + 'content' => '', + 'datetime' => NULL, + 'isAdmin' => false, + 'privateKeey' => '' ]; } } diff --git a/src/SemanticScuttle/header.php b/src/SemanticScuttle/header.php index 562ae43..bbe35bc 100644 --- a/src/SemanticScuttle/header.php +++ b/src/SemanticScuttle/header.php @@ -158,15 +158,7 @@ $tplVars['userservice'] = $userservice; if (!defined('UNIT_TEST_MODE') || defined('HTTP_UNIT_TEST_MODE')) { //API files define that, so we need a way to support both of them if (!isset($httpContentType)) { - if (DEBUG_MODE) { - //using that mime type makes all javascript nice in Chromium - // it also serves as test base if the pages really validate - $httpContentType = 'application/xhtml+xml'; - } else { - //until we are sure that all pages validate, we - // keep the non-strict mode on for normal installations - $httpContentType = 'text/html'; - } + $httpContentType = 'text/html'; } if ($httpContentType !== false) { header('Content-Type: ' . $httpContentType . '; charset=utf-8'); |