Skip to content

Commit dd3f1e5

Browse files
committed
chore: fix static analysis
1 parent 4b968f0 commit dd3f1e5

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/Admin/Provider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,15 @@ public function hijack_current_parent_file( $submenu_file ) {
275275
}
276276

277277
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
278-
$current_page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
278+
$current_page = isset( $_GET['page'] ) ? sanitize_text_field( (string) wp_unslash( $_GET['page'] ) ) : '';
279279

280280
if ( $current_page !== self::get_single_page_slug() ) {
281281
return $submenu_file;
282282
}
283283

284284
global $plugin_page;
285285

286-
self::$stored_parent_file = $plugin_page;
286+
self::$stored_parent_file = is_string( $plugin_page ) ? $plugin_page : null;
287287

288288
$plugin_page = self::$parent_page; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
289289

src/views/single.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@
2626
$description = $migration->get_description();
2727
$rest_base_url ??= '';
2828
$executions ??= [];
29+
$list_url ??= null;
2930

3031
$template = Config::get_template_engine();
3132
?>
3233
<div class="wrap stellarwp-migration-single" data-rest-url="<?php echo esc_url( $rest_base_url ); ?>" data-migration-id="<?php echo esc_attr( $migration_id ); ?>">
33-
<?php if ( $list_url ) : ?>
34+
<?php if ( is_string( $list_url ) ) : ?>
3435
<div class="stellarwp-migration-single__back">
3536
<a href="<?php echo esc_url( $list_url ); ?>" class="stellarwp-migration-single__back-link">
3637
<span class="dashicons dashicons-arrow-left-alt2"></span> <?php esc_html_e( 'Migrations', 'stellarwp-migrations' ); ?>

0 commit comments

Comments
 (0)