[wp-trac] [WordPress Trac] #58476: preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated
WordPress Trac
noreply at wordpress.org
Thu Jun 8 00:16:08 UTC 2023
#58476: preg_split(): Passing null to parameter #2 ($subject) of type string is
deprecated
-------------------------------+-----------------------------
Reporter: KProvance | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------------+-----------------------------
== Bug Report
=== Description
Using the filter hook 'the_content' and passing an empty string or null
produces the preg_split deprecation notice in the convert_smilies()
function.
=== Environment
- WordPress: 6.3-alpha-55892
- PHP: 8.2.2
- Server: Apache/2.4.54 (Win64) PHP/8.2.2 mod_fcgid/2.3.10-dev
- Database: mysqli (Server: 8.0.27 / Client: mysqlnd 8.2.2)
- Browser: Chrome 114.0.0.0 (Windows 10/11)
- Theme: Seele 1.1.1
- MU-Plugins:
* WP Migrate DB Pro Compatibility 1.1
- Plugins:
* bbPress 2.6.9
* Classic Widgets 0.3
* Contact Form 7 5.7.7
* Database Backup for WordPress 2.5.2
* Envato Market 2.0.8
* Force Plugin Updates Check 1.0.2
* Optimize Database after Deleting Revisions 5.0.110
* Query Monitor 3.12.3
* Redux Framework 4.4.1.4
* Regenerate Thumbnails 3.1.5
* Requite Core 1.1.13
* Slider Revolution 6.6.14
* Slider Revolution Paint-Brush Add-On 3.0.4
* Slider Revolution Particles Effect 3.3.2
* Slider Revolution Slicey Add-On 3.0.4
* Theme Check 20230417
* Ultimate Addons for WPBakery Page Builder 3.19.14
* WooCommerce 7.7.2
* WordPress Beta Tester 3.4.1
* WordPress Importer 0.8.1
* WPBakery Page Builder 6.13.0
* WP Crontrol 1.15.2
* WP Migrate DB Pro 1.8.1
* WP Migrate DB Pro CLI 1.3.2
* WP Migrate DB Pro Media Files 1.4.9
* WP Migrate DB Pro Multisite Tools 1.2
=== Steps to Reproduce
1. Use this filter, ensuring $content is empty or null: $content =
apply_filters( 'the_content', $content );
preg_split(): Passing null to parameter #2 ($subject) of type string is
deprecated
wp-includes/formatting.php:3482
preg_split()
wp-includes/formatting.php:3482
convert_smilies()
wp-includes/class-wp-hook.php:310
apply_filters('the_content')
x. 🐞 Bug occurs.
=== Expected Results
1. ✅ The filtered content.
=== Actual Results
1. ❌ The indicated deprecation error due to preg_split not liking a null
value.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58476>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list