[drupal-devel] warnings for bootstrap.inc and common.inc
bootstrap.inc drupal_unpack, line 489 $field is not used and as it has a default value, we can nicely delete it. common.inc: error_handler, line 379 the parameter $variables seems to be not used in this function _fix_gpc_magic, line 392 $key is not used. form_file, line 1354 $error is used but I have not seen where it is initialized. Maybe this should be $name? These are produced by jEdit's PHPParser. It causes false warnings with references, but these three seems to be valid. I am not sure whether I shall fill a bug report or not, only the last one seems to be a real bug. Shall I continue with more files? Regards NK
Negyesi Karoly wrote:
bootstrap.inc
drupal_unpack, line 489 $field is not used and as it has a default value, we can nicely delete it.
-1. It is not used in core, but it is used by forms.module.
common.inc:
error_handler, line 379 the parameter $variables seems to be not used in this function
+/-1. The error_hanlder() function is a PHP callback set using set_error_handler(). Consult PHP's documenation on set_error_handler()?
_fix_gpc_magic, line 392 $key is not used.
+1. Looks like $key can be removed.
form_file, line 1354 $error is used but I have not seen where it is initialized. Maybe this should be $name?
+1. $error should be $name. That would be a bug.
Shall I continue with more files?
Sure, but filter out the false positives. -- Dries Buytaert :: http://www.buytaert.net/
common.inc:
error_handler, line 379 the parameter $variables seems to be not used in this function +/-1. The error_hanlder() function is a PHP callback set using set_error_handler(). Consult PHP's documenation on set_error_handler()?
errcontext The fifth parameter is optional, As we do not use it, and it is optional anyways, I say, let it go.
_fix_gpc_magic, line 392 $key is not used. +1. Looks like $key can be removed. form_file, line 1354 $error is used but I have not seen where it is initialized. Maybe this should be $name? +1. $error should be $name. That would be a bug.
I'll submit a two line patch for these, OK.
Shall I continue with more files? Sure, but filter out the false positives.
I will do my best. Regards NK
On 1-Mar-05, at 2:42 AM, Dries Buytaert wrote:
Negyesi Karoly wrote:
bootstrap.inc drupal_unpack, line 489 $field is not used and as it has a default value, we can nicely delete it.
-1. It is not used in core, but it is used by forms.module.
I can easily change forms.module (if it helps). -- James Walker :: http://www.walkah.net/
On Feb 28, 2005, at 7:03 PM, Negyesi Karoly wrote:
bootstrap.inc
drupal_unpack, line 489 $field is not used and as it has a default value, we can nicely delete it.
$field is definately used here in the expression $obj->$field ... perhaps you mean that we never call this function using a value other than 'data' for $field. Thats OK. This is a generic unpack function, and keeping that field makes it future-proof. We don't know how Contributed or private modules might be using this function.
participants (4)
-
Dries Buytaert -
James Walker -
Moshe Weitzman -
Negyesi Karoly