Fix the accidental camel case

This commit is contained in:
Daniel Dudzic 2024-04-17 12:32:34 +02:00
parent 2c8d379616
commit 579660b2c1
No known key found for this signature in database
GPG key ID: 31B40D33E3465483

View file

@ -22,10 +22,10 @@ class PayLaterWCBlocksUtils {
* @return string The block content with the content inserted.
*/
public static function insert_before_last_div( string $block_content, string $content_to_insert ): string {
$lastIndex = strrpos( $block_content, '</div>' );
$last_index = strrpos( $block_content, '</div>' );
if ( $lastIndex !== false ) {
$block_content = substr_replace( $block_content, $content_to_insert, $lastIndex, 0 );
if ( $last_index !== false ) {
$block_content = substr_replace( $block_content, $content_to_insert, $last_index, 0 );
}
return $block_content;