Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.73k stars 879 forks source link

PHP deprecated: htmlentities(): Passing null to parameter #1 ($string) of type string is deprecated #21456

Open kkmuffme opened 6 days ago

kkmuffme commented 6 days ago

Please give us a description of what happened

To Reproduce

Step-by-step reproduction instructions

Issue reported by automatic crawler, don't have full desc/can't provide for PII reasons However, issue is static analysis type reproducable.

https://github.com/Yoast/wordpress-seo/blob/trunk/src/builders/indexable-link-builder.php#L258 $src = \htmlentities( $processor->get_attribute( 'src' ), ( \ENT_QUOTES | \ENT_SUBSTITUTE | \ENT_HTML401 ), \get_bloginfo( 'charset' ) );

->get_attribute() can return null https://github.com/WordPress/wordpress-develop/blob/6.5/src/wp-includes/html-api/class-wp-html-tag-processor.php#L2516

Expected results

No error

Actual results

htmlentities(): Passing null to parameter #1 ($string) of type string is deprecated

Technical info

Used versions

josevarghese commented 4 days ago

Hi @kkmuffme

Thanks for reporting the deprecating message.

What's next? Our product team will assess the severity of the issue and assign a priority level to the report. Our developers work on the highest priority issues first. We cannot give you an estimate of when they'll start working on the issue.