PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / V3.3.2
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder vV3.3.2
V3.3.2 3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 All 139 releases
← All changes | includes/Core/Integration/ZohoCRM/FilesApiHelper.php +17 -0 V3.0.3 → V3.3.2 View file →
@@ -63,8 +63,9 @@
63 63 * @return mixed $uploadedFiles ID's of uploaded file in Zoho CRM
64 64 */
65 65 public function uploadFiles($files, $isAttachment = false, $module = '', $recordID = 0)
66 66 {
67 + $files = self::normalizeFileNames($files);
67 68 $entryDetails = [
68 69 'formId' => $this->_formId,
69 70 'entryId' => $this->_entryId,
70 71 ];
@@ -114,6 +115,22 @@
114 115 }
115 116 return $uploadedFiles;
116 117 }
117 118 return $uploadResponse;
119 + }
120 +
121 + /**
122 + * Field values may arrive as public file URLs (see IntegrationHandler::handleFileUrl),
123 + * so reduce each to the stored file name before resolving against the entry directory.
124 + *
125 + * @param mixed $files file name(s) or URL(s)
126 + *
127 + * @return mixed
128 + */
129 + private static function normalizeFileNames($files)
130 + {
131 + if (is_array($files)) {
132 + return array_map([__CLASS__, 'normalizeFileNames'], $files);
133 + }
134 + return is_string($files) ? basename(wp_parse_url($files, PHP_URL_PATH) ?: $files) : $files;
118 135 }
119 136 }