Skip to content

Commit

Permalink
Fix #11263: Incorrect variable naming in return_dynamic_filters
Browse files Browse the repository at this point in the history
Commit ce2c327 refactored
return_dynamic_filters.php

There was an error in that refactoring where a variable name wasn't
properly renamed ($filter to $t_filter_target).

Additionally, this commit renames $t_filter_target to $f_filter_target
in accordance with the coding standards. $f_filter_target is form data
supplied by the user.
  • Loading branch information
davidhicks committed Feb 18, 2010
1 parent 7eada4f commit f812d51
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions return_dynamic_filters.php
Expand Up @@ -107,21 +107,21 @@ function return_dynamic_filters_prepend_headers() {
}
}

$t_filter_target = gpc_get_string( 'filter_target' );
$t_functionName = 'print_filter_' . utf8_substr( $t_filter_target, 0, -7 );
if ( function_exists( $t_functionName ) ) {
$f_filter_target = gpc_get_string( 'filter_target' );
$t_function_name = 'print_filter_' . utf8_substr( $f_filter_target, 0, -7 );
if ( function_exists( $t_function_name ) ) {
return_dynamic_filters_prepend_headers();
call_user_func( $t_functionName );
} else if ( 'custom_field' == utf8_substr( $t_filter_target, 0, 12 ) ) {
call_user_func( $t_function_name );
} else if ( 'custom_field' == utf8_substr( $f_filter_target, 0, 12 ) ) {
# custom function
$t_custom_id = utf8_substr( $t_filter_target, 13, -7 );
$t_custom_id = utf8_substr( $f_filter_target, 13, -7 );
return_dynamic_filters_prepend_headers();
print_filter_custom_field( $t_custom_id );
} else {
$t_plugin_filters = filter_get_plugin_filters();
$t_found = false;
foreach ( $t_plugin_filters as $t_field_name => $t_filter_object ) {
if ( $filter == $t_field_name . '_filter' ) {
if ( $t_field_name . '_filter' == $f_filter_target ) {
return_dynamic_filters_prepend_headers();
print_filter_plugin_field( $t_field_name, $t_filter_object );
$t_found = true;
Expand All @@ -131,7 +131,7 @@ function return_dynamic_filters_prepend_headers() {

if ( !$t_found ) {
# error - no function to populate the target (e.g., print_filter_foo)
error_parameters( $t_filter_target );
error_parameters( $f_filter_target );
trigger_error( ERROR_FILTER_NOT_FOUND, ERROR );
}
}

0 comments on commit f812d51

Please sign in to comment.