Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1046821
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
Sun, Jun 29, 9:52 AM
Size
916 B
Mime Type
text/x-diff
Expires
Mon, Jun 30, 9:52 AM (6 h, 40 m)
Engine
blob
Format
Raw Data
Handle
676797
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