From 9b27bf86af9ad06c76fa4dd98b037a648f00435b Mon Sep 17 00:00:00 2001 From: Tom McFarlin Date: Sat, 11 May 2013 17:38:50 -0400 Subject: [PATCH] Adding a security check to prevent files from accessing the boilerplate directly Fixes #43 --- plugin-boilerplate/plugin-boilerplate.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugin-boilerplate/plugin-boilerplate.php b/plugin-boilerplate/plugin-boilerplate.php index 9a4254c..1ea5d0c 100644 --- a/plugin-boilerplate/plugin-boilerplate.php +++ b/plugin-boilerplate/plugin-boilerplate.php @@ -13,6 +13,16 @@ License URI: http://www.gnu.org/licenses/gpl.txt Copyright 2013 TODO (email@domain.com) */ +/** + * If this file is attempted to be accessed directly, we'll exit. + * + * The following check provides a level of security from other files + * that request data directly. + */ +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + /* * The following constant is used to define a constant for this plugin to make it * easier to provide cache-busting functionality on loading stylesheets