Skip to content

[Insight] Global variable or function should never be used - in core/security/functions.php, line 6 #8

@Josexv1

Description

@Josexv1

in core/security/functions.php, line 6

getDataBySession() adds to the global scope. Prefer class properties or methods to let other developers know what this relates to.

<?php
/*
  funcion: Procesa una busqueda en la base de datos de los datos del usuario pedido
  return: Retorna un arreglo con todos los datos del usuario pasado por argumento.
 */
    function getDataBySession($session, PDO $db){
    $query = "SELECT nombre, 
                     apellido
              FROM   usuarios 
              WHERE  cookie = :id 
             "; 

Posted from SensioLabsInsight

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions