| @@ -333,11 +333,16 @@ | ||
| 333 | 333 | return ''; |
| 334 | 334 | |
| 335 | 335 | $old_userlisting_settings = get_option( 'customUserListingSettings', 'not_found' ); |
| 336 | 336 | if ( $old_userlisting_settings == 'not_found' ) |
| 337 | - $old_userlisting_settings = get_option( 'userListingSettings' ); | |
| 338 | - | |
| 339 | - if ( $old_userlisting_settings == 'not_found' ) | |
| 337 | + $old_userlisting_settings = get_option( 'userListingSettings', 'not_found' ); | |
| 338 | + | |
| 339 | + // Bail on fresh installs (and any install with no legacy user-listing data). | |
| 340 | + // Without the 'not_found' default above, get_option() returned `false` and | |
| 341 | + // `false == 'not_found'` is false in PHP 8, so this guard let fresh installs | |
| 342 | + // fall through and create a phantom 'Userlisting' post — which trips the | |
| 343 | + // license gate in wppb_filter_own_post_creation() and wp_die()'s on activation. | |
| 344 | + if ( $old_userlisting_settings == 'not_found' || empty( $old_userlisting_settings ) ) | |
| 340 | 345 | return; |
| 341 | 346 | |
| 342 | 347 | $all_userlisting = ( isset( $old_userlisting_settings['allUserlisting'] ) ? wppb_replace_merge_tags( $old_userlisting_settings['allUserlisting'], true ) : '' ); |
| 343 | 348 | $single_userlisting = ( isset( $old_userlisting_settings['singleUserlisting'] ) ? wppb_replace_merge_tags( $old_userlisting_settings['singleUserlisting'] ) : '' ); |