allow to insert files with differing extension but same basename and mimetype
This commit is contained in:
@@ -3,6 +3,10 @@
|
|||||||
Version 1.6 ()
|
Version 1.6 ()
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
* Fixed a bug in synchronizing new files with the same basename
|
||||||
|
but different extensions, where files with the same mimetype
|
||||||
|
would not get added (garvinhicking)
|
||||||
|
|
||||||
* Show subscription status of comments in frontend and backend
|
* Show subscription status of comments in frontend and backend
|
||||||
|
|
||||||
* Added ability to report spam/ham to akismet (Black Warthog)
|
* Added ability to report spam/ham to akismet (Black Warthog)
|
||||||
|
@@ -1152,7 +1152,8 @@ function serendipity_syncThumbs($deleteThumbs = false) {
|
|||||||
$cond = array(
|
$cond = array(
|
||||||
'and' => "WHERE name = '" . serendipity_db_escape_string($fbase) . "'
|
'and' => "WHERE name = '" . serendipity_db_escape_string($fbase) . "'
|
||||||
" . ($fdir != '' ? "AND path = '" . serendipity_db_escape_string($fdir) . "'" : '') . "
|
" . ($fdir != '' ? "AND path = '" . serendipity_db_escape_string($fdir) . "'" : '') . "
|
||||||
AND mime = '" . serendipity_db_escape_string($fdim['mime']) . "'"
|
AND mime = '" . serendipity_db_escape_string($fdim['mime']) . "'
|
||||||
|
AND extension = '" . serendipity_db_escape_string($f[1]) . "'"
|
||||||
);
|
);
|
||||||
serendipity_ACL_SQL($cond, false, 'directory');
|
serendipity_ACL_SQL($cond, false, 'directory');
|
||||||
|
|
||||||
@@ -1161,6 +1162,7 @@ function serendipity_syncThumbs($deleteThumbs = false) {
|
|||||||
{$cond['joins']}
|
{$cond['joins']}
|
||||||
|
|
||||||
{$cond['and']}", true, 'assoc');
|
{$cond['and']}", true, 'assoc');
|
||||||
|
|
||||||
if (is_array($rs)) {
|
if (is_array($rs)) {
|
||||||
// This image is in the database. Check our calculated data against the database data.
|
// This image is in the database. Check our calculated data against the database data.
|
||||||
$update = array();
|
$update = array();
|
||||||
@@ -1187,12 +1189,12 @@ function serendipity_syncThumbs($deleteThumbs = false) {
|
|||||||
|
|
||||||
/* Do the database update, if needed */
|
/* Do the database update, if needed */
|
||||||
if (sizeof($update) != 0) {
|
if (sizeof($update) != 0) {
|
||||||
printf(FOUND_FILE . '<br />', $files[$x]);
|
printf(FOUND_FILE . ' (2)<br />', $files[$x]);
|
||||||
serendipity_updateImageInDatabase($update, $rs['id']);
|
serendipity_updateImageInDatabase($update, $rs['id']);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
printf(FOUND_FILE . '<br />', $files[$x]);
|
printf(FOUND_FILE . ' (1)<br />', $files[$x]);
|
||||||
serendipity_insertImageInDatabase($fbase . '.' . $f[1], $fdir, 0, filemtime($ffull));
|
serendipity_insertImageInDatabase($fbase . '.' . $f[1], $fdir, 0, filemtime($ffull));
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user