@@ -19,14 +19,14 @@ class EWZRecaptchaType extends AbstractType
1919 *
2020 * @var string
2121 */
22- protected $ RECAPTCHA_API_SERVER ;
22+ protected $ recaptchaApiServer ;
2323
2424 /**
2525 * The reCAPTCHA JS server URL.
2626 *
2727 * @var string
2828 */
29- protected $ RECAPTCHA_API_JS_SERVER ;
29+ protected $ recaptchaApiJsServer ;
3030
3131 /**
3232 * The public key.
@@ -67,15 +67,15 @@ class EWZRecaptchaType extends AbstractType
6767 * @param bool $ajax Ajax status
6868 * @param LocaleResolver $localeResolver
6969 */
70- public function __construct ($ publicKey , $ enabled , $ ajax , LocaleResolver $ localeResolver , $ apiHost= 'www.google.com ' )
70+ public function __construct ($ publicKey , $ enabled , $ ajax , LocaleResolver $ localeResolver , $ apiHost = 'www.google.com ' )
7171 {
7272 $ this ->publicKey = $ publicKey ;
7373 $ this ->enabled = $ enabled ;
7474 $ this ->ajax = $ ajax ;
7575 $ this ->apiHost = $ apiHost ;
7676 $ this ->localeResolver = $ localeResolver ;
77- $ this ->RECAPTCHA_API_JS_SERVER = '// ' . $ apiHost . ' /recaptcha/api/js/recaptcha_ajax.js ' ;
78- $ this ->RECAPTCHA_API_SERVER = 'https:// ' . $ apiHost . ' /recaptcha/api.js ' ;
77+ $ this ->recaptchaApiJsServer = sprintf ( '//%s /recaptcha/api/js/recaptcha_ajax.js ' , $ apiHost ) ;
78+ $ this ->recaptchaApiServer = sprintf ( 'https://%s /recaptcha/api.js ' , $ apiHost ) ;
7979 }
8080
8181 /**
@@ -99,12 +99,12 @@ public function buildView(FormView $view, FormInterface $form, array $options)
9999
100100 if (!$ this ->ajax ) {
101101 $ view ->vars = array_replace ($ view ->vars , array (
102- 'url_challenge ' => sprintf ('%s?hl=%s ' , $ this ->RECAPTCHA_API_SERVER , $ options ['language ' ]),
102+ 'url_challenge ' => sprintf ('%s?hl=%s ' , $ this ->recaptchaApiServer , $ options ['language ' ]),
103103 'public_key ' => $ this ->publicKey ,
104104 ));
105105 } else {
106106 $ view ->vars = array_replace ($ view ->vars , array (
107- 'url_api ' => $ this ->RECAPTCHA_API_JS_SERVER ,
107+ 'url_api ' => $ this ->recaptchaApiJsServer ,
108108 'public_key ' => $ this ->publicKey ,
109109 ));
110110 }
0 commit comments