Skip to content

Commit

Permalink
Fix code standard
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Apr 6, 2015
1 parent a5c74a7 commit 828dc2c
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion htdocs/core/modules/mailings/contacts1.modules.php
Expand Up @@ -85,7 +85,7 @@ function getSqlArrayForStats()
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @param string $sql Requete sql de comptage
* @return int
*/
function getNbOfRecipients($sql='')
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/mailings/contacts2.modules.php
Expand Up @@ -152,7 +152,7 @@ function getSqlArrayForStats()
/**
* Return here number of distinct emails returned by your selector.
*
* @param string $sql Requete sql de comptage
* @param string $sql Requete sql de comptage
* @return int
*/
function getNbOfRecipients($sql='')
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/mailings/contacts3.modules.php
Expand Up @@ -157,7 +157,7 @@ function getSqlArrayForStats()
/**
* Return here number of distinct emails returned by your selector.
*
* @param string $sql Requete sql de comptage
* @param string $sql Requete sql de comptage
* @return int Number of recipients
*/
function getNbOfRecipients($sql='')
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/mailings/contacts4.modules.php
Expand Up @@ -158,7 +158,7 @@ function getSqlArrayForStats()
/**
* Return here number of distinct emails returned by your selector.
*
* @param string $sql Requete sql de comptage
* @param string $sql Requete sql de comptage
* @return int Number of recipients
*/
function getNbOfRecipients($sql='')
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/modules/mailings/example.modules.php
Expand Up @@ -100,8 +100,8 @@ function getSqlArrayForStats()
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int
* @param string $sql Requete sql de comptage
* @return int|string Number of recipient or '?'
*/
function getNbOfRecipients($sql='')
{
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/modules/mailings/fraise.modules.php
Expand Up @@ -86,8 +86,8 @@ function getSqlArrayForStats()
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int Nb of recipients
* @param string $sql Requete sql de comptage
* @return int Nb of recipients
*/
function getNbOfRecipients($sql='')
{
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/modules/mailings/framboise.modules.php
Expand Up @@ -150,8 +150,8 @@ function getSqlArrayForStats()
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int Nb of recipients
* @param string $sql Requete sql de comptage
* @return int Nb of recipients
*/
function getNbOfRecipients($sql='')
{
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/modules/mailings/modules_mailings.php
Expand Up @@ -72,8 +72,8 @@ function getNbOfRecords()
/**
* Retourne nombre de destinataires
*
* @param string $sql Requete sql de comptage
* @return int Nb de destinataires si ok, < 0 si erreur
* @param string $sql Sql request to count
* @return int Nb of recipient, or <0 if error
*/
function getNbOfRecipients($sql)
{
Expand All @@ -85,7 +85,7 @@ function getNbOfRecipients($sql)
}
else
{
$this->error=$this->db->error();
$this->error=$this->db->lasterror();
return -1;
}
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/mailings/thirdparties.modules.php
Expand Up @@ -157,7 +157,7 @@ function getSqlArrayForStats()
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int Nb of recipients
* @return int Nb of recipients
*/
function getNbOfRecipients($sql='')
{
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/modules/mailings/xinputfile.modules.php
Expand Up @@ -73,8 +73,8 @@ function getSqlArrayForStats()
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int '' means NA
* @param string $sql Sql request to count
* @return string '' means NA
*/
function getNbOfRecipients($sql='')
{
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/modules/mailings/xinputuser.modules.php
Expand Up @@ -73,8 +73,8 @@ function getSqlArrayForStats()
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int '' means NA
* @param string $sql Sql request to count
* @return string '' means NA
*/
function getNbOfRecipients($sql='')
{
Expand Down
16 changes: 8 additions & 8 deletions htdocs/main.inc.php
Expand Up @@ -111,17 +111,17 @@ function test_sql_and_script_inject($val, $type)
/**
* Security: Return true if OK, false otherwise.
*
* @param string $var Variable name
* @param string $type 1=GET, 0=POST, 2=PHP_SELF
* @return boolean true if there is an injection
* @param string $var Variable name
* @param string $type 1=GET, 0=POST, 2=PHP_SELF
* @return boolean||null true if there is an injection. Stop code if injection found.
*/
function analyse_sql_and_script(&$var, $type)
function analyseVarsForSqlAndScriptsInjection(&$var, $type)
{
if (is_array($var))
{
foreach ($var as $key => $value)
{
if (analyse_sql_and_script($value,$type))
if (analyseVarsForSqlAndScriptsInjection($value,$type))
{
$var[$key] = $value;
}
Expand All @@ -147,16 +147,16 @@ function analyse_sql_and_script(&$var, $type)
if (! empty($_SERVER["PHP_SELF"]))
{
$morevaltochecklikepost=array($_SERVER["PHP_SELF"]);
analyse_sql_and_script($morevaltochecklikepost,2);
analyseVarsForSqlAndScriptsInjection($morevaltochecklikepost,2);
}
// Sanity check on GET parameters
if (! empty($_SERVER["QUERY_STRING"]))
{
$morevaltochecklikeget=array($_SERVER["QUERY_STRING"]);
analyse_sql_and_script($morevaltochecklikeget,1);
analyseVarsForSqlAndScriptsInjection($morevaltochecklikeget,1);
}
// Sanity check on POST
analyse_sql_and_script($_POST,0);
analyseVarsForSqlAndScriptsInjection($_POST,0);

// This is to make Dolibarr working with Plesk
if (! empty($_SERVER['DOCUMENT_ROOT'])) set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
Expand Down

0 comments on commit 828dc2c

Please sign in to comment.