Skip to content
Snippets Groups Projects
Commit e3219829 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge branch '1.10.x' into develop-next

Conflicts:
	WHATSNEW.md
	include/class.dept.php
	include/staff/department.inc.php
	include/staff/tickets.inc.php
parents 3db4163a 035fd0af
No related branches found
Tags v1.11.0-rc1
No related merge requests found
...@@ -66,6 +66,19 @@ osTicket 1.11.0-rc.1 ...@@ -66,6 +66,19 @@ osTicket 1.11.0-rc.1
* Add Custom Forms to Ticket Filter Data * Add Custom Forms to Ticket Filter Data
* Fix for LDAP/AD auth plugin (#4198, #3460, #3544, #3549) * Fix for LDAP/AD auth plugin (#4198, #3460, #3544, #3549)
osTicket v1.10.4
================
### Enhancements
* issue: Auto-Assignment Log (#4316)
* issue: Language Pack Locale Mismatch (#4326)
* issue: CLI Deploy Missing Bootstrap (#4332)
* issue: User Import No Email (#4330)
* issue: Ticket Lock On Disable (#4335)
### Performance and Security
* security: Fix Multiple XSS Vulnerabilities (#4331)
* department: Error Feedback (#4331)
osTicket v1.10.3 osTicket v1.10.3
================ ================
### Enhancements ### Enhancements
......
...@@ -636,20 +636,17 @@ class AttachmentFile extends VerySimpleModel { ...@@ -636,20 +636,17 @@ class AttachmentFile extends VerySimpleModel {
* canned-response, or faq point to any more. * canned-response, or faq point to any more.
*/ */
static function deleteOrphans() { static function deleteOrphans() {
$sql = "SELECT `id` FROM ".FILE_TABLE.
// XXX: Allow plugins to define filetypes which do not represent " A1 WHERE (A1.ft = 'T' AND A1.created < NOW() - INTERVAL 1 DAY)".
// files attached to tickets or other things in the attachment " AND NOT EXISTS (SELECT id FROM ".ATTACHMENT_TABLE.
// table and are not logos " A2 WHERE A1.`id` = A2.`file_id`)";
$files = static::objects()
->filter(array( if (($res=db_query($sql)) && db_num_rows($res)) {
'attachments__object_id__isnull' => true, while (list($id) = db_fetch_row($res)) {
'ft' => 'T', if ($f = static::lookup((int) $id))
'created__lt' => SqlFunction::NOW()->minus(SqlInterval::DAY(1)), if (!$f->delete())
)); break;
}
foreach ($files as $f) {
if (!$f->delete())
break;
} }
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment