In php debug mode, errors appear in textareas
-
Hi camu,
In the settings pages there is a configuration option to specify the number of rows in a textarea, but when that is not specified by the option an errors appears in that textarea.
potential fix follows to show the change, I used array_key_exists and assumed a rows number of 4 but you may have a different opinion on the right fix : )
diff --git a/wp-content/plugins/wp-slimstat/admin/wp-slimstat-admin.php b/wp-content/plugins/wp-slimstat/admin/wp-slimstat-admin.php index 71f0771..f9ee84b 100644 --- a/wp-content/plugins/wp-slimstat/admin/wp-slimstat-admin.php +++ b/wp-content/plugins/wp-slimstat/admin/wp-slimstat-admin.php @@ -1090,7 +1090,7 @@ class wp_slimstat_admin { <td colspan="2"> <label for="<?php echo $_option_name ?>"><?php echo $_option_details['description'] ?></label> <p class="description"><?php echo $_option_details['long_description'] ?></p> - <p><textarea class="large-text code" cols="50" rows="<?php echo $_option_details['rows'] ?>" name="options[<?php echo $_option_name ?>]" id="<?php echo $_option_name ?>"><?php echo !empty(wp_slimstat::$options[$_option_name])?stripslashes(wp_slimstat::$options[$_option_name]):'' ?></textarea> <span class="description"><?php echo $_option_details['after_input_field'] ?></span></p> + <p><textarea class="large-text code" cols="50" rows="<?php echo array_key_exists('rows', $_option_details) ? $_option_details['rows'] : 4 ?>" name="options[<?php echo $_option_name ?>]" id="<?php echo $_option_name ?>"><?php echo !empty(wp_slimstat::$options[$_option_name])?stripslashes(wp_slimstat::$options[$_option_name]):'' ?></textarea> <span class="description"><?php echo $_option_details['after_input_field'] ?></span></p> </td> </tr><?php }
Cheers,
– Chris
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘In php debug mode, errors appear in textareas’ is closed to new replies.