@@ -116,6 +116,9 @@ discard block |
||
116 | 116 | $this->unseen = $unseen; |
117 | 117 | } |
118 | 118 | |
119 | + /** |
|
120 | + * @param boolean $clear |
|
121 | + */ |
|
119 | 122 | protected function flags( $flags, $clear ) { |
120 | 123 | $cb = $clear ? 'imap_clearflag_full' : 'imap_setflag_full'; |
121 | 124 | |
@@ -214,6 +217,9 @@ discard block |
||
214 | 217 | return $this->parts; |
215 | 218 | } |
216 | 219 | |
220 | + /** |
|
221 | + * @param string $IMAPMessagePartClass |
|
222 | + */ |
|
217 | 223 | protected function messageParts( $parts, $sectionPrefix = array(), $IMAPMessagePartClass ) { |
218 | 224 | $sectionPrefix = (array)$sectionPrefix; |
219 | 225 | |
@@ -263,6 +269,9 @@ discard block |
||
263 | 269 | return $this->decode($body); |
264 | 270 | } |
265 | 271 | |
272 | + /** |
|
273 | + * @param string $content |
|
274 | + */ |
|
266 | 275 | public function decode( $content ) { |
267 | 276 | return quoted_printable_decode($content); |
268 | 277 | } |
@@ -313,6 +322,9 @@ discard block |
||
313 | 322 | return file_put_contents($filepath, $this->decode($this->content())); |
314 | 323 | } |
315 | 324 | |
325 | + /** |
|
326 | + * @param string $content |
|
327 | + */ |
|
316 | 328 | public function decode( $content ) { |
317 | 329 | return base64_decode($content); |
318 | 330 | } |
@@ -187,8 +187,7 @@ discard block |
||
187 | 187 | foreach ( $structure->parts AS $i => $part ) { |
188 | 188 | if ( 'ALTERNATIVE' == $part->subtype ) { |
189 | 189 | $parts = array_merge($parts, $this->messageParts($part->parts, $i+1, $IMAPMessagePartClass)); |
190 | - } |
|
191 | - else { |
|
190 | + } else { |
|
192 | 191 | $parts[] = new $IMAPMessagePartClass($this, $part, $i+1); |
193 | 192 | |
194 | 193 | if ( $part->ifdisposition && 'ATTACHMENT' == $part->disposition ) { |
@@ -204,8 +203,7 @@ discard block |
||
204 | 203 | foreach ( $parts AS $part ) { |
205 | 204 | if ( 'PLAIN' == $part->subtype && !$this->plainBody ) { |
206 | 205 | $this->plainBody = $part; |
207 | - } |
|
208 | - else if ( 'HTML' == $part->subtype && !$this->HTMLBody ) { |
|
206 | + } else if ( 'HTML' == $part->subtype && !$this->HTMLBody ) { |
|
209 | 207 | $this->HTMLBody = $part; |
210 | 208 | } |
211 | 209 | } |
@@ -100,8 +100,7 @@ |
||
100 | 100 | $body = imap_fetchbody($mbox, $msgNum, (string)($partNum+1)); |
101 | 101 | |
102 | 102 | return trim($body); |
103 | - } |
|
104 | - else if ( 'ALTERNATIVE' == $part->subtype && isset($part->parts) ) { |
|
103 | + } else if ( 'ALTERNATIVE' == $part->subtype && isset($part->parts) ) { |
|
105 | 104 | foreach ( $part->parts AS $subPartNum => $subPart ) { |
106 | 105 | if ( 'PLAIN' == $subPart->subtype ) { |
107 | 106 | $body = imap_fetchbody($mbox, $msgNum, ($partNum+1).'.'.($subPartNum+1)); |
@@ -41,8 +41,7 @@ |
||
41 | 41 | echo "SUBMIT URL: "; |
42 | 42 | if ( $rsp ) { |
43 | 43 | var_dump(strlen($rsp)); |
44 | - } |
|
45 | - else { |
|
44 | + } else { |
|
46 | 45 | echo "FAIL\n"; |
47 | 46 | $message->unflag('seen'); |
48 | 47 | } |