13. Prácticas importantes de seguridad

  • strict warning: Only variables should be passed by reference in /home/gwolf/drupal6/sites/gwolf.org/modules/captcha/captcha.inc on line 61.
  • strict warning: Declaration of views_handler_filter_node_status::operator_form() should be compatible with views_handler_filter::operator_form(&$form, &$form_state) in /home/gwolf/drupal6/sites/gwolf.org/modules/views/modules/node/views_handler_filter_node_status.inc on line 13.
  • warning: Creating default object from empty value in /home/gwolf/drupal6/sites/gwolf.org/modules/views/modules/comment/views_handler_field_comment_username.inc on line 32.
  • warning: Creating default object from empty value in /home/gwolf/drupal6/sites/gwolf.org/modules/views/modules/comment/views_handler_field_comment_username.inc on line 32.
  • warning: Creating default object from empty value in /home/gwolf/drupal6/sites/gwolf.org/modules/views/modules/comment/views_handler_field_comment_username.inc on line 32.
  • warning: Creating default object from empty value in /home/gwolf/drupal6/sites/gwolf.org/modules/views/modules/comment/views_handler_field_comment_username.inc on line 32.
  • warning: Creating default object from empty value in /home/gwolf/drupal6/sites/gwolf.org/modules/views/modules/comment/views_handler_field_comment_username.inc on line 32.
  • strict warning: Only variables should be passed by reference in /home/gwolf/drupal6/sites/gwolf.org/modules/captcha/captcha.inc on line 61.
  • Uso del pragma strict
    • vars: Evitar variables no declaradas, sin ámbito o sin calificación de espacio de nombres completa.
      No permite el uso de variables declaradas con local - únicamente con use vars, our, my, o nombre completo ($main::var)
    • refs: Evitar referencias simbólicas - Por ejemplo:
      1. $var = 'valor';
      2. print $$var; # Si no usamos strict, imprime $valor
    • subs: No permite el uso de barewords (palabras sueltas) - exige que las llamadas a funciones se expliciten, ya sea anteponiendo el signo & o especificando una lista de parámetros entre paréntesis (aunque esté vacía).
  • Reporte de warnings (por switch/variable, por pragma)
  • Nunca dejar cosas sin revisar
  • Mayor información: