Created
November 19, 2024 12:41
-
-
Save kharissulistiyo/4d29d3ee1487824d89818de7f3c67431 to your computer and use it in GitHub Desktop.
Bad code sample: Cross Site Request Forgery (CSRF) vulnerability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public static function render_settings_page() { | |
if ( isset( $_POST['save_settings'] ) ) { | |
self::save_settings( $_POST ); | |
} | |
wp_enqueue_style( 'cew-settings', CEW_URL . 'assets/css/settings.css', array(), CEW_VERSION ); | |
wp_enqueue_script( 'cew-settings', CEW_URL . 'assets/js/scripts.js', array( 'jquery', 'jquery-ui' ), CEW_VERSION, true ); | |
wp_localize_script( | |
'cew-settings', | |
'cew', | |
array( | |
'ajax_url' => admin_url( 'admin-ajax.php' ), | |
) | |
); | |
include_once CEW_PATH . '/templates/settings.php'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment