From fbf50e85a9d6a41d59ba1abde289492253cc4901 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Sat, 6 Aug 2016 01:10:10 +0200 Subject: [PATCH] increase title size to 4096, and cut title and description before writing to DB --- appinfo/database.xml | 2 +- appinfo/info.xml | 2 +- controller/lib/bookmarks.php | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/appinfo/database.xml b/appinfo/database.xml index 923e50c6..004cd33e 100644 --- a/appinfo/database.xml +++ b/appinfo/database.xml @@ -27,7 +27,7 @@ text true - 140 + 4096 user_id diff --git a/appinfo/info.xml b/appinfo/info.xml index 4a1a744c..4ff78f9a 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -6,7 +6,7 @@ AGPL Arthur Schiwon, Marvin Thomas Rabe, Stefan Klemm - 0.8 + 0.8.1 https://doc.owncloud.org/server/9.0/user_manual/bookmarks.html diff --git a/controller/lib/bookmarks.php b/controller/lib/bookmarks.php index 3d5d9d65..eb6fd3cb 100644 --- a/controller/lib/bookmarks.php +++ b/controller/lib/bookmarks.php @@ -434,6 +434,10 @@ class Bookmarks { } $enc_url_noprefix = htmlspecialchars_decode($url_without_prefix); $enc_url = htmlspecialchars_decode($url); + + $title = mb_substr($title, 0, 4096); + $description = mb_substr($description, 0, 4096); + // Change lastmodified date if the record if already exists $sql = "SELECT * from `*PREFIX*bookmarks` WHERE `url` like ? AND `user_id` = ?"; $query = $db->prepareQuery($sql, 1);