@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | public function queueMessage(Swift_Mime_Message $message) |
98 | 98 | { |
99 | 99 | $ser = serialize($message); |
100 | - $fileName = $this->_path . '/' . $this->getRandomString(); |
|
100 | + $fileName = $this->_path.'/'.$this->getRandomString(); |
|
101 | 101 | for ($i = 0; $i < $this->_retryLimit; ++$i) { |
102 | 102 | /* We try an exclusive creation of the file. This is an atomic operation, it avoid locking mechanism */ |
103 | 103 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
104 | - $fp = @fopen($fileName . '.message', 'xb'); |
|
104 | + $fp = @fopen($fileName.'.message', 'xb'); |
|
105 | 105 | if (false !== $fp) { |
106 | 106 | if (false === fwrite($fp, $ser)) { |
107 | 107 | return false; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
160 | - $failedRecipients = (array)$failedRecipients; |
|
160 | + $failedRecipients = (array) $failedRecipients; |
|
161 | 161 | $count = 0; |
162 | 162 | $time = time(); |
163 | 163 | foreach ($directoryIterator as $file) { |
@@ -168,13 +168,13 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | /* We try a rename, it's an atomic operation, and avoid locking the file */ |
171 | - if (rename($file, $file . '.sending')) { |
|
171 | + if (rename($file, $file.'.sending')) { |
|
172 | 172 | // TODO: -> SECURITY | Perhaps it's possible to exploit the unserialize via: file_get_contents(...) |
173 | - $message = unserialize(file_get_contents($file . '.sending')); |
|
173 | + $message = unserialize(file_get_contents($file.'.sending')); |
|
174 | 174 | |
175 | 175 | $count += $transport->send($message, $failedRecipients); |
176 | 176 | |
177 | - unlink($file . '.sending'); |
|
177 | + unlink($file.'.sending'); |
|
178 | 178 | } else { |
179 | 179 | /* This message has just been catched by another process */ |
180 | 180 | continue; |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $ret = ''; |
212 | 212 | $strlen = strlen($base) - 1; |
213 | 213 | for ($i = 0; $i < $count; ++$i) { |
214 | - $ret .= $base[(int)mt_rand(0, $strlen)]; |
|
214 | + $ret .= $base[(int) mt_rand(0, $strlen)]; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | return $ret; |