We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d426be3 commit 0a06809Copy full SHA for 0a06809
1 file changed
lib/CryptoEncoding/PEM.php
@@ -152,8 +152,11 @@ public function data(): string
152
*/
153
public function string(): string
154
{
155
- return "-----BEGIN {$this->type}-----\n" .
156
- trim(chunk_split(base64_encode($this->data), 64, "\n")) . "\n" .
157
- "-----END {$this->type}-----";
+ return sprintf(
+ "-----BEGIN %s-----\n%s\n-----END %s-----",
+ $this->type,
158
+ trim(chunk_split(base64_encode($this->data), 64, "\n")),
159
+ $this->type
160
+ );
161
}
162
0 commit comments