Skip to content

Commit 240fd96

Browse files
safety checks for session_start
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent c388363 commit 240fd96

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

prestashop1.7/tawkto.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ private function installTab()
102102
*/
103103
public function hookDisplayFooter()
104104
{
105-
session_start();
105+
if (session_status() === PHP_SESSION_NONE && !headers_sent()) {
106+
session_start();
107+
}
106108

107109
$current_widget = self::getPropertyAndWidget();
108110
if (empty($current_widget)) {

prestashop8.x/tawkto.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ private function installTab()
101101
*/
102102
public function hookDisplayFooter()
103103
{
104-
session_start();
104+
if (session_status() === PHP_SESSION_NONE && !headers_sent()) {
105+
session_start();
106+
}
105107

106108
$current_widget = self::getPropertyAndWidget();
107109
if (empty($current_widget)) {

0 commit comments

Comments
 (0)