← All changes
|
src/Application/Services/Cache/CacheApplicationService.php
+2
-22
trunk
→
2.4
View file →
| @@ -51,9 +51,9 @@ | ||
| 51 | 51 | |
| 52 | 52 | if ($cache && $cache->getData()) { |
| 53 | 53 | $cacheData = json_decode($cache->getData()->getValue(), true); |
| 54 | 54 | |
| 55 | - return $this->withNonce(apply_filters('amelia_mollie_cache_data_filter', $cacheData)); | |
| 55 | + return apply_filters('amelia_mollie_cache_data_filter', $cacheData); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | return null; |
| 59 | 59 | } |
| @@ -69,27 +69,7 @@ | ||
| 69 | 69 | public function getWcCacheByName($name) |
| 70 | 70 | { |
| 71 | 71 | $cacheData = ($data = explode('_', $name)) && isset($data[0], $data[1]) ? |
| 72 | 72 | StarterWooCommerceService::getCacheData($data[0]) : null; |
| 73 | - return $this->withNonce(apply_filters('amelia_woocommerce_cache_data_filter', $cacheData)); | |
| 74 | - } | |
| 75 | - | |
| 76 | - /** | |
| 77 | - * The page that restores the cache is reached after a redirect from the payment gateway, so the nonce the | |
| 78 | - * booking request handed back is long gone. Mint a new one here - this runs while rendering the page for the | |
| 79 | - * returning visitor, so it is valid for the requests the restored form fires (i.e. "/bookings/success"). | |
| 80 | - * | |
| 81 | - * @param array|null $cacheData | |
| 82 | - * | |
| 83 | - * @return array|null | |
| 84 | - */ | |
| 85 | - private function withNonce($cacheData) | |
| 86 | - { | |
| 87 | - if (!is_array($cacheData)) { | |
| 88 | - return $cacheData; | |
| 89 | - } | |
| 90 | - | |
| 91 | - $cacheData['wpAmeliaNonce'] = wp_create_nonce('ajax-nonce'); | |
| 92 | - | |
| 93 | - return $cacheData; | |
| 73 | + return apply_filters('amelia_woocommerce_cache_data_filter', $cacheData); | |
| 94 | 74 | } |
| 95 | 75 | } |