Skip to content

Commit 5680528

Browse files
authored
Merge pull request #728 from cakephp/double-wrap-transport
Don't double wrap transports
2 parents 20f2260 + c08193b commit 5680528

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Panel/MailPanel.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,24 @@ public function initialize()
4747

4848
$log = $this->emailLog = new ArrayObject();
4949

50-
foreach ($configs as $name => &$transport) {
50+
foreach ($configs as $name => $transport) {
5151
if (is_object($transport)) {
52-
$configs[$name] = new DebugKitTransport(['debugKitLog' => $log], $transport);
52+
if (!$transport instanceof DebugKitTransport) {
53+
$configs[$name] = new DebugKitTransport(['debugKitLog' => $log], $transport);
54+
}
5355
continue;
5456
}
5557

5658
$className = App::className($transport['className'], 'Mailer/Transport', 'Transport');
57-
58-
if (!$className) {
59+
if (!$className || $className === DebugKitTransport::class) {
5960
continue;
6061
}
6162

6263
$transport['originalClassName'] = $transport['className'];
6364
$transport['className'] = 'DebugKit.DebugKit';
6465
$transport['debugKitLog'] = $log;
66+
67+
$configs[$name] = $transport;
6568
}
6669
$property->setValue($configs);
6770
}

0 commit comments

Comments
 (0)