| @@ -88,9 +88,16 @@ | ||
| 88 | 88 | || isset($conditionalActionIds['successMsg'][(string) $msg->id]) |
| 89 | 89 | ) { |
| 90 | 90 | continue; |
| 91 | 91 | } |
| 92 | - $returnableData = self::replaceFieldWithValue($msg->message_content, $fieldValue, true, null, true); | |
| 92 | + // Translate before smart-tag replacement (identity when unhooked). | |
| 93 | + $messageContent = (string) apply_filters( | |
| 94 | + 'bitform_translate_form_string', | |
| 95 | + (string) $msg->message_content, | |
| 96 | + 'msg-content-' . $msg->id, | |
| 97 | + $formId | |
| 98 | + ); | |
| 99 | + $returnableData = self::replaceFieldWithValue($messageContent, $fieldValue, true, null, true); | |
| 93 | 100 | $messageId = $msg->id; |
| 94 | 101 | if (isset($msgConfig->afterSubmit)) { |
| 95 | 102 | $afterSubmit = $msgConfig->afterSubmit; |
| 96 | 103 | } |
| @@ -109,8 +116,15 @@ | ||
| 109 | 116 | continue; |
| 110 | 117 | } |
| 111 | 118 | $url = Utilities::jsonObj($redirectPage->integration_details ?? '')->url ?? ''; |
| 112 | 119 | if (!empty($url)) { |
| 120 | + // Translated before smart-tag replacement: per-language redirect targets. | |
| 121 | + $url = (string) apply_filters( | |
| 122 | + 'bitform_translate_form_string', | |
| 123 | + (string) $url, | |
| 124 | + 'redirect-url-' . $redirectPage->id, | |
| 125 | + $formId | |
| 126 | + ); | |
| 113 | 127 | $url = self::replaceFieldWithValue($url, $fieldValue); |
| 114 | 128 | } |
| 115 | 129 | $returnableData = empty($url) ? '' : esc_url_raw($url); |
| 116 | 130 | break; |
| @@ -484,9 +498,11 @@ | ||
| 484 | 498 | return $firstOperand - $secondOperand; |
| 485 | 499 | case '*': |
| 486 | 500 | return $firstOperand * $secondOperand; |
| 487 | 501 | case '/': |
| 488 | - return 0 == $secondOperand ? null : $firstOperand / $secondOperand; | |
| 502 | + // Compare as float, not with `0 ==`: PHP 8 made `0 == ''` false, so a | |
| 503 | + // non-numeric operand slipped past the old guard into DivisionByZeroError. | |
| 504 | + return 0.0 === (float) $secondOperand ? null : $firstOperand / $secondOperand; | |
| 489 | 505 | case '^': |
| 490 | 506 | return $firstOperand ** $secondOperand; |
| 491 | 507 | } |
| 492 | 508 | |