Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1102418
D191.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Aug 19, 12:40 AM
Size
916 B
Mime Type
text/x-diff
Expires
Wed, Aug 20, 12:40 AM (12 h, 49 m)
Engine
blob
Format
Raw Data
Handle
714169
Attached To
D191: INP-1529 - Don't attach same file twice to same e-mail
D191.diff
View Options
Index: branches/5.2.x/core/kernel/utility/email_send.php
===================================================================
--- branches/5.2.x/core/kernel/utility/email_send.php
+++ branches/5.2.x/core/kernel/utility/email_send.php
@@ -610,6 +610,24 @@
}
/**
+ * Detects if such part already was added.
+ *
+ * @param array $part_definition Part definition.
+ *
+ * @return boolean
+ */
+ protected function HasPart(array $part_definition)
+ {
+ foreach ( $this->parts as $part ) {
+ if ( $part === $part_definition ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
* Returns text version of HTML document
*
* @param string $html
@@ -780,6 +798,11 @@
}
$definition =& $this->GetFileDefinition($definition);
+
+ if ( $this->HasPart($definition) ) {
+ return false;
+ }
+
$part_number = $this->AddPart($definition);
if ($inline) {
Event Timeline
Log In to Comment