mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-07 15:40:41 -04:00
Catch exceptions from tag::add() that can be caused by character
encoding issues resulting from embedded keywords in encodings we can't decipher. This can lead to weird truncation issues which in turn can lead to multiple tags getting truncated to the same value in MySQL which leads to mysql complaining that we're adding a duplicate tag. Signed-off-by: <unostar@danalan.info>
This commit is contained in:
@@ -45,7 +45,12 @@ class tag_event_Core {
|
||||
|
||||
// @todo figure out how to read the keywords from xmp
|
||||
foreach(array_keys($tags) as $tag) {
|
||||
tag::add($photo, $tag);
|
||||
try {
|
||||
tag::add($photo, $tag);
|
||||
} catch (Exception $e) {
|
||||
Kohana::log("error", "Error adding tag: $tag\n" .
|
||||
$e->getMessage() . "\n" . $e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user