| @@ -116,8 +116,18 @@ | ||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $submission = fluentFormApi('submissions')->find($transaction->submission_id); |
| 119 | 119 | |
| 120 | + // A trashed entry's receipt must not render on the public route. | |
| 121 | + if ($submission && 'trashed' === $submission->status) { | |
| 122 | + if ($echo) { | |
| 123 | + status_header(200); | |
| 124 | + echo esc_html__('Sorry no transaction found', 'fluentform'); | |
| 125 | + exit(200); | |
| 126 | + } | |
| 127 | + return ''; | |
| 128 | + } | |
| 129 | + | |
| 120 | 130 | if ($transaction->transaction_type == 'subscription') { |
| 121 | 131 | $transaction->subscription = fluentFormApi('submissions')->getSubscription($transaction->subscription_id); |
| 122 | 132 | } |
| 123 | 133 | |
| @@ -231,9 +241,9 @@ | ||
| 231 | 241 | $transaction->formatted_amount = PaymentHelper::formatMoney($transaction->payment_total, $transaction->currency); |
| 232 | 242 | $transaction->formatted_date = date_i18n($viewConfig['date_time_format'], strtotime($transaction->created_at)); |
| 233 | 243 | |
| 234 | 244 | if (!$transaction->transaction_hash) { |
| 235 | - $hash = md5(wp_generate_uuid4() . wp_rand(0, 1000)); | |
| 245 | + $hash = wp_generate_password(32, false); | |
| 236 | 246 | Transaction::where('id', $transaction->id) |
| 237 | 247 | ->update(['transaction_hash' => $hash]); |
| 238 | 248 | $transaction->transaction_hash = $hash; |
| 239 | 249 | } |
| @@ -292,9 +302,9 @@ | ||
| 292 | 302 | $viewConfig = $this->getViewConfig(); |
| 293 | 303 | |
| 294 | 304 | foreach ($transactions as $transaction) { |
| 295 | 305 | if (!$transaction->transaction_hash) { |
| 296 | - $hash = md5(wp_generate_uuid4() . wp_rand(0, 1000)); | |
| 306 | + $hash = wp_generate_password(32, false); | |
| 297 | 307 | Transaction::where('id', $transaction->id) |
| 298 | 308 | ->update(['transaction_hash' => $hash]); |
| 299 | 309 | $transaction->transaction_hash = $hash; |
| 300 | 310 | } |