From 546057fc5ad1ea6158251679ab13b0d630da6ddd Mon Sep 17 00:00:00 2001 From: LeoColomb Date: Sat, 7 Sep 2013 17:49:56 +0200 Subject: [PATCH] Include once to avoid duplication --- includes/functions-html.php | 2 +- includes/functions-plugins.php | 2 +- includes/functions.php | 4 ++-- yourls-loader.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/functions-html.php b/includes/functions-html.php index 289798b..c884ad2 100644 --- a/includes/functions-html.php +++ b/includes/functions-html.php @@ -820,7 +820,7 @@ function yourls_page( $page ) { yourls_die( "Page '$page' not found", 'Not found', 404 ); } yourls_do_action( 'pre_page', $page ); - include( $include ); + include_once( $include ); yourls_do_action( 'post_page', $page ); die(); } diff --git a/includes/functions-plugins.php b/includes/functions-plugins.php index 1369405..2a5c0eb 100644 --- a/includes/functions-plugins.php +++ b/includes/functions-plugins.php @@ -431,7 +431,7 @@ function yourls_activate_plugin( $plugin ) { // attempt activation. TODO: uber cool fail proof sandbox like in WP. ob_start(); - include( YOURLS_PLUGINDIR.'/'.$plugin ); + include_once( YOURLS_PLUGINDIR.'/'.$plugin ); if ( ob_get_length() > 0 ) { // there was some output: error $output = ob_get_clean(); diff --git a/includes/functions.php b/includes/functions.php index fb6f004..9a71f5c 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1930,14 +1930,14 @@ function yourls_check_maintenance_mode() { global $maintenance_start; - include( $file ); + include_once( $file ); // If the $maintenance_start timestamp is older than 10 minutes, don't die. if ( ( time() - $maintenance_start ) >= 600 ) return; // Use any /user/maintenance.php file if( file_exists( YOURLS_USERDIR.'/maintenance.php' ) ) { - include( YOURLS_USERDIR.'/maintenance.php' ); + include_once( YOURLS_USERDIR.'/maintenance.php' ); die(); } diff --git a/yourls-loader.php b/yourls-loader.php index b500fae..9581a6b 100644 --- a/yourls-loader.php +++ b/yourls-loader.php @@ -34,7 +34,7 @@ $keyword = isset( $matches[1] ) ? $matches[1] : ''; $keyword = yourls_sanitize_keyword( $keyword ); yourls_do_action( 'load_template_go', $keyword ); - include( YOURLS_ABSPATH.'/yourls-go.php' ); + include_once( YOURLS_ABSPATH.'/yourls-go.php' ); exit; } @@ -44,7 +44,7 @@ $keyword = yourls_sanitize_keyword( $keyword ); $aggregate = isset( $matches[2] ) ? (bool)$matches[2] && yourls_allow_duplicate_longurls() : false; yourls_do_action( 'load_template_infos', $keyword ); - include( YOURLS_ABSPATH.'/yourls-infos.php' ); + include_once( YOURLS_ABSPATH.'/yourls-infos.php' ); exit; } -- 2.45.0