1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-02-26 23:54:25 +01:00

Merge pull request #266 from owncloud/fix-title-length

increase title size to 4096, and cut title and description before wri…
This commit is contained in:
blizzz 2016-08-07 11:52:43 +02:00 committed by GitHub
commit 1c7a831a3c
3 changed files with 6 additions and 2 deletions

View File

@ -27,7 +27,7 @@
<type>text</type> <type>text</type>
<default></default> <default></default>
<notnull>true</notnull> <notnull>true</notnull>
<length>140</length> <length>4096</length>
</field> </field>
<field> <field>
<name>user_id</name> <name>user_id</name>

View File

@ -6,7 +6,7 @@
<licence>AGPL</licence> <licence>AGPL</licence>
<author>Arthur Schiwon, Marvin Thomas Rabe, Stefan Klemm</author> <author>Arthur Schiwon, Marvin Thomas Rabe, Stefan Klemm</author>
<standalone/> <standalone/>
<version>0.8</version> <version>0.8.1</version>
<documentation> <documentation>
<user>https://doc.owncloud.org/server/9.0/user_manual/bookmarks.html</user> <user>https://doc.owncloud.org/server/9.0/user_manual/bookmarks.html</user>
</documentation> </documentation>

View File

@ -434,6 +434,10 @@ class Bookmarks {
} }
$enc_url_noprefix = htmlspecialchars_decode($url_without_prefix); $enc_url_noprefix = htmlspecialchars_decode($url_without_prefix);
$enc_url = htmlspecialchars_decode($url); $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 // Change lastmodified date if the record if already exists
$sql = "SELECT * from `*PREFIX*bookmarks` WHERE `url` like ? AND `user_id` = ?"; $sql = "SELECT * from `*PREFIX*bookmarks` WHERE `url` like ? AND `user_id` = ?";
$query = $db->prepareQuery($sql, 1); $query = $db->prepareQuery($sql, 1);