- code cleanup (mostly whitespaces)
| | |
| | | $n_encoding = NULL, |
| | | $f_encoding = NULL) |
| | | { |
| | | $filedata = ($isfile === true) ? $this->_file2str($file) |
| | | : $file; |
| | | $filedata = ($isfile === true) ? $this->_file2str($file) : $file; |
| | | |
| | | if (PEAR::isError($filedata)) { |
| | | return $filedata; |
| | | } |
| | | |
| | | if ($isfile === true) { |
| | | // Force the name the user supplied, otherwise use $file |
| | | $filename = (strlen($name)) ? $name : $file; |
| | |
| | | return $err; |
| | | } |
| | | $filename = $this->_basename($filename); |
| | | if (PEAR::isError($filedata)) { |
| | | return $filedata; |
| | | } |
| | | |
| | | $this->_parts[] = array( |
| | | 'body' => $filedata, |
| | |
| | | $params['disposition'] = 'inline'; |
| | | $params['dfilename'] = $value['name']; |
| | | $params['cid'] = $value['cid']; |
| | | if ($value['name-encoding']) { |
| | | |
| | | if (!empty($value['name-encoding'])) { |
| | | $params['name-encoding'] = $value['name-encoding']; |
| | | } |
| | | if ($value['filename-encoding']) { |
| | | if (!empty($value['filename-encoding'])) { |
| | | $params['filename-encoding'] = $value['filename-encoding']; |
| | | } |
| | | |
| | |
| | | return $this->_buildRFC2047Param($name, $value, $charset, $paramEnc); |
| | | |
| | | // RFC2231: |
| | | $encValue = preg_replace('#([^\x21,\x23,\x24,\x26,\x2B,\x2D,\x2E,\x30-\x39,\x41-\x5A,\x5E-\x7E])#e', |
| | | '"%" . strtoupper(dechex(ord("\1")))', $value); |
| | | $encValue = preg_replace( |
| | | '#([^\x21,\x23,\x24,\x26,\x2B,\x2D,\x2E,\x30-\x39,\x41-\x5A,\x5E-\x7E])#e', |
| | | '"%" . strtoupper(dechex(ord("\1")))', |
| | | $value); |
| | | $value = "$charset'$language'$encValue"; |
| | | |
| | | $header = " {$name}*={$value};"; |