Commit 4cc59f2c authored by Bozosoft's avatar Bozosoft

13/08 V 7.6.1-(Dev)

- Mise à jour de adodb à la version 5.20.12 du 30/03/2018
- Mise à jour de Smarty à la version 3.1.32 du 24.04.2018
parent 3e572e6e
......@@ -9,7 +9,7 @@
*
* @author : JC Etiemble - http://jc.etiemble.free.fr
* @version : 2017
* @copyright 2007-2017 (c) JC Etiemble
* @copyright 2007-2018 (c) JC Etiemble
* @package GestAssoPhp+Pg
*/
......@@ -21,7 +21,7 @@
*/
/**** La version de GestAsssoPhp */
$VERSION = "GestAssoPhp+Pg V 7.6.0";
$VERSION = "GestAssoPhp+Pg V 7.6.1-(Dev)";
define('VERSION', $VERSION);
......
......@@ -13,6 +13,13 @@
*/
-----------------------------------
Version 7.6.1 13/08/2018 - En cours (Dev)
-----------------------------------
- Mise à jour de adodb à la version 5.20.12 du 30/03/2018
- Mise à jour de Smarty à la version 3.1.32 du 24.04.2018
-----------------------------------
Version 7.6.0 17/02/2018 - Finale
......
ADOdb License
=============
ADOdb is dual licensed under BSD and LGPL.
The ADOdb Library is dual-licensed, released under both the
[BSD 3-clause](#bsd-3-clause-license) and the
[GNU Lesser General Public License (LGPL) v2.1](#gnu-lesser-general-public-license)
or, at your option, any later version.
In plain English, you do not need to distribute your application in source code form,
nor do you need to distribute ADOdb source code, provided you follow the rest of
terms of the BSD license.
For more info about ADOdb, visit http://adodb.sourceforge.net/
For more information about ADOdb, visit http://adodb.org/
BSD 3-Clause License
--------------------
(c) 2000-2013 John Lim (jlim@natsoft.com)
(c) 2014 Damien Regad, Mark Newnham and the ADOdb community
(c) 2000-2013 John Lim (jlim@natsoft.com)
(c) 2014 Damien Regad, Mark Newnham and the ADOdb community
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
......
......@@ -5,25 +5,19 @@ ADOdb Library for PHP5
[![Download ADOdb](https://img.shields.io/sourceforge/dm/adodb.svg)](https://sourceforge.net/projects/adodb/files/latest/download)
(c) 2000-2013 John Lim (jlim@natsoft.com)
(c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both [BSD 3-Clause](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#bsd-3-clause-license)
and [GNU Lesser GPL library 2.1](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#gnu-lesser-general-public-license)
licenses.
This means you can use it in proprietary products;
(c) 2014 Damien Regad, Mark Newnham and the
[ADOdb community](https://github.com/ADOdb/ADOdb/graphs/contributors)
The ADOdb Library is dual-licensed, released under both the
[BSD 3-Clause](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#bsd-3-clause-license)
and the
[GNU Lesser General Public Licence (LGPL) v2.1](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md#gnu-lesser-general-public-license)
or, at your option, any later version.
This means you can use it in proprietary products;
see [License](https://github.com/ADOdb/ADOdb/blob/master/LICENSE.md) for details.
Home page: http://adodb.org/
> **WARNING: known issue with Associative Fetch Mode in ADOdb v5.19
-- PLEASE UPGRADE TO v5.20 !**
> When fetching data in Associative mode (i.e. when `$ADODB_FETCH_MODE` is
> set to *ADODB_FETCH_ASSOC*), recordsets do not return any data (empty strings)
> when using some database drivers. The problem has been reported on MSSQL,
> Interbase and Foxpro, but possibly affects other drivers as well; all drivers
> derived from the above are also impacted.
> For further details, please refer to [Issue #20](https://github.com/ADOdb/ADOdb/issues/20).
Introduction
============
......
......@@ -8,7 +8,7 @@ $ADODB_INCLUDED_CSV = 1;
/*
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
......
<?php
/**
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
......@@ -520,7 +520,7 @@ class ADODB_DataDict {
list($lines,$pkey,$idxs) = $this->_GenFields($flds);
// genfields can return FALSE at times
if ($lines == null) $lines = array();
list(,$first) = each($lines);
$first = current($lines);
list(,$column_def) = preg_split("/[\t ]+/",$first,2);
}
return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def));
......
<?php
/**
* @version v5.20.7 20-Sep-2016
* @version v5.20.12 30-Mar-2018
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
* Released under both BSD license and Lesser GPL library license.
......@@ -111,7 +111,7 @@ function adodb_error_pg($errormsg)
'could not serialize access due to' => DB_ERROR_SERIALIZATION_FAILURE
);
reset($error_regexps);
while (list($regexp,$code) = each($error_regexps)) {
foreach ($error_regexps as $regexp => $code) {
if (preg_match("/$regexp/mi", $errormsg)) {
return $code;
}
......
<?php
/**
* @version v5.20.7 20-Sep-2016
* @version v5.20.12 30-Mar-2018
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
* Released under both BSD license and Lesser GPL library license.
......
<?php
/**
* @version v5.20.7 20-Sep-2016
* @version v5.20.12 30-Mar-2018
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
* Released under both BSD license and Lesser GPL library license.
......
<?php
/*
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
......
......@@ -6,7 +6,7 @@ global $ADODB_INCLUDED_LIB;
$ADODB_INCLUDED_LIB = 1;
/*
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
......@@ -416,7 +416,10 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
} else
$rewritesql = "SELECT COUNT(*) FROM (".$rewritesql.")";
} else if (strncmp($zthis->databaseType,'postgres',8) == 0 || strncmp($zthis->databaseType,'mysql',5) == 0) {
} else if (strncmp($zthis->databaseType,'postgres',8) == 0
|| strncmp($zthis->databaseType,'mysql',5) == 0
|| strncmp($zthis->databaseType,'mssql',5) == 0
) {
$rewritesql = "SELECT COUNT(*) FROM ($rewritesql) _ADODB_ALIAS_";
} else {
$rewritesql = "SELECT COUNT(*) FROM ($rewritesql)";
......
......@@ -3,7 +3,7 @@
ADOdb Date Library, part of the ADOdb abstraction library
Download: http://adodb.sourceforge.net/#download
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
......@@ -816,7 +816,7 @@ global $_month_table_normal,$_month_table_leaf;
if ($marr[$m] < $d) return false;
if ($y < 1000 && $y > 3000) return false;
if ($y < 1000 || $y > 3000) return false;
return true;
}
......
......@@ -14,7 +14,7 @@
/**
\mainpage
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
......@@ -232,7 +232,7 @@ if (!defined('_ADODB_LAYER')) {
/**
* ADODB version as a string.
*/
$ADODB_vers = 'v5.20.7 20-Sep-2016';
$ADODB_vers = 'v5.20.12 30-Mar-2018';
/**
* Determines whether recordset->RecordCount() is used.
......@@ -1163,8 +1163,7 @@ if (!defined('_ADODB_LAYER')) {
foreach($inputarr as $arr) {
$sql = ''; $i = 0;
//Use each() instead of foreach to reduce memory usage -mikefedyk
while(list(, $v) = each($arr)) {
foreach ($arr as $v) {
$sql .= $sqlarr[$i];
// from Ron Baldwin <ron.baldwin#sourceprose.com>
// Only quote string types
......@@ -1497,6 +1496,9 @@ if (!defined('_ADODB_LAYER')) {
* @return the recordset ($rs->databaseType == 'array')
*/
function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0) {
$nrows = (int)$nrows;
$offset = (int)$offset;
if ($this->hasTop && $nrows > 0) {
// suggested by Reinhard Balling. Access requires top after distinct
// Informix requires first before distinct - F Riosa
......@@ -1511,7 +1513,7 @@ if (!defined('_ADODB_LAYER')) {
// access includes ties in result
if ($isaccess) {
$sql = preg_replace(
'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.((integer)$nrows).' ',$sql);
'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql);
if ($secs2cache != 0) {
$ret = $this->CacheExecute($secs2cache, $sql,$inputarr);
......@@ -1521,10 +1523,10 @@ if (!defined('_ADODB_LAYER')) {
return $ret; // PHP5 fix
} else if ($ismssql){
$sql = preg_replace(
'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.((integer)$nrows).' ',$sql);
'/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql);
} else {
$sql = preg_replace(
'/(^\s*select\s)/i','\\1 '.$this->hasTop.' '.((integer)$nrows).' ',$sql);
'/(^\s*select\s)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql);
}
} else {
$nn = $nrows + $offset;
......@@ -2392,6 +2394,7 @@ if (!defined('_ADODB_LAYER')) {
*/
function Close() {
$rez = $this->_close();
$this->_queryID = false;
$this->_connectionID = false;
return $rez;
}
......@@ -3039,6 +3042,61 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
return $rs;
}
/**
* Get the last error recorded by PHP and clear the message.
*
* By clearing the message, it becomes possible to detect whether a new error
* has occurred, even when it is the same error as before being repeated.
*
* @return array|null Array if an error has previously occurred. Null otherwise.
*/
protected function resetLastError() {
$error = error_get_last();
if (is_array($error)) {
$error['message'] = '';
}
return $error;
}
/**
* Compare a previously stored error message with the last error recorded by PHP
* to determine whether a new error has occured.
*
* @param array|null $old Optional. Previously stored return value of error_get_last().
*
* @return string The error message if a new error has occured
* or an empty string if no (new) errors have occured..
*/
protected function getChangedErrorMsg($old = null) {
$new = error_get_last();
if (is_null($new)) {
// No error has occured yet at all.
return '';
}
if (is_null($old)) {
// First error recorded.
return $new['message'];
}
$changed = false;
foreach($new as $key => $value) {
if ($new[$key] !== $old[$key]) {
$changed = true;
break;
}
}
if ($changed === true) {
return $new['message'];
}
return '';
}
} // end class ADOConnection
......@@ -4618,8 +4676,8 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
$class = $db; break;
}
$file = ADODB_DIR."/drivers/adodb-".$db.".inc.php";
@include_once($file);
$file = "drivers/adodb-$db.inc.php";
@include_once(ADODB_DIR . '/' . $file);
$ADODB_LASTDB = $class;
if (class_exists("ADODB_" . $class)) {
return $class;
......
......@@ -5,6 +5,47 @@ Older changelogs:
[v3.x](changelog_v3.x.md),
[v2.x](changelog_v2.x.md).
## 5.20.12 - 30-Mar-2018
- adodb: PHP 7.2 compatibility
- Replace each() with foreach. #373
- Replace deprecated create_function() calls. #404
- Replace $php_errormsg with error_get_last(). #405
- adodb: Don't call `dl()` when the function is disabled #406
- adodb: Don't bother with magic quotes when not available #407
- adodb: fix potential SQL injection vector in SelectLimit(). #190 #311 #401
## 5.20.11 - Withdrawn
This release has been withdrawn as it introduced a regression on PHP 5.x.
Please use version 5.20.12 or later.
## 5.20.10 - 08-Mar-2018
- Fix year validation in adodb_validdate() #375
- Release db resource when closing connection #379
- Avoid full file path disclosure in ADOLoadCode() #389
- mssql: fix PHP warning in _adodb_getcount() #359
- mssql: string keys are not allowed in parameters arrays #316
- mysqli: fix PHP warning on DB connect #348
- pdo: fix auto-commit error in sqlsrv #347
- sybase: fix PHP Warning in _connect()/_pconnect #371
## 5.20.9 - 21-Dec-2016
- mssql: fix syntax error in version matching regex #305
## 5.20.8 - 17-Dec-2016
- mssql: support MSSQL Server 2016 and later #294
- mssql: fix Find() returning no results. #298
- mssql: fix Sequence name forced to 'adodbseq'. #295, #300
- mssql: fix GenId() not returning next sequence value with SQL Server 2005/2008. #302
- mssql: fix drop/alter column with existing default constraint. #290
- mssql: fix PHP notice in MetaColumns(). #289
- oci8po: fix inconsistent variable binding in SelectLimit() #288
- oci8po: fix SelectLimit() with prepared statements #282
## 5.20.7 - 20-Sep-2016
- security: Fix SQL injection in PDO drivers qstr() method (CVE-2016-7405). #226
......@@ -28,7 +69,7 @@ Older changelogs:
- xml: Fix PHP strict warning. #260
- xml: remove calls to 'unset($this)' (PHP 7.1 compatibility). #257
## 5.20.4 - 30-Mar-2016
## 5.20.4 - 31-Mar-2016
- adodb: Fix BulkBind() param count validation. #199
- mysqli: fix PHP warning in recordset destructor. #217
......@@ -41,6 +82,7 @@ Older changelogs:
## 5.20.2 - 27-Dec-2015
- adodb: Remove a couple leftover PHP 4.x constructors (PHP7 compatibility). #139
- db2ora: Remove deprecated preg_replace '/e' flag (PHP7 compatibility). #168
- mysql: MoveNext() now respects ADODB_ASSOC_CASE. #167
- mssql, mysql, informix: Avoid PHP warning when closing recordset from destructor. #170
......
<?php
/**
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
......
<?php
/**
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
......
<?php
/*
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
......@@ -585,6 +585,8 @@ class ADODB_mysql extends ADOConnection {
// parameters use PostgreSQL convention, not MySQL
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs=0)
{
$nrows = (int) $nrows;
$offset = (int) $offset;
$offsetStr =($offset>=0) ? ((integer)$offset)."," : '';
// jason judge, see http://phplens.com/lens/lensforum/msgs.php?id=9220
if ($nrows < 0) $nrows = '18446744073709551615';
......
<?php
/*
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
......@@ -113,7 +113,7 @@ class ADODB_mysqli extends ADOConnection {
if ($persist && PHP_VERSION > 5.2 && strncmp($argHostname,'p:',2) != 0) $argHostname = 'p:'.$argHostname;
#if (!empty($this->port)) $argHostname .= ":".$this->port;
$ok = mysqli_real_connect($this->_connectionID,
$ok = @mysqli_real_connect($this->_connectionID,
$argHostname,
$argUsername,
$argPassword,
......@@ -128,7 +128,7 @@ class ADODB_mysqli extends ADOConnection {
return true;
} else {
if ($this->debug) {
ADOConnection::outp("Could't connect : " . $this->ErrorMsg());
ADOConnection::outp("Could not connect : " . $this->ErrorMsg());
}
$this->_connectionID = null;
return false;
......@@ -713,6 +713,8 @@ class ADODB_mysqli extends ADOConnection {
$inputarr = false,
$secs = 0)
{
$nrows = (int) $nrows;
$offset = (int) $offset;
$offsetStr = ($offset >= 0) ? "$offset," : '';
if ($nrows < 0) $nrows = '18446744073709551615';
......
<?php
/*
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
......
<?php
/*
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
......
<?php
/*
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
......@@ -109,6 +109,8 @@ class ADODB_postgres7 extends ADODB_postgres64 {
// which makes obsolete the LIMIT limit,offset syntax
function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
{
$nrows = (int) $nrows;
$offset = (int) $offset;
$offsetStr = ($offset >= 0) ? " OFFSET ".((integer)$offset) : '';
$limitStr = ($nrows >= 0) ? " LIMIT ".((integer)$nrows) : '';
if ($secs2cache)
......
<?php
/*
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
......
<?php
/*
@version v5.20.7 20-Sep-2016
@version v5.20.12 30-Mar-2018
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
Released under both BSD license and Lesser GPL library license.
......
<?php
/**
* @version v5.20.7 20-Sep-2016
* @version v5.20.12 30-Mar-2018
* @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
* @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
* Released under both BSD license and Lesser GPL library license.
......@@ -77,7 +77,7 @@ function _adodb_export(&$rs,$sep,$sepreplace,$fp=false,$addtitles=true,$quote =
reset($fieldTypes);
$i = 0;
$elements = array();
while(list(,$o) = each($fieldTypes)) {
foreach ($fieldTypes as $o) {
$v = ($o) ? $o->name : 'Field'.($i++);
if ($escquote) $v = str_replace($quote,$escquotequote,$v);
......
......@@ -14,13 +14,13 @@
* require_once '...path/Autoloader.php';
* Smarty_Autoloader::register();
* or
* include '...path/bootstarp.php';
* include '...path/bootstrap.php';
*
* $smarty = new Smarty();
*/
class Smarty_Autoloader
{
/**
/**
* Filepath to Smarty root
*
* @var string
......@@ -76,7 +76,7 @@ class Smarty_Autoloader
self::$SMARTY_DIR = defined('SMARTY_DIR') ? SMARTY_DIR : dirname(__FILE__) . DIRECTORY_SEPARATOR;
self::$SMARTY_SYSPLUGINS_DIR = defined('SMARTY_SYSPLUGINS_DIR') ? SMARTY_SYSPLUGINS_DIR :
self::$SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR;
if (version_compare(phpversion(), '5.3.0', '>=')) {
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend);
} else {
spl_autoload_register(array(__CLASS__, 'autoload'));
......
......@@ -27,3 +27,5 @@ To retrieve the development and documentation folders add
"smarty/smarty-dev": "~3.1@dev"
}
If you are using (include) the composer generated autoloader.php which is located