تخطي الملاحة

الوسوم: 

يحتوي هذا الموضوع رد واحد ، لديه 1صوت.

آخر تحديث بواسطة romansS قبل 5 أشهر.

يساعده: Noman.

مؤلف المقالات
أكتوبر 8, 2024في 12:41 م #16265427

romansS

Background of the issue:
I am trying to address a minor issue in SitePress::user_lang_by_authcookie() that causes a deprecation warning on PHP 8.1 or later. Here is part of the code I am working with: if ( function_exists( 'wp_parse_auth_cookie' ) ) { $cookie_data = wp_parse_auth_cookie(); $username = isset( $cookie_data['username'] ) ? $cookie_data['username'] : null; } $user_obj = new WP_User( 0, $username ); Please notice that you're assigning null to $username if it is not set and then pass it to WP_User(). But this class expects the argument to be a string (الرابط المخفي) and passes it to trim() (الرابط المخفي) effectively causing a deprecation warning.

Symptoms:
Deprecation warning on PHP 8.1 or later due to passing null to WP_User() where a string is expected.

Questions: