diff options
| -rwxr-xr-x | app/models/Entry.php | 22 | ||||
| -rw-r--r-- | app/models/Feed.php | 8 | ||||
| -rw-r--r-- | public/install.php | 26 |
3 files changed, 28 insertions, 28 deletions
diff --git a/app/models/Entry.php b/app/models/Entry.php index 94cb6f774..d03c3a3c1 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -179,16 +179,16 @@ class Entry extends Model { public function toArray () { return array ( 'id' => $this->id (), - 'guid' => substr($this->guid (), 0, 65535), - 'title' => substr($this->title (), 0, 255), - 'author' => substr($this->author (), 0, 255), - 'content' => substr($this->content (), 0, 65535), - 'link' => substr($this->link (), 0, 65535), + 'guid' => $this->guid (), + 'title' => $this->title (), + 'author' => $this->author (), + 'content' => $this->content (), + 'link' => $this->link (), 'date' => $this->date (true), 'is_read' => $this->isRead (), 'is_favorite' => $this->isFavorite (), 'id_feed' => $this->feed (), - 'tags' => substr($this->tags (true), 0, 65535), + 'tags' => $this->tags (true), ); } } @@ -200,16 +200,16 @@ class EntryDAO extends Model_pdo { $values = array ( $valuesTmp['id'], - $valuesTmp['guid'], - $valuesTmp['title'], - $valuesTmp['author'], + substr($valuesTmp['guid'], 0, 511), + substr($valuesTmp['title'], 0, 255), + substr($valuesTmp['author'], 0, 255), base64_encode (gzdeflate (serialize ($valuesTmp['content']))), - $valuesTmp['link'], + substr($valuesTmp['link'], 0, 1023), $valuesTmp['date'], $valuesTmp['is_read'], $valuesTmp['is_favorite'], $valuesTmp['id_feed'], - $valuesTmp['tags'], + substr($valuesTmp['tags'], 0, 1023), ); if ($stm && $stm->execute ($values)) { diff --git a/app/models/Feed.php b/app/models/Feed.php index 41750d43e..c6ebc9caf 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -309,11 +309,11 @@ class FeedDAO extends Model_pdo { $values = array ( $valuesTmp['id'], - $valuesTmp['url'], + substr($valuesTmp['url'], 0, 511), $valuesTmp['category'], - $valuesTmp['name'], - $valuesTmp['website'], - $valuesTmp['description'], + substr($valuesTmp['name'], 0, 255), + substr($valuesTmp['website'], 0, 255), + substr($valuesTmp['description'], 0, 1023), $valuesTmp['lastUpdate'], base64_encode ($valuesTmp['httpAuth']), ); diff --git a/public/install.php b/public/install.php index ec7d50fbd..dd9846fe5 100644 --- a/public/install.php +++ b/public/install.php @@ -11,7 +11,7 @@ if (isset ($_GET['step'])) { define ('SQL_REQ_CREATE_DB', 'CREATE DATABASE %s DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); define ('SQL_REQ_CAT', 'CREATE TABLE IF NOT EXISTS `%scategory` ( - `id` varchar(6) NOT NULL, + `id` char(6) NOT NULL, `name` varchar(255) NOT NULL, `color` varchar(7) NOT NULL, PRIMARY KEY (`id`), @@ -19,16 +19,16 @@ define ('SQL_REQ_CAT', 'CREATE TABLE IF NOT EXISTS `%scategory` ( );'); define ('SQL_REQ_FEED', 'CREATE TABLE IF NOT EXISTS `%sfeed` ( - `id` varchar(6) NOT NULL, - `url` text NOT NULL, - `category` varchar(6) DEFAULT \'000000\', + `id` char(6) NOT NULL, + `url` varchar(511) NOT NULL, + `category` char(6) DEFAULT \'000000\', `name` varchar(255) NOT NULL, - `website` text NOT NULL, - `description` text NOT NULL, + `website` varchar(255) NOT NULL, + `description` varchar(1023) NOT NULL, `lastUpdate` int(11) NOT NULL, `priority` tinyint NOT NULL DEFAULT \'10\', - `pathEntries` varchar(500) DEFAULT NULL, - `httpAuth` varchar(500) DEFAULT NULL, + `pathEntries` varchar(511) DEFAULT NULL, + `httpAuth` varchar(511) DEFAULT NULL, `error` boolean NOT NULL DEFAULT \'0\', `keep_history` boolean NOT NULL DEFAULT \'0\', PRIMARY KEY (`id`), @@ -39,17 +39,17 @@ define ('SQL_REQ_FEED', 'CREATE TABLE IF NOT EXISTS `%sfeed` ( );'); define ('SQL_REQ_ENTRY', 'CREATE TABLE IF NOT EXISTS `%sentry` ( - `id` varchar(6) NOT NULL, - `guid` text NOT NULL, + `id` char(6) NOT NULL, + `guid` varchar(511) NOT NULL, `title` varchar(255) NOT NULL, `author` varchar(255) NOT NULL, `content` text NOT NULL, - `link` text NOT NULL, + `link` varchar(1023) NOT NULL, `date` int(11) NOT NULL, `is_read` boolean NOT NULL DEFAULT \'0\', `is_favorite` boolean NOT NULL DEFAULT \'0\', - `id_feed` varchar(6) NOT NULL, - `tags` text NOT NULL, + `id_feed` char(6) NOT NULL, + `tags` varchar(1023) NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`id_feed`) REFERENCES %sfeed(id) ON DELETE CASCADE ON UPDATE CASCADE, INDEX (`is_favorite`), |
