Hi,
Sorry, i don’t have much free time at the moment. I’ve done some changes and tested the plugin under Docker php:8.1.0-fpm. I’have fixed somes bugs due to PHP8 changes.
Everything seems to work but i’m not sure.
So, before i push the new release, I invite you and all volunteers to test the trunk branch which contains the latest changes.
https://plugins.trac.wordpress.org/browser/wp-cassify/trunk
Best regards.
Found another issue that came up with php 8.2
In wp_cassify_plugin.php, function wp_cassify_is_in_while_list:
Explode now returns an array with an empty string if no values are found, which results in it always returning true for the function. Fixed this with this line:
$white_list_urls = empty($wp_cassify_redirect_url_white_list)? “” : explode( ‘;’, $wp_cassify_redirect_url_white_list );
I can confirm the whitelist problem. A breaking change in how strrpos treats empty needle strings in PHP 8+ is causing WP_Cassify_Plugin::wp_cassify_is_in_while_list to bypass CAS auth by default. Details: https://github.com/php/php-src/issues/8582
Another quick fix is to wrap the explode in array_filter: $white_list_urls = array_filter(explode( ';', $wp_cassify_redirect_url_white_list ));
@kkatpcc This worked nicely for me. Thanks for sharing the the reference link and the straightforward fix!
@kkatpcc thank you !
Here I have to patch to make CAS login fire:
--- wp-content/plugins/wp-cassify/classes/wp_cassify_plugin.php.orig 2022-11-17 13:10:24.358921000 +0100
+++ wp-content/plugins/wp-cassify/classes/wp_cassify_plugin.php 2022-11-17 12:54:40.341842000 +0100
@@ -1133,7 +1133,7 @@
$is_in_while_list = false;
$wp_cassify_redirect_url_white_list = WP_Cassify_Utils::wp_cassify_get_option( $this->wp_cassify_network_activated, 'wp_cassify_redirect_url_white_list' );
- $white_list_urls = explode( ';', $wp_cassify_redirect_url_white_list );
+ $white_list_urls = array_filter(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 ) {
Please update plugin (it breaks at each update with php 8.1)