From 01c0906e24b7e6b257f608ebfaffe767afab6824 Mon Sep 17 00:00:00 2001 From: popforce <34042911+popforce@users.noreply.github.com> Date: Fri, 9 Feb 2024 09:43:35 +0100 Subject: [PATCH] Fix double slashes in meta location --- include/class-job-application-submit.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/class-job-application-submit.php b/include/class-job-application-submit.php index d9e199d..3e430e4 100644 --- a/include/class-job-application-submit.php +++ b/include/class-job-application-submit.php @@ -615,7 +615,8 @@ public static function relocate_file( $key, $entry_data, $attachment_id = 0, $en $file_path = get_attached_file( $attachment_id ); $timestamp = time(); $filename = $timestamp . '-' . basename ( $file_path ); - $new_file_location = $filedir .'/' . $filename; + //rtrim to fix double slashes added to meta JOBPOSTINGSFILESDIR = ABSPATH . '../jobs-dir/' + $new_file_location = rtrim($filedir,'/') .'/' . $filename; $entry_data['value'] = trailingslashit(get_home_url()) . 'job-postings-get-file/' . $filename; $entry_data['path'] = $new_file_location; @@ -681,4 +682,4 @@ public static function delete_uploaded_files( $entry_id = 0, $delete_secure = fa } -} \ No newline at end of file +}