troubleshooting
parent
598458f53c
commit
665d5bded9
|
|
@ -39,6 +39,9 @@ class ApiResponse {
|
|||
* @param int $status HTTP status code
|
||||
*/
|
||||
private static function send($data, $status) {
|
||||
while (ob_get_level() > 0) {
|
||||
ob_end_clean();
|
||||
}
|
||||
http_response_code($status);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($data);
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ class Session {
|
|||
}
|
||||
private static $sessionOptions = [
|
||||
'cookie_httponly' => 1,
|
||||
'cookie_secure' => 1,
|
||||
'cookie_samesite' => 'Strict',
|
||||
'cookie_secure' => 0,
|
||||
'cookie_samesite' => 'Lax',
|
||||
'gc_maxlifetime' => 7200 // 2 hours
|
||||
];
|
||||
|
||||
|
|
@ -52,13 +52,13 @@ class Session {
|
|||
'domain' => $thisDomain,
|
||||
'secure' => $isSecure,
|
||||
'httponly' => true,
|
||||
'samesite' => 'Strict'
|
||||
'samesite' => 'Lax'
|
||||
]);
|
||||
}
|
||||
|
||||
// Align session start options dynamically with current transport
|
||||
self::$sessionOptions['cookie_secure'] = $isSecure ? 1 : 0;
|
||||
self::$sessionOptions['cookie_samesite'] = 'Strict';
|
||||
self::$sessionOptions['cookie_samesite'] = 'Lax';
|
||||
|
||||
self::$initialized = true;
|
||||
}
|
||||
|
|
@ -181,7 +181,7 @@ class Session {
|
|||
'domain' => $config['domain'],
|
||||
'secure' => isset($_SERVER['HTTPS']),
|
||||
'httponly' => true,
|
||||
'samesite' => 'Strict'
|
||||
'samesite' => 'Lax'
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ class Session {
|
|||
'domain' => $config['domain'] ?? '',
|
||||
'secure' => isset($_SERVER['HTTPS']),
|
||||
'httponly' => true,
|
||||
'samesite' => 'Strict'
|
||||
'samesite' => 'Lax'
|
||||
]
|
||||
);
|
||||
|
||||
|
|
@ -230,7 +230,7 @@ class Session {
|
|||
'domain' => $config['domain'] ?? '',
|
||||
'secure' => isset($_SERVER['HTTPS']),
|
||||
'httponly' => true,
|
||||
'samesite' => 'Strict'
|
||||
'samesite' => 'Lax'
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class Validator {
|
|||
}
|
||||
break;
|
||||
case 'phone':
|
||||
if (!empty($value) && !preg_match('/^[+]?[\d\s-()]{7,}$/', $value)) {
|
||||
if (!empty($value) && !preg_match('/^(\+?\d{1,4})?\s?(\d[\d\s]{6,})$/', $value)) {
|
||||
$this->addError($field, "Invalid phone number format");
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue