← All changes
|
app/Http/Requests/FrontendRequests/ReviewRequest.php
+5
-0
1.7.0
→
1.7.1
View file →
| @@ -16,8 +16,10 @@ | ||
| 16 | 16 | public function rules(): array |
| 17 | 17 | { |
| 18 | 18 | return [ |
| 19 | 19 | 'rating' => 'nullable|numeric|min:1|max:5', |
| 20 | + // Star chips, comma separated ("5,4"). Five stars and four commas at most. | |
| 21 | + 'ratings' => 'nullable|sanitizeText|maxLength:9', | |
| 20 | 22 | 'title' => 'nullable|sanitizeText|maxLength:192', |
| 21 | 23 | 'content' => 'nullable|maxLength:5000', |
| 22 | 24 | 'reviewer_name' => 'nullable|sanitizeText|maxLength:100', |
| 23 | 25 | 'reviewer_email' => 'nullable|sanitizeText|email|maxLength:192', |
| @@ -43,8 +45,9 @@ | ||
| 43 | 45 | 'show_footer' => 'nullable|numeric|min:0|max:1', |
| 44 | 46 | 'show_variation' => 'nullable|numeric|min:0|max:1', |
| 45 | 47 | 'page' => 'nullable|numeric|min:1', |
| 46 | 48 | 'client_id' => 'nullable|sanitizeText|maxLength:64', |
| 49 | + 'rating_token' => 'nullable|sanitizeText|maxLength:64', | |
| 47 | 50 | 'max_words' => 'nullable|numeric|min:0|max:500', |
| 48 | 51 | 'pagination_type'=> 'nullable|sanitizeText|maxLength:20', |
| 49 | 52 | 'media_visible' => 'nullable|numeric|min:0|max:100', |
| 50 | 53 | 'media_width' => 'nullable|numeric|min:0|max:2000', |
| @@ -76,8 +79,9 @@ | ||
| 76 | 79 | public function sanitize(): array |
| 77 | 80 | { |
| 78 | 81 | return [ |
| 79 | 82 | 'rating' => 'intval', |
| 83 | + 'ratings' => 'sanitize_text_field', | |
| 80 | 84 | 'title' => 'sanitize_text_field', |
| 81 | 85 | 'content' => 'sanitize_textarea_field', |
| 82 | 86 | 'reviewer_name' => 'sanitize_text_field', |
| 83 | 87 | 'reviewer_email' => 'sanitize_email', |
| @@ -95,8 +99,9 @@ | ||
| 95 | 99 | 'show_footer' => 'intval', |
| 96 | 100 | 'show_variation' => 'intval', |
| 97 | 101 | 'page' => 'intval', |
| 98 | 102 | 'client_id' => 'sanitize_text_field', |
| 103 | + 'rating_token' => 'sanitize_text_field', | |
| 99 | 104 | 'max_words' => 'intval', |
| 100 | 105 | 'pagination_type'=> 'sanitize_text_field', |
| 101 | 106 | 'media_visible' => 'intval', |
| 102 | 107 | 'media_width' => 'intval', |