Created
September 14, 2016 03:41
-
-
Save mattparlane/30526520638042581de8980282386270 to your computer and use it in GitHub Desktop.
WordPress plugin to add random padding to pages as an added mitigation against the BREACH attack.
This file contains 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 | |
/* | |
Plugin Name: Add Random Padding | |
Description: Adds random padding to the end of pages as an added (but not complete) mitigation against BREACH et al. | |
*/ | |
function add_random_padding() { | |
echo str_repeat(' ', mt_rand(0, 20)); | |
} | |
add_action( 'wp_footer', 'add_random_padding', 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment