diff options
| author | 2013-11-11 20:56:47 +0100 | |
|---|---|---|
| committer | 2013-11-11 20:56:47 +0100 | |
| commit | 396fefeae1f53f09a24e8f7ad891d44124008182 (patch) | |
| tree | 4863d099470188cff9ec2577aa3d498f92fddc03 /app/models/Entry.php | |
| parent | b8821e6b3f94b77033441c193f9e6ea873a2e280 (diff) | |
MySQL : Longueurs maximum des champs texte
Ajout de sécurités pour ne pas dépasser les longueurs de texte déclarées
dans MySQL (varchar ou text selon les champs)
Diffstat (limited to 'app/models/Entry.php')
| -rwxr-xr-x | app/models/Entry.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/models/Entry.php b/app/models/Entry.php index 99edf94b4..94cb6f774 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' => $this->guid (), - 'title' => $this->title (), - 'author' => $this->author (), - 'content' => $this->content (), - 'link' => $this->link (), + '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), 'date' => $this->date (true), 'is_read' => $this->isRead (), 'is_favorite' => $this->isFavorite (), 'id_feed' => $this->feed (), - 'tags' => $this->tags (true) + 'tags' => substr($this->tags (true), 0, 65535), ); } } |
