• <?php
    $url ="/test";
    $wp_cassify_redirect_url_white_list="";
    $is_in_while_list = false; $white_list_urls = explode( ';', $wp_cassify_redirect_url_white_list );
    if ( ( is_array( $white_list_urls ) ) && ( count( $white_list_urls ) > 0 ) ){
    foreach( $white_list_urls as $white_url ) {
    if ( strrpos( $url, $white_url, -strlen( $url ) ) !== false ) {
    $is_in_while_list = true;
    }
    }
    } echo $is_in_while_list;

    Fragment of code is from wp_cassify_plugin.php?

    Please check the code above on https://onlinephp.io/

    With php7 the result is empty

    With php8 the result is always 1

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter giuliovale

    (@giuliovale)

    <?php
    var_dump( strrpos( "test", "") );

    PHP8 return int(4)

    PHP7 return bool(false)

    I had the same problem migrating my server to Debian 12 with PHP 8.2

    I fixed this replacing :

    if ( strrpos( $url, $white_url, -strlen( $url ) ) !== false ) {

    With

    if ( strrpos( $url, $white_url, -strlen( $url ) ) !== 0 ) {

    At line 1144 of the classes/wp_cassify_plugin.php file.

    Maybe the plugin should be patched, but I don’t know if it still maintained ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Login not redirect to cas ( php7 vs php8 )’ is closed to new replies.