PluginProbe
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent / 3.5.4
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent v3.5.4
3.5.4 3.5.3 3.5.2 3.5.1 3.4.9 3.5.0 3.4.8 3.4.7 trunk 2.3.1 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6
← All changes | includes/class-wpsc-email-notifications.php +16 -2 3.5.1 → 3.5.4 View file →
@@ -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() ) {