PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.13
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.13
1.1.13 1.1.12 1.1.11 1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 All 37 releases
← All changes | includes/core/routing.php +20 -0 1.1.8 → 1.1.13 View file →
@@ -424,8 +424,28 @@
424 424 return '1' === sanitize_text_field( wp_unslash( $_GET[ OPENSTATION_CLASSIC_FLAG ] ) );
425 425 }
426 426
427 427 /**
428 + * Whether the request came from a classic-override page. A navigation
429 + * a page starts from script (`location.href = …`, as "Edit with
430 + * Elementor" does) carries no flag, but its Referer still does.
431 + *
432 + * @return bool
433 + */
434 +function openstation_is_classic_referer() {
435 + if ( empty( $_SERVER['HTTP_REFERER'] ) ) {
436 + return false;
437 + }
438 + $referer = esc_url_raw( wp_unslash( $_SERVER['HTTP_REFERER'] ) );
439 + $query = wp_parse_url( $referer, PHP_URL_QUERY );
440 + if ( ! openstation_url_is_same_admin( $referer ) || ! is_string( $query ) ) {
441 + return false;
442 + }
443 + parse_str( $query, $args );
444 + return isset( $args[ OPENSTATION_CLASSIC_FLAG ] ) && '1' === $args[ OPENSTATION_CLASSIC_FLAG ];
445 +}
446 +
447 +/**
428 448 * Checks whether the browser is fetching this request as a
429 449 * sub-resource of some page rather than navigating to it.
430 450 *
431 451 * Admin URLs serve more than pages. Jetpack's admin-bar sparkline is