| @@ -63,8 +63,15 @@ | ||
| 63 | 63 | */ |
| 64 | 64 | public $body; |
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | + * Ticket object this notification is for | |
| 68 | + * | |
| 69 | + * @var WPSC_Ticket | |
| 70 | + */ | |
| 71 | + public $ticket; | |
| 72 | + | |
| 73 | + /** | |
| 67 | 74 | * Email notification template |
| 68 | 75 | * |
| 69 | 76 | * @var Array |
| 70 | 77 | */ |
| @@ -210,10 +217,17 @@ | ||
| 210 | 217 | if ( ! file_exists( $filepath ) ) { |
| 211 | 218 | mkdir( $filepath, 0777, true ); |
| 212 | 219 | } |
| 213 | 220 | $filepath .= '/' . $attachment->name; |
| 214 | - copy( $upload_dir['basedir'] . $attachment->file_path, $filepath ); | |
| 215 | - $attachments[] = $filepath; | |
| 221 | + | |
| 222 | + $source = wp_normalize_path( $attachment->file_path ); | |
| 223 | + if ( ! is_file( $source ) ) { | |
| 224 | + $source = trailingslashit( wp_normalize_path( $upload_dir['basedir'] ) ) . ltrim( $source, '/\\' ); | |
| 225 | + } | |
| 226 | + | |
| 227 | + if ( is_file( $source ) && copy( $source, $filepath ) ) { | |
| 228 | + $attachments[] = $filepath; | |
| 229 | + } | |
| 216 | 230 | endforeach; |
| 217 | 231 | } |
| 218 | 232 | |
| 219 | 233 | if ( is_rtl() ) { |