-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
44 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,11 @@ | |
|
||
class Configuration | ||
{ | ||
public const DEFAULT_JS_PATH = 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/widget-0.9.12.min.js'; | ||
public const DEFAULT_JS_PATH = 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/[email protected].min.js'; | ||
|
||
protected string $siteKey = ''; | ||
protected string $siteSecretKey = ''; | ||
protected string $puzzleUrl = ''; | ||
protected string $puzzleEndpoint = ''; | ||
protected string $verifyUrl = ''; | ||
protected string $jsPath = ''; | ||
protected bool $skipDevValidation = false; | ||
|
@@ -31,15 +31,15 @@ public function __construct(Site $site = null) | |
$siteConfiguration = $site->getConfiguration(); | ||
$this->siteKey = trim($siteConfiguration['friendlycaptcha_site_key'] ?? ''); | ||
$this->siteSecretKey = trim($siteConfiguration['friendlycaptcha_secret_key'] ?? ''); | ||
$this->puzzleUrl = trim($siteConfiguration['friendlycaptcha_puzzle_url'] ?? ''); | ||
$this->puzzleEndpoint = trim($siteConfiguration['friendlycaptcha_puzzle_endpoint'] ?? ''); | ||
$this->verifyUrl = trim($siteConfiguration['friendlycaptcha_verify_url'] ?? ''); | ||
$this->jsPath = trim($siteConfiguration['friendlycaptcha_js_path'] ?? ''); | ||
$this->skipDevValidation = (bool)($siteConfiguration['friendlycaptcha_skip_dev_validation'] ?? false); | ||
} | ||
|
||
public function isEnabled(): bool | ||
{ | ||
return $this->siteKey !== '' && $this->siteSecretKey !== '' && $this->puzzleUrl !== '' && $this->verifyUrl !== '' && !$this->hasSkipHeaderValidation(); | ||
return $this->siteKey !== '' && $this->siteSecretKey !== '' && $this->verifyUrl !== '' && !$this->hasSkipHeaderValidation(); | ||
} | ||
|
||
public function getSiteKey(): string | ||
|
@@ -52,9 +52,9 @@ public function getSiteSecretKey(): string | |
return $this->siteSecretKey; | ||
} | ||
|
||
public function getPuzzleUrl(): string | ||
public function getPuzzleEndpoint(): string | ||
{ | ||
return $this->puzzleUrl; | ||
return $this->puzzleEndpoint; | ||
} | ||
|
||
public function getVerifyUrl(): string | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,11 +24,10 @@ public function viewHelperReturnsProperConfiguration() | |
public function __construct() {} | ||
}; | ||
self::assertSame([ | ||
'languageIsoCode' => 'en', | ||
'siteKey' => '1234', | ||
'verifyUrl' => 'https://verify,https://verify2', | ||
'puzzleUrl' => 'https://puzzle', | ||
'jsPath' => 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/widget-0.9.12.min.js', | ||
'puzzleEndpoint' => '', | ||
'jsPath' => 'EXT:friendlycaptcha_official/Resources/Public/JavaScript/lib/[email protected].min.js', | ||
'enabled' => true, | ||
], ConfigurationViewHelper::renderStatic([], static fn() => '', $renderingContext)); | ||
} | ||
|