Skip to content

Commit 0e2f4ec

Browse files
security-package/issues/140: Link "Read instructions on how to generate signature" in Store-Configuration is incorrect.
1 parent 61a2dcd commit 0e2f4ec

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Securitytxt/Model/Config/Signature.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@
1515
*/
1616
class Signature implements CommentInterface
1717
{
18+
/**
19+
* @var string
20+
*/
21+
private $instructionLink;
22+
23+
/**
24+
* @param string $instructionLink
25+
*/
26+
public function __construct(
27+
string $instructionLink = ''
28+
) {
29+
$this->instructionLink = $instructionLink;
30+
}
31+
1832
/**
1933
* Get comment for signature field of security txt extension.
2034
*
@@ -24,7 +38,7 @@ class Signature implements CommentInterface
2438
*/
2539
public function getCommentText($elementValue): string
2640
{
27-
return "<a href='https://github.com/magento/security-package/blob/1.0-develop/Securitytxt/README.md' target='_blank'>
41+
return "<a href='{$this->instructionLink}' target='_blank'>
2842
Read instructions on how to generate signature
2943
</a>";
3044
}

Securitytxt/etc/di.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,11 @@
2222
<argument name="resultPageFactory" xsi:type="object">securitytxtResultPageFactory</argument>
2323
</arguments>
2424
</type>
25-
</config>
25+
<type name="Magento\Securitytxt\Model\Config\Signature">
26+
<arguments>
27+
<argument name="instructionLink" xsi:type="string">
28+
https://github.com/magento/security-package/blob/1.0-develop/Securitytxt/README.md
29+
</argument>
30+
</arguments>
31+
</type>
32+
</config>

0 commit comments

Comments
 (0)