Skip to content

Commit

Permalink
3.12.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
remyperona authored Aug 24, 2022
2 parents 9457955 + 5a9b9e1 commit bb4ab38
Show file tree
Hide file tree
Showing 11 changed files with 552 additions and 658 deletions.
2 changes: 1 addition & 1 deletion inc/Engine/Preload/Activation/Activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function clean_on_update( $new_version, $old_version ) {
* @return void
*/
public function refresh_on_update( $new_version, $old_version ) {
if ( version_compare( $new_version, '3.12.0', '>=' ) ) {
if ( version_compare( $old_version, '3.12.0.2', '>' ) ) {
return;
}
$this->queue->add_job_preload_job_load_initial_sitemap_async();
Expand Down
2 changes: 1 addition & 1 deletion inc/Engine/Preload/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function update_cache_row() {
do_action( 'rocket_preload_completed', $url, $detected );
}

if ( str_contains( '?', $url ) || ( $this->query->is_pending( $url ) && $this->options->get( 'do_caching_mobile_files', false ) ) ) {
if ( 0 < count( $_GET ) || ( $this->query->is_pending( $url ) && $this->options->get( 'do_caching_mobile_files', false ) ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
return;
}

Expand Down
2 changes: 1 addition & 1 deletion inc/admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ function rocket_handle_settings_import() {
) {
$settings['async_css'] = 0;
}
if ( $settings['cache_webp'] && apply_filters( 'rocket_disable_webp_cache', false ) ) {
if ( ! empty( $settings['cache_webp'] ) && apply_filters( 'rocket_disable_webp_cache', false ) ) {
$settings['cache_webp'] = 0;
}

Expand Down
27 changes: 0 additions & 27 deletions inc/admin/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,33 +242,6 @@ function( $excluded ) use ( $pattern_field, $label, $is_form_submit, &$errors )

add_filter( 'pre_update_option_' . rocket_get_constant( 'WP_ROCKET_SLUG' ), 'rocket_pre_main_option', 10, 2 );

/**
* Clear the main option before it is used later.
*
* @param array $newvalue An array of previous options values.
* @param array $oldvalue An array of previous options values.
* @return array
*/
function rocket_pre_main_option_clear( $newvalue, $oldvalue ) {
foreach ( array_keys( $newvalue ) as $label ) {
if ( is_numeric( $newvalue[ $label ] ) ) {
if ( ctype_digit( (string) $newvalue[ $label ] ) ) {
$newvalue[ $label ] = (int) $newvalue[ $label ];
} else {
$newvalue[ $label ] = (float) $newvalue[ $label ];
}
}
}

if ( ! key_exists( 'cache_webp', $newvalue ) ) {
$newvalue['cache_webp'] = is_array( $oldvalue ) && key_exists( 'cache_webp', $oldvalue ) ? $oldvalue['cache_webp'] : 0;
}

return $newvalue;
}

add_filter( 'pre_update_option_' . rocket_get_constant( 'WP_ROCKET_SLUG' ), 'rocket_pre_main_option_clear', PHP_INT_MAX, 2 );

/**
* Auto-activate the SSL cache if the website URL is updated with https protocol
*
Expand Down
2 changes: 1 addition & 1 deletion inc/classes/logger/class-html-formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class HTML_Formatter extends HtmlFormatter {
* @param array $record A record to format.
* @return mixed The formatted record.
*/
public function format( array $record ) {
public function format( array $record ): string {
$output = $this->addTitle( $record['level_name'], $record['level'] );
$output .= '<table cellspacing="1" width="100%" class="monolog-output">';

Expand Down
4 changes: 2 additions & 2 deletions inc/functions/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,12 @@ function get_rocket_cache_query_string() { // phpcs:ignore WordPress.NamingConve
* @return bool true if everything is ok, false otherwise
*/
function rocket_valid_key() {
$rocket_secret_key = get_rocket_option( 'secret_key' );
$rocket_secret_key = (string) get_rocket_option( 'secret_key', '' );
if ( ! $rocket_secret_key ) {
return false;
}

$valid_details = 8 === strlen( get_rocket_option( 'consumer_key' ) ) && hash_equals( $rocket_secret_key, hash( 'crc32', get_rocket_option( 'consumer_email' ) ) );
$valid_details = 8 === strlen( (string) get_rocket_option( 'consumer_key', '' ) ) && hash_equals( $rocket_secret_key, hash( 'crc32', get_rocket_option( 'consumer_email', '' ) ) );

if ( ! $valid_details ) {
set_transient(
Expand Down
Binary file modified languages/rocket-de_DE.mo
Binary file not shown.
Loading

0 comments on commit bb4ab38

Please sign in to comment.