Skip to content

Commit efbfbe0

Browse files
fix: translatable admin notices; drop domain from __Host- cookie
- sparxstar-gluon.php: wrap all three gluonAdminNotice() call-site strings in esc_html__( '...', 'sparxstar-gluon' ) so they are translatable and properly escaped; also prefix the messages with 'SPARXSTAR Gluon' for clarity (the previous messages said 'Plugin'). - src/integrations/SparxstarGluonRules.php: remove the 'domain' => '' option from gluonSetTokenCookie()'s setcookie() array — __Host- cookies must not include a Domain attribute at all (even an empty one), to comply with the __Host- prefix spec and avoid inconsistent browser/SAPI behaviour. Co-authored-by: MaximillianGroup <34328348+MaximillianGroup@users.noreply.github.com> Agent-Logs-Url: https://github.com/Starisian-Technologies/sparxstar-gluon/sessions/4ac1db52-3324-4698-92ba-4fdb3781e8fa
1 parent e7c352a commit efbfbe0

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

sparxstar-gluon.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,32 @@ private function gluonIsPluginCompatible(): bool {
218218
$min_wp = '6.8';
219219

220220
if ( version_compare( PHP_VERSION, $min_php, '<' ) ) {
221-
$this->gluonAdminNotice( 'Plugin requires PHP 8.2+ and WordPress 6.8+. Please update your environment.' );
221+
$this->gluonAdminNotice(
222+
esc_html__(
223+
'SPARXSTAR Gluon requires PHP 8.2+ and WordPress 6.8+. Please update your environment.',
224+
'sparxstar-gluon'
225+
)
226+
);
222227
return false;
223228
}
224229

225230
if ( version_compare( get_bloginfo( 'version' ), $min_wp, '<' ) ) {
226-
$this->gluonAdminNotice( 'Plugin requires PHP 8.2+ and WordPress 6.8+. Please update your environment.' );
231+
$this->gluonAdminNotice(
232+
esc_html__(
233+
'SPARXSTAR Gluon requires PHP 8.2+ and WordPress 6.8+. Please update your environment.',
234+
'sparxstar-gluon'
235+
)
236+
);
227237
return false;
228238
}
229239

230240
if ( ! class_exists( 'WP_Ability' ) ) {
231-
$this->gluonAdminNotice( 'Plugin requires the Abilities API plugin to be installed and activated.' );
241+
$this->gluonAdminNotice(
242+
esc_html__(
243+
'SPARXSTAR Gluon requires the Abilities API plugin to be installed and activated.',
244+
'sparxstar-gluon'
245+
)
246+
);
232247
return false;
233248
}
234249

src/integrations/SparxstarGluonRules.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ public function gluonSetTokenCookie( string $token_value, int $expires = 0 ): bo
199199
array(
200200
'expires' => $expires,
201201
'path' => '/',
202-
'domain' => '',
203202
'secure' => true,
204203
'httponly' => true,
205204
'samesite' => 'Strict',

0 commit comments

Comments
 (0)