@@ -209,6 +209,10 @@ public function exceptionHandler(Throwable $exception)
209
209
public function errorHandler (int $ severity , string $ message , ?string $ file = null , ?int $ line = null )
210
210
{
211
211
if ($ this ->isDeprecationError ($ severity )) {
212
+ if ($ this ->isSessionSidDeprecationError ($ message , $ file , $ line )) {
213
+ return true ;
214
+ }
215
+
212
216
if (! $ this ->config ->logDeprecations || (bool ) env ('CODEIGNITER_SCREAM_DEPRECATIONS ' )) {
213
217
throw new ErrorException ($ message , 0 , $ severity , $ file , $ line );
214
218
}
@@ -223,6 +227,32 @@ public function errorHandler(int $severity, string $message, ?string $file = nul
223
227
return false ; // return false to propagate the error to PHP standard error handler
224
228
}
225
229
230
+ /**
231
+ * Handles session.sid_length and session.sid_bits_per_character deprecations
232
+ * in PHP 8.4.
233
+ */
234
+ private function isSessionSidDeprecationError (string $ message , ?string $ file = null , ?int $ line = null ): bool
235
+ {
236
+ if (
237
+ PHP_VERSION_ID >= 80400
238
+ && str_contains ($ message , 'session.sid_ ' )
239
+ ) {
240
+ log_message (
241
+ LogLevel::WARNING ,
242
+ '[DEPRECATED] {message} in {errFile} on line {errLine}. ' ,
243
+ [
244
+ 'message ' => $ message ,
245
+ 'errFile ' => clean_path ($ file ?? '' ),
246
+ 'errLine ' => $ line ?? 0 ,
247
+ ]
248
+ );
249
+
250
+ return true ;
251
+ }
252
+
253
+ return false ;
254
+ }
255
+
226
256
/**
227
257
* Checks to see if any errors have happened during shutdown that
228
258
* need to be caught and handle them.
0 commit comments