PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.3
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.3
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Services / FormBuilder / ShortCodeParser.php

ShortCodeParser.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.3, at app/Services/FormBuilder/ShortCodeParser.php

688 lines 25.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Services\FormBuilder;
4
5 use FluentForm\App\Models\SubmissionMeta;
6 use FluentForm\App\Modules\Form\FormDataParser;
7 use FluentForm\App\Modules\Form\FormFieldsParser;
8 use FluentForm\App\Services\Browser\Browser;
9 use FluentForm\Framework\Helpers\ArrayHelper;
10 use FluentForm\App\Helpers\Helper;
11
12 class ShortCodeParser
13 {
14 protected static $form = null;
15
16 protected static $entry = null;
17
18 protected static $browser = null;
19
20 protected static $formFields = null;
21
22 protected static $provider = null;
23
24 protected static $store = [
25 'inputs' => null,
26 'original_inputs' => null,
27 'user' => null,
28 'post' => null,
29 'other' => null,
30 'submission' => null,
31 ];
32
33 public static function parse($parsable, $entryId, $data = [], $form = null, $isUrl = false, $providerOrIsHTML = false, $htmlSanitized = false)
34 {
35 try {
36 static::setDependencies($entryId, $data, $form, $providerOrIsHTML);
37
38 if (is_array($parsable)) {
39 return static::parseShortCodeFromArray($parsable, $isUrl, $providerOrIsHTML, $htmlSanitized);
40 }
41
42 return static::parseShortCodeFromString($parsable, $isUrl, $providerOrIsHTML, $htmlSanitized);
43 } catch (\Exception $e) {
44 if (defined('WP_DEBUG') && WP_DEBUG) {
45 // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- Debug logging only when WP_DEBUG is enabled, helps developers troubleshoot shortcode parsing issues
46 error_log($e->getTraceAsString());
47 }
48 return '';
49 }
50 }
51
52 protected static function setDependencies($entry, $data, $form, $provider)
53 {
54 static::setEntry($entry);
55 static::setData($data);
56 static::setForm($form);
57 static::$provider = $provider;
58 }
59
60 protected static function setEntry($entry)
61 {
62 static::$entry = $entry;
63 }
64
65 protected static function setdata($data)
66 {
67 if (!is_null($data)) {
68 static::$store['inputs'] = $data;
69 static::$store['original_inputs'] = $data;
70 } else {
71 $data = json_decode(static::getEntry()->response, true);
72 static::$store['inputs'] = $data;
73 static::$store['original_inputs'] = $data;
74 }
75 }
76
77 protected static function setForm($form)
78 {
79 if (!is_null($form)) {
80 static::$form = $form;
81 } else {
82 static::$form = static::getEntry()->form_id;
83 }
84 }
85
86 protected static function parseShortCodeFromArray($parsable, $isUrl = false, $provider = false, $htmlSanitized = false)
87 {
88 foreach ($parsable as $key => $value) {
89 if (is_array($value)) {
90 $parsable[$key] = static::parseShortCodeFromArray($value, $isUrl, $provider, $htmlSanitized);
91 } else {
92 $isHtml = false;
93 if ($provider) {
94 $isHtml = apply_filters_deprecated(
95 'ff_will_return_html',
96 [
97 false,
98 $provider,
99 $key
100 ],
101 FLUENTFORM_FRAMEWORK_UPGRADE,
102 'fluentform/will_return_html',
103 'Use fluentform/will_return_html instead of ff_will_return_html.'
104 );
105 $isHtml = apply_filters('fluentform/will_return_html', $isHtml, $provider, $key);
106 }
107 $parsable[$key] = static::parseShortCodeFromString($value, $isUrl, $isHtml, $htmlSanitized);
108 }
109 }
110
111 return $parsable;
112 }
113
114 protected static function parseShortCodeFromString($parsable, $isUrl = false, $isHtml = false, $htmlSanitized = false)
115 {
116 if ('0' === $parsable) {
117 return $parsable;
118 }
119
120 if (!$parsable) {
121 return '';
122 }
123 return preg_replace_callback('/{+(.*?)}/', function ($matches) use ($isUrl, $isHtml, $htmlSanitized) {
124 $value = '';
125 if (false !== strpos($matches[1], 'inputs.')) {
126 $formProperty = substr($matches[1], strlen('inputs.'));
127 $value = static::getFormData($formProperty, $isHtml);
128 } else if (false !== strpos($matches[1], 'labels.')) {
129 $formLabelProperty = substr($matches[1], strlen('labels.'));
130 $value = static::getFormLabelData($formLabelProperty);
131 } elseif (false !== strpos($matches[1], 'user.')) {
132 $userProperty = substr($matches[1], strlen('user.'));
133 $value = static::getUserData($userProperty);
134 } elseif (false !== strpos($matches[1], 'embed_post.')) {
135 $postProperty = substr($matches[1], strlen('embed_post.'));
136 $value = static::getPostData($postProperty);
137 } elseif (false !== strpos($matches[1], 'wp.')) {
138 $wpProperty = substr($matches[1], strlen('wp.'));
139 $value = static::getWPData($wpProperty);
140 } elseif (false !== strpos($matches[1], 'submission.')) {
141 $submissionProperty = substr($matches[1], strlen('submission.'));
142 $value = static::getSubmissionData($submissionProperty);
143 } elseif (false !== strpos($matches[1], 'cookie.')) {
144 $scookieProperty = substr($matches[1], strlen('cookie.'));
145 $value = array_key_exists($scookieProperty, $_COOKIE) ? wp_unslash($_COOKIE[$scookieProperty]) : '';
146 } elseif (false !== strpos($matches[1], 'payment.')) {
147 $property = substr($matches[1], strlen('payment.'));
148 $deprecatedValue = apply_filters_deprecated(
149 'fluentform_payment_smartcode', [
150 '',
151 $property,
152 self::getInstance()
153 ],
154 FLUENTFORM_FRAMEWORK_UPGRADE,
155 'fluentform/payment_smartcode',
156 'Use fluentform/payment_smartcode instead of fluentform_payment_smartcode.'
157 );
158
159 $value = apply_filters('fluentform/payment_smartcode', $deprecatedValue, $property, self::getInstance());
160 } else {
161 $value = static::getOtherData($matches[1]);
162 }
163
164 if (is_array($value)) {
165 $value = fluentImplodeRecursive(', ', $value);
166 }
167
168 if ($isUrl) {
169 $value = rawurlencode($value);
170 } else if ($htmlSanitized) {
171 $value = fluentform_sanitize_html($value);
172 }
173
174 return $value;
175 }, $parsable);
176 }
177
178 protected static function getFormData($key, $isHtml = false)
179 {
180 if (strpos($key, '.label')) {
181 $key = str_replace('.label', '', $key);
182 $isHtml = true;
183 }
184
185 if (strpos($key, '.value')) {
186 $key = str_replace('.value', '', $key);
187 return ArrayHelper::get(static::$store['original_inputs'], $key);
188 }
189
190 if (strpos($key, '.') && !isset(static::$store['inputs'][$key])) {
191 return ArrayHelper::get(
192 static::$store['original_inputs'],
193 $key,
194 ''
195 );
196 }
197
198 if (!isset(static::$store['inputs'][$key])) {
199 static::$store['inputs'][$key] = ArrayHelper::get(
200 static::$store['inputs'],
201 $key,
202 ''
203 );
204 }
205
206 if (is_null(static::$formFields)) {
207 static::$formFields = FormFieldsParser::getShortCodeInputs(
208 static::getForm(),
209 ['admin_label', 'attributes', 'options', 'raw']
210 );
211 }
212
213 $field = ArrayHelper::get(static::$formFields, $key, '');
214
215 if (!$field) {
216 return '';
217 }
218
219 if ($isHtml) {
220 $originalInput = ArrayHelper::get(static::$store['original_inputs'], $key, '');
221 $originalInput = apply_filters_deprecated(
222 'fluentform_response_render_' . $field['element'],
223 [
224 $originalInput,
225 $field,
226 static::getForm()->id,
227 $isHtml
228 ],
229 FLUENTFORM_FRAMEWORK_UPGRADE,
230 'fluentform/response_render_' . $field['element'],
231 'Use fluentform/response_render_' . $field['element'] . ' instead of fluentform_response_render_' . $field['element']
232 );
233 return apply_filters(
234 'fluentform/response_render_' . $field['element'],
235 $originalInput,
236 $field,
237 static::getForm()->id,
238 $isHtml
239 );
240 }
241
242 static::$store['inputs'][$key] = apply_filters_deprecated(
243 'fluentform_response_render_' . $field['element'],
244 [
245 static::$store['inputs'][$key],
246 $field,
247 static::getForm()->id,
248 $isHtml
249 ],
250 FLUENTFORM_FRAMEWORK_UPGRADE,
251 'fluentform/response_render_' . $field['element'],
252 'Use fluentform/response_render_' . $field['element'] . ' instead of fluentform_response_render_' . $field['element']
253 );
254
255 return static::$store['inputs'][$key] = apply_filters(
256 'fluentform/response_render_' . $field['element'],
257 static::$store['inputs'][$key],
258 $field,
259 static::getForm()->id,
260 $isHtml
261 );
262 }
263
264 protected static function getFormLabelData($key)
265 {
266 if (is_null(static::$formFields)) {
267 static::$formFields = FormFieldsParser::getShortCodeInputs(
268 static::getForm(),
269 ['admin_label', 'attributes', 'options', 'raw', 'label']
270 );
271 }
272
273 // Resolve global validation messages {labels.current_field} shortcode.
274 // Current field name attribute was setted as inputs data key 'current_field'.
275 if ('current_field' === $key && $currentFieldName = ArrayHelper::get(static::$store['inputs'], $key)) {
276 $currentFieldName = str_replace(['[', ']'], ['.', ''], $currentFieldName);
277 $key = $currentFieldName;
278 }
279 $inputLabel = ArrayHelper::get(ArrayHelper::get(static::$formFields, $key, []), 'label', '');
280 $inputLabel = str_replace(['[', ']'], '', $inputLabel);
281 $keys = explode(".", $key);
282 if (count($keys) > 1) {
283 $parentKey = array_shift($keys);
284 $inputLabel = str_replace($parentKey, '', $inputLabel);
285 }
286 if (empty($inputLabel)) {
287 $inputLabel = ArrayHelper::get(ArrayHelper::get(static::$formFields, $key, []), 'admin_label', '');
288 }
289 if (empty($inputLabel) && isset($parentKey) && $parentKey) {
290 $inputLabel = ArrayHelper::get(ArrayHelper::get(static::$formFields, $parentKey, []), 'label', '');
291 $key = $parentKey;
292 }
293
294 return apply_filters('fluentform/input_label_shortcode', $inputLabel, $key, static::getForm());
295 }
296
297 protected static function getUserData($key)
298 {
299 if (is_null(static::$store['user'])) {
300 static::$store['user'] = wp_get_current_user();
301 }
302 return static::$store['user']->{$key};
303 }
304
305 protected static function getPostData($key)
306 {
307 if (is_null(static::$store['post'])) {
308 $postId = static::$store['inputs']['__fluent_form_embded_post_id'];
309 static::$store['post'] = get_post($postId);
310 if (is_null(static::$store['post'])) {
311 return '';
312 }
313 static::$store['post']->permalink = get_the_permalink(static::$store['post']);
314 }
315
316 if (false !== strpos($key, 'author.')) {
317 $authorProperty = substr($key, strlen('author.'));
318 $authorId = static::$store['post']->post_author;
319 if ($authorId) {
320 $data = get_the_author_meta($authorProperty, $authorId);
321 if (!is_array($data)) {
322 return $data;
323 }
324 }
325 return '';
326 } elseif (false !== strpos($key, 'meta.')) {
327 $metaKey = substr($key, strlen('meta.'));
328 $postId = static::$store['post']->ID;
329 $data = get_post_meta($postId, $metaKey, true);
330 if (!is_array($data)) {
331 return $data;
332 }
333 return '';
334 } elseif (false !== strpos($key, 'acf.')) {
335 $metaKey = substr($key, strlen('acf.'));
336 $postId = static::$store['post']->ID;
337 if (function_exists('get_field')) {
338 $data = get_field($metaKey, $postId, true);
339 if (!is_array($data)) {
340 return $data;
341 }
342 return '';
343 }
344 }
345
346 return static::$store['post']->{$key};
347 }
348
349 protected static function getWPData($key)
350 {
351 if ('admin_email' == $key) {
352 return get_option('admin_email');
353 }
354 if ('site_url' == $key) {
355 return site_url();
356 }
357 if ('site_title' == $key) {
358 return get_option('blogname');
359 }
360 return $key;
361 }
362
363 protected static function getSubmissionData($key)
364 {
365 $entry = static::getEntry();
366
367 if (empty($entry->id)) {
368 return '';
369 }
370
371 if (property_exists($entry, $key)) {
372 if ('total_paid' == $key || 'payment_total' == $key) {
373 return round($entry->{$key} / 100, 2);
374 }
375 if ('payment_method' == $key && 'test' == $entry->{$key}) {
376 return __('Offline', 'fluentform');
377 }
378 return $entry->{$key};
379 }
380 if ('admin_view_url' == $key) {
381 return admin_url('admin.php?page=fluent_forms&route=entries&form_id=' . $entry->form_id . '#/entries/' . $entry->id);
382 } elseif ('entry_uid' == $key) {
383 return static::getShortEntryUid($entry);
384 } elseif ('entry_uid_link' == $key) {
385 return static::getEntryUidLink($entry);
386 } elseif (false !== strpos($key, 'meta.')) {
387 $metaKey = substr($key, strlen('meta.'));
388 $data = Helper::getSubmissionMeta($entry->id, $metaKey);
389 if (!is_array($data)) {
390 return $data;
391 }
392 return '';
393 }
394
395 return '';
396 }
397
398 protected static function getOtherData($key)
399 {
400 if (0 === strpos($key, 'date.')) {
401 $format = str_replace('date.', '', $key);
402 return date($format, strtotime(current_time('mysql')));
403 } elseif ('admin_email' == $key) {
404 return get_option('admin_email', false);
405 } elseif ('ip' == $key) {
406 return static::getRequest()->getIp();
407 } elseif ('browser.platform' == $key) {
408 return static::getUserAgent()->getPlatform();
409 } elseif ('browser.name' == $key) {
410 return static::getUserAgent()->getBrowser();
411 } elseif (in_array($key, ['all_data', 'all_data_without_hidden_fields'])) {
412 $formFields = FormFieldsParser::getEntryInputs(static::getForm());
413 $inputLabels = FormFieldsParser::getAdminLabels(static::getForm(), $formFields);
414 $response = FormDataParser::parseFormSubmission(static::getEntry(), static::getForm(), $formFields, true);
415
416 $status = apply_filters_deprecated(
417 'fluentform_all_data_skip_password_field',
418 [
419 __return_true()
420 ],
421 FLUENTFORM_FRAMEWORK_UPGRADE,
422 'fluentform/all_data_skip_password_field',
423 'Use fluentform/all_data_skip_password_field instead of fluentform_all_data_skip_password_field.'
424 );
425
426 if (apply_filters('fluentform/all_data_skip_password_field', $status)) {
427 $passwords = FormFieldsParser::getInputsByElementTypes(static::getForm(), ['input_password']);
428 if (is_array($passwords) && !empty($passwords)) {
429 $user_inputs = $response->user_inputs;
430 ArrayHelper::forget($user_inputs, array_keys($passwords));
431 $response->user_inputs = $user_inputs;
432 }
433 }
434
435 $hideHiddenField = true;
436 $hideHiddenField = apply_filters_deprecated(
437 'fluentform_all_data_without_hidden_fields',
438 [
439 $hideHiddenField
440 ],
441 FLUENTFORM_FRAMEWORK_UPGRADE,
442 'fluentform/all_data_without_hidden_fields',
443 'Use fluentform/all_data_without_hidden_fields instead of fluentform_all_data_without_hidden_fields.'
444 );
445 $skipHiddenFields = ('all_data_without_hidden_fields' == $key) &&
446 apply_filters('fluentform/all_data_without_hidden_fields', $hideHiddenField);
447
448 if ($skipHiddenFields) {
449 $hiddenFields = FormFieldsParser::getInputsByElementTypes(static::getForm(), ['input_hidden']);
450 if (is_array($hiddenFields) && !empty($hiddenFields)) {
451 ArrayHelper::forget($response->user_inputs, array_keys($hiddenFields));
452 }
453 }
454
455 $html = '<table class="ff_all_data" width="600" cellpadding="0" cellspacing="0"><tbody>';
456 foreach ($inputLabels as $inputKey => $label) {
457 if (array_key_exists($inputKey, $response->user_inputs) && '' !== ArrayHelper::get($response->user_inputs, $inputKey)) {
458 $data = ArrayHelper::get($response->user_inputs, $inputKey);
459 if (is_array($data) || is_object($data)) {
460 continue;
461 }
462 // $label is admin-set, $data is already sanitized via fluentFormSanitizer() on submission insert
463 $html .= '<tr class="field-label"><th style="padding: 6px 12px; background-color: #f8f8f8; text-align: left;"><strong>' . $label . '</strong></th></tr><tr class="field-value"><td style="padding: 6px 12px 12px 12px;">' . $data . '</td></tr>';
464 }
465 }
466
467 $html .= '</tbody></table>';
468 $html = apply_filters_deprecated(
469 'fluentform_all_data_shortcode_html',
470 [
471 $html,
472 $formFields,
473 $inputLabels,
474 $response
475 ],
476 FLUENTFORM_FRAMEWORK_UPGRADE,
477 'fluentform/all_data_shortcode_html',
478 'Use fluentform/all_data_shortcode_html instead of fluentform_all_data_shortcode_html.'
479 );
480 return apply_filters('fluentform/all_data_shortcode_html', $html, $formFields, $inputLabels, $response);
481 } elseif ('http_referer' === $key) {
482 return wp_get_referer();
483 } elseif (0 === strpos($key, 'pdf.download_link.')) {
484 $key = apply_filters_deprecated(
485 'fluentform_shortcode_parser_callback_pdf.download_link.public',
486 [
487 $key, static::getInstance()
488 ],
489 FLUENTFORM_FRAMEWORK_UPGRADE,
490 'fluentform/shortcode_parser_callback_pdf.download_link.public',
491 'Use fluentform/shortcode_parser_callback_pdf.download_link.public instead of fluentform_shortcode_parser_callback_pdf.download_link.public.'
492 );
493 return apply_filters('fluentform/shortcode_parser_callback_pdf.download_link.public', $key, static::getInstance());
494 } elseif (false !== strpos($key, 'random_string.')) {
495 $exploded = explode('.', $key);
496 $prefix = array_pop($exploded);
497 $value = $prefix . uniqid();
498
499 return apply_filters('fluentform/shortcode_parser_callback_random_string', $value, $prefix, static::getInstance());
500 } elseif ('form_title' == $key) {
501 return static::getForm()->title;
502 } elseif (false !== strpos($key, 'chat_gpt_response.')) {
503 if (defined('FLUENTFORMPRO') && class_exists('\FluentFormPro\classes\Chat\ChatFieldController')) {
504 $exploded = explode('.', $key);
505 $prefix = array_pop($exploded);
506 if (!$prefix) {
507 return '';
508 }
509 $exploded = explode('_', $prefix);
510 $formId = reset($exploded);
511 $feedId = end($exploded);
512 $chatGPT = new \FluentFormPro\classes\Chat\ChatFieldController(wpFluentForm());
513 if ($chatGPT->api->isApiEnabled()) {
514 $entry = static::getEntry();
515 $lastResponse = SubmissionMeta::retrieve("chat_gpt_response_{$feedId}", $entry->id);
516 if (!$lastResponse) {
517 $response = $chatGPT->chatGPTSubmissionMessageHandler($formId, $feedId, static::getInstance());
518 SubmissionMeta::persist($entry->id, "chat_gpt_response_{$feedId}", $response, $formId);
519 return $response;
520 }
521 return $lastResponse;
522 }
523 }
524 return '';
525 }
526
527
528 // if it's multi line then just return
529 if (false !== strpos($key, PHP_EOL)) { // most probably it's a css
530 return '{' . $key . '}';
531 }
532
533
534 $groups = explode('.', $key);
535 if (count($groups) > 1) {
536 $group = array_shift($groups);
537 $property = implode('.', $groups);
538 $handlerValue = apply_filters_deprecated(
539 'fluentform_smartcode_group_' . $group,
540 [
541 $property,
542 static::getInstance()
543 ],
544 FLUENTFORM_FRAMEWORK_UPGRADE,
545 'fluentform/smartcode_group_' . $group,
546 'Use fluentform/smartcode_group_' . $group . ' instead of fluentform_smartcode_group_' . $group
547 );
548
549 $handlerValue = apply_filters('fluentform/smartcode_group_' . $group, $handlerValue, static::getInstance());
550 if ($handlerValue != $property) {
551 return $handlerValue;
552 }
553 }
554
555 // This fallback actually
556 $handlerValue = apply_filters_deprecated(
557 'fluentform_shortcode_parser_callback_' . $key,
558 [
559 '{' . $key . '}',
560 static::getInstance()
561 ],
562 FLUENTFORM_FRAMEWORK_UPGRADE,
563 'fluentform/shortcode_parser_callback_' . $key,
564 'Use fluentform/shortcode_parser_callback_' . $key . ' instead of fluentform_shortcode_parser_callback_' . $key
565 );
566
567
568 $handlerValue = apply_filters('fluentform/shortcode_parser_callback_' . $key, $handlerValue, static::getInstance());
569
570 if ($handlerValue) {
571 return $handlerValue;
572 }
573
574 return '';
575 }
576
577 public static function getForm()
578 {
579 if (!is_object(static::$form)) {
580 static::$form = wpFluent()->table('fluentform_forms')->find(static::$form);
581 }
582
583 return static::$form;
584 }
585
586 public static function getProvider()
587 {
588 return static::$provider;
589 }
590
591 public static function getEntry()
592 {
593 if (!is_object(static::$entry)) {
594 static::$entry = wpFluent()->table('fluentform_submissions')->find(static::$entry);
595 }
596
597 return static::$entry;
598 }
599
600 protected static function getRequest()
601 {
602 return wpFluentForm('request');
603 }
604
605 protected static function getUserAgent()
606 {
607 if (is_null(static::$browser)) {
608 static::$browser = new Browser();
609 }
610 return static::$browser;
611 }
612
613 public static function getInstance()
614 {
615 static $instance;
616 if ($instance) {
617 return $instance;
618 }
619 $instance = new static();
620 return $instance;
621 }
622
623 public static function getInputs()
624 {
625 return static::$store['original_inputs'];
626 }
627
628 /**
629 * Get the entry UID link for a submission
630 *
631 * @param object $entry
632 * @return string
633 */
634 protected static function getEntryUidLink($entry)
635 {
636 // Check if entry already has the entry_uid_link property
637 if (isset($entry->entry_uid_link)) {
638 return $entry->entry_uid_link;
639 }
640
641 // Check if front-end entry view is enabled for this form
642 $frontEndSettings = Helper::getFormMeta($entry->form_id, 'front_end_entry_view', []);
643 if (ArrayHelper::get($frontEndSettings, 'status') !== 'yes') {
644 return '';
645 }
646
647 // Get the UID hash from submission meta
648 $meta = wpFluent()->table('fluentform_submission_meta')
649 ->where('response_id', $entry->id)
650 ->where('meta_key', '_entry_uid_hash')
651 ->first();
652
653 if (!$meta || !$meta->value) {
654 return '';
655 }
656
657 // Generate the link
658 return site_url('?ff_entry=1&hash=' . $meta->value);
659 }
660
661 protected static function getShortEntryUid($entry)
662 {
663 if (empty($entry->id)) {
664 return '';
665 }
666
667 $entryId = strtoupper(base_convert((string) absint($entry->id), 10, 36));
668 $entryHash = SubmissionMeta::retrieve('_entry_uid_hash', $entry->id);
669
670 if (!$entryHash) {
671 return $entryId;
672 }
673
674 return $entryId . '-' . strtoupper(substr($entryHash, 0, 4));
675 }
676
677 public static function resetData()
678 {
679 self::$form = null;
680 self::$entry = null;
681 self::$browser = null;
682 self::$formFields = null;
683
684 FormFieldsParser::resetData();
685 FormDataParser::resetData();
686 }
687 }
688