Skip to content
Snippets Groups Projects
Commit 5f91d9a0 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge remote-tracking branch 'origin/3.5' into 3.5_backported

parents 42b75ccf d9e08925
No related branches found
No related tags found
No related merge requests found
...@@ -159,7 +159,7 @@ Comments: ...@@ -159,7 +159,7 @@ Comments:
Those files are not shipped in the binary package as we Those files are not shipped in the binary package as we
configure Dolibarr to use Dejavu fonts from "fonts-dejavu-core". configure Dolibarr to use Dejavu fonts from "fonts-dejavu-core".
Files: docs/images/* Files: doc/images/*
Copyright: Laurent Destailleur Copyright: Laurent Destailleur
License: CC-BY-SA-3.0 License: CC-BY-SA-3.0
You are free: You are free:
...@@ -176,7 +176,7 @@ License: CC-BY-SA-3.0 ...@@ -176,7 +176,7 @@ License: CC-BY-SA-3.0
. .
For more information, see http://creativecommons.org/licenses/by-sa/3.0/ For more information, see http://creativecommons.org/licenses/by-sa/3.0/
Files: htdocs/includes/fpdi/* Files: htdocs/includes/fpdfi/*
Copyright: 2004-2011 Setasign - Jan Slabon Copyright: 2004-2011 Setasign - Jan Slabon
License: GPL-2+ License: GPL-2+
This program is free software; you can redistribute it This program is free software; you can redistribute it
......
<?php <?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -88,7 +89,7 @@ if ($actionsave) ...@@ -88,7 +89,7 @@ if ($actionsave)
// Save nb of agenda // Save nb of agenda
if (! $error) if (! $error)
{ {
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0,'',$conf->entity); $res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','int')),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++; if (! $res > 0) $error++;
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB; $MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
...@@ -201,9 +202,9 @@ while ($i <= $MAXAGENDA) ...@@ -201,9 +202,9 @@ while ($i <= $MAXAGENDA)
// Nb // Nb
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>"; print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
// Name // Name
print '<td><input type="text" class="flat hideifnotset" name="agenda_ext_name'.$key.'" value="'. (GETPOST('agenda_ext_name'.$key)?GETPOST('agenda_ext_name'.$key):$conf->global->$name) . '" size="28"></td>'; print '<td><input type="text" class="flat hideifnotset" name="agenda_ext_name'.$key.'" value="'. (GETPOST('agenda_ext_name'.$key)?GETPOST('agenda_ext_name'.$key, 'alpha'):$conf->global->$name) . '" size="28"></td>';
// URL // URL
print '<td><input type="url" class="flat hideifnotset" name="agenda_ext_src'.$key.'" value="'. (GETPOST('agenda_ext_src'.$key)?GETPOST('agenda_ext_src'.$key):$conf->global->$src) . '" size="60"></td>'; print '<td><input type="url" class="flat hideifnotset" name="agenda_ext_src'.$key.'" value="'. (GETPOST('agenda_ext_src'.$key)?GETPOST('agenda_ext_src'.$key, 'alpha'):$conf->global->$src) . '" size="60"></td>';
// Color (Possible colors are limited by Google) // Color (Possible colors are limited by Google)
print '<td class="nowrap" align="right">'; print '<td class="nowrap" align="right">';
//print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* Upgrade scripts can be ran from command line with syntax: * Upgrade scripts can be ran from command line with syntax:
* *
* cd htdocs/install * cd htdocs/install
* php upgrade.php 3.4.0 3.5.0 * php upgrade.php 3.4.0 3.5.0 [dirmodule|ignoredbversion]
* php upgrade2.php 3.4.0 3.5.0 * php upgrade2.php 3.4.0 3.5.0
* *
* Return code is 0 if OK, >0 if error * Return code is 0 if OK, >0 if error
...@@ -54,7 +54,8 @@ $setuplang=GETPOST("selectlang",'',3)?GETPOST("selectlang",'',3):'auto'; ...@@ -54,7 +54,8 @@ $setuplang=GETPOST("selectlang",'',3)?GETPOST("selectlang",'',3):'auto';
$langs->setDefaultLang($setuplang); $langs->setDefaultLang($setuplang);
$versionfrom=GETPOST("versionfrom",'',3)?GETPOST("versionfrom",'',3):(empty($argv[1])?'':$argv[1]); $versionfrom=GETPOST("versionfrom",'',3)?GETPOST("versionfrom",'',3):(empty($argv[1])?'':$argv[1]);
$versionto=GETPOST("versionto",'',3)?GETPOST("versionto",'',3):(empty($argv[2])?'':$argv[2]); $versionto=GETPOST("versionto",'',3)?GETPOST("versionto",'',3):(empty($argv[2])?'':$argv[2]);
$versionmodule=GETPOST("versionmodule",'',3)?GETPOST("versionmodule",'',3):(empty($argv[3])?'':$argv[3]); $versionmodule=(GETPOST("versionmodule",'',3) && GETPOST("versionmodule",'',3) != 'ignoredbversion')?GETPOST("versionmodule",'',3):((empty($argv[3]) || $argv[3] == 'ignoredbversion')?'':$argv[3]);
$ignoredbversion=(GETPOST('ignoredbversion','',3)=='ignoredbversion')?GETPOST('ignoredbversion','',3):((empty($argv[3]) || $argv[3] != 'ignoredbversion')?'':$argv[3]);
$langs->load("admin"); $langs->load("admin");
$langs->load("install"); $langs->load("install");
......
...@@ -80,13 +80,15 @@ function test_sql_and_script_inject($val, $type) ...@@ -80,13 +80,15 @@ function test_sql_and_script_inject($val, $type)
// For SQL Injection (only GET and POST are used to be included into bad escaped SQL requests) // For SQL Injection (only GET and POST are used to be included into bad escaped SQL requests)
if ($type != 2) if ($type != 2)
{ {
$sql_inj += preg_match('/delete[\s]+from/i', $val); $sql_inj += preg_match('/delete\s+from/i', $val);
$sql_inj += preg_match('/create[\s]+table/i', $val); $sql_inj += preg_match('/create\s+table/i', $val);
$sql_inj += preg_match('/update.+set.+=/i', $val); $sql_inj += preg_match('/update.+set.+=/i', $val);
$sql_inj += preg_match('/insert[\s]+into/i', $val); $sql_inj += preg_match('/insert\s+into/i', $val);
$sql_inj += preg_match('/select.+from/i', $val); $sql_inj += preg_match('/select.+from/i', $val);
$sql_inj += preg_match('/union.+select/i', $val); $sql_inj += preg_match('/union.+select/i', $val);
$sql_inj += preg_match('/(\.\.%2f)+/i', $val); $sql_inj += preg_match('/into\s+(outfile|dumpfile)/i', $val);
$sql_inj += preg_match('/(\.\.%2f)+/i', $val);
$sql_inj += preg_match('/onerror=/i', $val);
} }
// For XSS Injection done by adding javascript with script // For XSS Injection done by adding javascript with script
// This is all cases a browser consider text is javascript: // This is all cases a browser consider text is javascript:
...@@ -94,7 +96,8 @@ function test_sql_and_script_inject($val, $type) ...@@ -94,7 +96,8 @@ function test_sql_and_script_inject($val, $type)
// All examples on page: http://ha.ckers.org/xss.html#XSScalc // All examples on page: http://ha.ckers.org/xss.html#XSScalc
$sql_inj += preg_match('/<script/i', $val); $sql_inj += preg_match('/<script/i', $val);
if (! defined('NOSTYLECHECK')) $sql_inj += preg_match('/<style/i', $val); if (! defined('NOSTYLECHECK')) $sql_inj += preg_match('/<style/i', $val);
$sql_inj += preg_match('/base[\s]+href/i', $val); $sql_inj += preg_match('/base[\s]+href/si', $val);
$sql_inj += preg_match('/<.*onmouse/si', $val); // onmouseover can be set on img or any html tag like <img title='>' onmouseover=alert(1)>
if ($type == 1) if ($type == 1)
{ {
$sql_inj += preg_match('/javascript:/i', $val); $sql_inj += preg_match('/javascript:/i', $val);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment