File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,9 @@ public function postSignupConfirm()
48
48
}
49
49
50
50
/** @var \Illuminate\Validation\Validator $validator */
51
- $ validator = Validator::make (Input::all (), ['g-recaptcha-response ' => 'required|recaptcha ' ]);
51
+ $ validator = Validator::make (Input::only ('g-recaptcha-response ' ), [
52
+ 'g-recaptcha-response ' => 'required|recaptcha '
53
+ ]);
52
54
53
55
if ($ validator ->fails ()) {
54
56
return Redirect::action ('AuthController@getSignupConfirm ' )
Original file line number Diff line number Diff line change @@ -92,6 +92,17 @@ public function postCreateThread()
92
92
return Redirect::action ('ForumThreadsController@getCreateThread ' );
93
93
}
94
94
95
+ /** @var \Illuminate\Validation\Validator $validator */
96
+ $ validator = Validator::make (Input::only ('g-recaptcha-response ' ), [
97
+ 'g-recaptcha-response ' => 'required|recaptcha '
98
+ ]);
99
+
100
+ if ($ validator ->fails ()) {
101
+ return Redirect::action ('ForumThreadsController@getCreateThread ' )
102
+ ->exceptInput ('g-recaptcha-response ' )
103
+ ->withErrors ($ validator ->errors ());
104
+ }
105
+
95
106
return $ this ->threadCreator ->create ($ this , [
96
107
'subject ' => Input::get ('subject ' ),
97
108
'body ' => Input::get ('body ' ),
Original file line number Diff line number Diff line change 8
8
<div class =" header" >
9
9
<h1 >Create Thread</h1 >
10
10
</div >
11
+
12
+ {{ ReCaptcha:: getScript () } }
13
+
11
14
{{ Form:: open ([' data-persist' => ' garlic' , ' data-expires' => ' 600' ]) } }
12
15
13
16
<section class =" padding" >
72
75
@include (' forum._tag_chooser' )
73
76
</div >
74
77
78
+ <div class =" form-row" >
79
+ <p >{{ ReCaptcha:: getWidget () } } </p >
80
+
81
+ @if ($errors -> has (' g-recaptcha-response' ) )
82
+ <p >Please fill in the captcha field correctly.</p >
83
+ @endif
84
+ </div >
85
+
75
86
<div class =" form-row" >
76
87
{{ Form:: button (' Save' , [' type' => ' submit' , ' class' => ' button' ]) } }
77
88
</div >
You can’t perform that action at this time.
0 commit comments