• Resolved deeve

    (@deeve)


    Just upgraded to PHP 7.3 and getting a lot of errors regarding this. Here’s the offending function in /wp-content/plugins/google-calendar-events/includes/functions/shared.php on line 303. Wondered if anyone has a workaround?

    function simcal_get_date_format_order( $date_format ) {
    
    	$pos = array(
    		'd' => strpos( $date_format, strpbrk( $date_format, 'Dj' ) ),
    		'm' => strpos( $date_format, strpbrk( $date_format, 'FMmn' ) ),
    		'y' => strpos( $date_format, strpbrk( $date_format, 'Yy' ) ),
    	);

    Error reads: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr()

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi.
    I got the same error, and replace ‘Dj’ with ‘dj’ did fix.

    Date format for D is Mon to Sun, but here, it should be day of the month.
    When ‘d’ is set in $dateformat, strpbrk( $date_format, 'Dj' ) returns null.
    That is how the error occured, I guess.

    To the author:
    Pls check above lines. Thanks.

    Thread Starter deeve

    (@deeve)

    @ikaring: Sweet! Thanks for taking the time to post.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘strpos() depracated in PHP 7.3 throwing errors’ is closed to new replies.