@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | /** @return string */ |
59 | 59 | public function safeFilename() { |
60 | - if ($filename = $this->filename()) { |
|
60 | + if ( $filename = $this->filename() ) { |
|
61 | 61 | return trim(preg_replace('#_+#', '_', preg_replace('#[^a-z0-9\-_\.]+#i', '', $filename)), '_'); |
62 | 62 | } |
63 | 63 | } |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | |
73 | 73 | /** @return string */ |
74 | 74 | public function decodedContent() { |
75 | - if ($raw = $this->content()) { |
|
76 | - switch ($this->parameter('encoding')) { |
|
75 | + if ( $raw = $this->content() ) { |
|
76 | + switch ( $this->parameter('encoding') ) { |
|
77 | 77 | case ENC7BIT: |
78 | 78 | case ENC8BIT: |
79 | 79 | case ENCQUOTEDPRINTABLE: |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | /** @return bool */ |
91 | - public function saveAttachment($dir, $filenameOverride = null) { |
|
92 | - if ($filename = $this->safeFilename()) { |
|
91 | + public function saveAttachment( $dir, $filenameOverride = null ) { |
|
92 | + if ( $filename = $this->safeFilename() ) { |
|
93 | 93 | $filepath = realpath($dir) . '/' . ($filenameOverride ?? $filename); |
94 | - if (file_put_contents($filepath, $this->decodedContent())) { |
|
94 | + if ( file_put_contents($filepath, $this->decodedContent()) ) { |
|
95 | 95 | return true; |
96 | 96 | } |
97 | 97 | } |