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()
4848 }
4949
5050 /** @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+ ]);
5254
5355 if ($ validator ->fails ()) {
5456 return Redirect::action ('AuthController@getSignupConfirm ' )
Original file line number Diff line number Diff line change @@ -92,6 +92,17 @@ public function postCreateThread()
9292 return Redirect::action ('ForumThreadsController@getCreateThread ' );
9393 }
9494
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+
95106 return $ this ->threadCreator ->create ($ this , [
96107 'subject ' => Input::get ('subject ' ),
97108 'body ' => Input::get ('body ' ),
Original file line number Diff line number Diff line change 88 <div class =" header" >
99 <h1 >Create Thread</h1 >
1010 </div >
11+
12+ {{ ReCaptcha:: getScript () } }
13+
1114 {{ Form:: open ([' data-persist' => ' garlic' , ' data-expires' => ' 600' ]) } }
1215
1316 <section class =" padding" >
7275 @include (' forum._tag_chooser' )
7376 </div >
7477
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+
7586 <div class =" form-row" >
7687 {{ Form:: button (' Save' , [' type' => ' submit' , ' class' => ' button' ]) } }
7788 </div >
You can’t perform that action at this time.
0 commit comments