| | |
| | | } |
| | | $bytes -= strlen($line); |
| | | |
| | | $line = rtrim($line, "\t\r\n\0\x0B"); |
| | | |
| | | if ($mode == 1) { |
| | | $line = rtrim($line, "\t\r\n\0\x0B"); |
| | | // create chunks with proper length for base64 decoding |
| | | $line = $prev.$line; |
| | | $length = strlen($line); |
| | |
| | | else |
| | | $result .= base64_decode($line); |
| | | } else if ($mode == 2) { |
| | | $line .= $line[sizeof($line)-1] != '=' ? "\n" : ''; |
| | | $line = rtrim($line, "\t\r\0\x0B"); |
| | | if ($file) |
| | | fwrite($file, quoted_printable_decode($line)); |
| | | else if ($print) |
| | |
| | | else |
| | | $result .= quoted_printable_decode($line); |
| | | } else if ($mode == 3) { |
| | | $line = rtrim($line, "\t\r\n\0\x0B"); |
| | | if ($line == 'end' || preg_match('/^begin\s+[0-7]+\s+.+$/', $line)) |
| | | continue; |
| | | if ($file) |
| | |
| | | else |
| | | $result .= convert_uudecode($line); |
| | | } else { |
| | | $line = rtrim($line, "\t\r\n\0\x0B"); |
| | | if ($file) |
| | | fwrite($file, $line . "\n"); |
| | | else if ($print) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // read in anything up until last line |
| | | if (!$end) |
| | | do { |