Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Temp var defined in global scope should be unset() after use

Fixes #15921
  • Loading branch information...
commit 5e25d9ff7a27f02c216beb2c4a01861f40f19e5b 1 parent c3d02c5
@dregad dregad authored
View
3  config_defaults_inc.php
@@ -4198,3 +4198,6 @@
*/
$g_mantistouch_url = '';
+
+# Temporary variables should not remain defined in global scope
+unset( $t_protocol, $t_host, $t_port, $t_self, $t_path, $t_use_iis );
View
2  core.php
@@ -93,6 +93,7 @@
require_once( $t_local_config );
$t_config_inc_found = true;
}
+unset( $t_local_config );
# Remember (globally) which API files have already been loaded
$g_api_included = array();
@@ -197,6 +198,7 @@ function __autoload( $className ) {
echo var_dump( $t_output );
die;
}
+unset( $t_output );
# Start HTML compression handler (if enabled)
require_api( 'compress_api.php' );
View
1  core/custom_field_api.php
@@ -75,6 +75,7 @@
foreach( $g_custom_field_types as $type ) {
require_once( config_get_global( 'core_path' ) . 'cfdefs' . DIRECTORY_SEPARATOR . 'cfdef_' . $type . '.php' );
}
+unset( $type );
function custom_field_allow_manage_display( $p_type, $p_display ) {
global $g_custom_field_type_definition;
View
12 core/plugin_api.php
@@ -138,9 +138,9 @@ function plugin_file( $p_file, $p_redirect = false, $p_basename = null ) {
* @param string Plugin basename
*/
function plugin_file_include( $p_filename, $p_basename = null ) {
-
+
global $g_plugin_mime_types;
-
+
if( is_null( $p_basename ) ) {
$t_current = plugin_get_current();
} else {
@@ -151,17 +151,17 @@ function plugin_file_include( $p_filename, $p_basename = null ) {
if( false === $t_file_path ) {
trigger_error( ERROR_GENERIC, ERROR );
}
-
+
$t_content_type = '';
$finfo = finfo_get_if_available();
-
+
if ( $finfo ) {
$t_file_info_type = $finfo->file( $t_file_path );
if ( $t_file_info_type !== false ) {
$t_content_type = $t_file_info_type;
}
}
-
+
// allow overriding the content type for specific text and image extensions
// see bug #13193 for details
if ( strpos($t_content_type, 'text/') === 0 || strpos( $t_content_type, 'image/') === 0 ) {
@@ -173,7 +173,7 @@ function plugin_file_include( $p_filename, $p_basename = null ) {
if ( $t_content_type )
header('Content-Type: ' . $t_content_type );
-
+
readfile( $t_file_path );
}
Please sign in to comment.
Something went wrong with that request. Please try again.