Is it kosher to directly access and check the http referer
-
I could not specifically find any other way to access what page I was on. This particular WooCommerce hook loads before get_current_screen or is_page() is available to me during the form submission, and I needed a way to tell my function exactly where I was in the dashboard for one specific form submission.
The plugin that I was applying this fix to was built by someone else, and I was trying to tie it into my theme that I built for a client. The plugin developer does not supply any kind of hooks or filters whatsoever, sadly. They rely on their own back-and-forth of classes and methods.
With that in mind, is it kosher to get the value of $_POST[‘_wp_http_referer’] and check a specific value against it in the following way:
function my_function(){ $referer = '[specific http referer that you're lookin for here]'; if($_POST['_wp_http_referer'] == $referer){ //Do Stuff here } } add_action('woocommerce_checkout_update_order_meta','my_function');
Does this create any kind of security concern?
- The topic ‘Is it kosher to directly access and check the http referer’ is closed to new replies.