Commit d2e25417 authored by Bozosoft's avatar Bozosoft

Version 7.4.0 05/11/2016

parent f4776f01
......@@ -21,7 +21,7 @@
*/
/**** La version de GestAsssoPhp */
$VERSION = "GestAssoPhp+Pg V 7.3.0";
$VERSION = "GestAssoPhp+Pg V 7.4.0";
define('VERSION', $VERSION);
......
......@@ -12,6 +12,14 @@
* @package GestAssoPhp+Pg
*/
Version 7.4.0 05/11/2016 - Finale
-----------------------
- Correction sur tables_description contenu _preference_asso en 9 voir dossier /doc
- Mise à jour de adodb à la version 5.20.7 du 20/09/2016
- Mise à jour de Smarty à la version 3.1.30 du 07/08/2016
Version 7.3.0 05/04/2016 - Finale
-----------------------
......
This source diff could not be displayed because it is too large. You can view the blob instead.
File mode changed from 100644 to 100755
......@@ -2,6 +2,7 @@ ADOdb Library for PHP5
======================
[![Join chat on Gitter](https://img.shields.io/gitter/room/form-data/form-data.svg)](https://gitter.im/adodb/adodb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![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
......@@ -12,7 +13,7 @@ licenses.
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.sourceforge.net/
Home page: http://adodb.org/
> **WARNING: known issue with Associative Fetch Mode in ADOdb v5.19
-- PLEASE UPGRADE TO v5.20 !**
......@@ -66,18 +67,14 @@ print "</pre>";
Documentation and Examples
==========================
Refer to the `docs` directory for library documentation and examples.
Refer to the [ADOdb website](http://adodb.org/) for library documentation and examples. The documentation can also be [downloaded for offline viewing](https://sourceforge.net/projects/adodb/files/Documentation/).
- Main documentation: `docs-adodb.htm`.
Query, update and insert records using a portable API.
- Data dictionary docs: `docs-datadict.htm`.
Describes how to create database tables and indexes in a portable manner.
- Database performance monitoring docs: `docs-perf.htm`.
Allows you to perform health checks, tune and monitor your database.
- Database-backed session docs: `docs-session.htm`.
- [Main documentation](http://adodb.org/dokuwiki/doku.php?id=v5:userguide:userguide_index): Query, update and insert records using a portable API.
- [Data dictionary](http://adodb.org/dokuwiki/doku.php?id=v5:dictionary:dictionary_index) describes how to create database tables and indexes in a portable manner.
- [Database performance monitoring](http://adodb.org/dokuwiki/doku.php?id=v5:performance:performance_index) allows you to perform health checks, tune and monitor your database.
- [Database-backed sessions](http://adodb.org/dokuwiki/doku.php?id=v5:session:session_index).
There is also a tutorial `tute.htm` that contrasts ADOdb code with
mysql code.
There is also a [tutorial](http://adodb.org/dokuwiki/doku.php?id=v5:userguide:mysql_tutorial) that contrasts ADOdb code with PHP native MySQL code.
Files
......
......@@ -8,7 +8,7 @@ $ADODB_INCLUDED_CSV = 1;
/*
@version v5.20.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@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.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@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.3 01-Jan-2016
* @version v5.20.7 20-Sep-2016
* @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.3 01-Jan-2016
* @version v5.20.7 20-Sep-2016
* @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.3 01-Jan-2016
* @version v5.20.7 20-Sep-2016
* @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.
......@@ -33,16 +33,16 @@ var $database = '';
case 'EXECUTE':
$this->sql = is_array($p1) ? $p1[0] : $p1;
$this->params = $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$this->sql\")\n";
$s = "$dbms error: [$errno: $errmsg] in $fn(\"$this->sql\")";
break;
case 'PCONNECT':
case 'CONNECT':
$user = $thisConnection->user;
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, '$user', '****', $p2)\n";
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, '$user', '****', $p2)";
break;
default:
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)\n";
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)";
break;
}
......
<?php
/*
@version v5.20.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@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.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@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.
......@@ -426,7 +426,7 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
if ( strpos($sql, '_ADODB_COUNT') !== FALSE ) {
$rewritesql = preg_replace('/^\s*?SELECT\s+_ADODB_COUNT(.*)_ADODB_COUNT\s/is','SELECT COUNT(*) ',$sql);
} else {
$rewritesql = preg_replace('/^\s*?SELECT\s.*?\s+(.*?)\s+FROM\s/is','SELECT COUNT(*) FROM ',$sql);
$rewritesql = preg_replace('/^\s*SELECT\s.*\s+FROM\s/Uis','SELECT COUNT(*) FROM ',$sql);
}
// fix by alexander zhukov, alex#unipack.ru, because count(*) and 'order by' fails
// with mssql, access and postgresql. Also a good speedup optimization - skips sorting!
......
......@@ -3,7 +3,7 @@
ADOdb Date Library, part of the ADOdb abstraction library
Download: http://adodb.sourceforge.net/#download
@version v5.20.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
......
......@@ -14,7 +14,7 @@
/**
\mainpage
@version v5.20.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
@copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
......@@ -37,6 +37,21 @@
if (!defined('_ADODB_LAYER')) {
define('_ADODB_LAYER',1);
// The ADOdb extension is no longer maintained and effectively unsupported
// since v5.04. The library will not function properly if it is present.
if(defined('ADODB_EXTENSION')) {
$msg = "Unsupported ADOdb Extension (v" . ADODB_EXTENSION . ") detected! "
. "Disable it to use ADOdb";
$errorfn = defined('ADODB_ERROR_HANDLER') ? ADODB_ERROR_HANDLER : false;
if ($errorfn) {
$conn = false;
$errorfn('ADOdb', basename(__FILE__), -9999, $msg, null, null, $conn);
} else {
die($msg . PHP_EOL);
}
}
//==============================================================================================
// CONSTANT DEFINITIONS
//==============================================================================================
......@@ -217,7 +232,7 @@ if (!defined('_ADODB_LAYER')) {
/**
* ADODB version as a string.
*/
$ADODB_vers = 'v5.20.3 01-Jan-2016';
$ADODB_vers = 'v5.20.7 20-Sep-2016';
/**
* Determines whether recordset->RecordCount() is used.
......@@ -658,23 +673,23 @@ if (!defined('_ADODB_LAYER')) {
}
if (isset($rez)) {
$err = $this->ErrorMsg();
$errno = $this->ErrorNo();
if (empty($err)) {
$err = "Connection error to server '$argHostname' with user '$argUsername'";
}
$ret = false;
} else {
$err = "Missing extension for ".$this->dataProvider;
$ret = 0;
$errno = 0;
}
if ($fn = $this->raiseErrorFn) {
$fn($this->databaseType,'CONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this);
$fn($this->databaseType, 'CONNECT', $errno, $err, $this->host, $this->database, $this);
}
$this->_connectionID = false;
if ($this->debug) {
ADOConnection::outp( $this->host.': '.$err);
}
return $ret;
return false;
}
function _nconnect($argHostname, $argUsername, $argPassword, $argDatabaseName) {
......@@ -1116,20 +1131,35 @@ if (!defined('_ADODB_LAYER')) {
$sqlarr = explode('?',$sql);
$nparams = sizeof($sqlarr)-1;
if (!$array_2d) {
// When not Bind Bulk - convert to array of arguments list
$inputarr = array($inputarr);
} else {
// Bulk bind - Make sure all list of params have the same number of elements
$countElements = array_map('count', $inputarr);
if (1 != count(array_unique($countElements))) {
$this->outp_throw(
"[bulk execute] Input array has different number of params [" . print_r($countElements, true) . "].",
'Execute'
);
return false;
}
unset($countElements);
}
// Make sure the number of parameters provided in the input
// array matches what the query expects
if ($nparams != count($inputarr)) {
$element0 = reset($inputarr);
if ($nparams != count($element0)) {
$this->outp_throw(
"Input array has " . count($inputarr) .
"Input array has " . count($element0) .
" params, does not match query: '" . htmlspecialchars($sql) . "'",
'Execute'
);
return false;
}
if (!$array_2d) {
$inputarr = array($inputarr);
}
// clean memory
unset($element0);
foreach($inputarr as $arr) {
$sql = ''; $i = 0;
......
......@@ -5,6 +5,34 @@ Older changelogs:
[v3.x](changelog_v3.x.md),
[v2.x](changelog_v2.x.md).
## 5.20.7 - 20-Sep-2016
- security: Fix SQL injection in PDO drivers qstr() method (CVE-2016-7405). #226
- oci8po: prevent segfault on PHP 7. #259
- pdo/mysql: Fix MetaTables() method. #275
## 5.20.6 - 31-Aug-2016
- security: Fix XSS vulnerability in old test script (CVE-2016-4855). #274
- adodb: Exit with error/exception when the ADOdb Extension is loaded. #269
- adodb: Fix truncated exception messages. #273
## 5.20.5 - 10-Aug-2016
- adodb: Fix fatal error when connecting with missing extension. #254
- adodb: Fix _adodb_getcount(). #236
- mssql: Destructor fails if recordset already closed. #268
- mssql: Use SQL server native data types if available. #234
- mysqli: Fix PHP notice in _close() method. #240
- pdo: Let driver handle SelectDB() and SQLDate() calls. #242
- xml: Fix PHP strict warning. #260
- xml: remove calls to 'unset($this)' (PHP 7.1 compatibility). #257
## 5.20.4 - 30-Mar-2016
- adodb: Fix BulkBind() param count validation. #199
- mysqli: fix PHP warning in recordset destructor. #217
- mysqli: cast port number to int when connecting (PHP7 compatibility). #218
## 5.20.3 - 01-Jan-2016
......
<?php
/**
@version v5.20.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@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.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@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.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@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.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@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.
......@@ -118,7 +118,8 @@ class ADODB_mysqli extends ADOConnection {
$argUsername,
$argPassword,
$argDatabasename,
$this->port,
# PHP7 compat: port must be int. Use default port if cast yields zero
(int)$this->port != 0 ? (int)$this->port : 3306,
$this->socket,
$this->clientFlags);
......@@ -1053,13 +1054,13 @@ class ADORecordSet_mysqli extends ADORecordSet{
//if results are attached to this pointer from Stored Proceedure calls, the next standard query will die 2014
//only a problem with persistant connections
if($this->connection->_connectionID) {
if(isset($this->connection->_connectionID) && $this->connection->_connectionID) {
while(mysqli_more_results($this->connection->_connectionID)){
mysqli_next_result($this->connection->_connectionID);
}
}
if($this->_queryID) {
if($this->_queryID instanceof mysqli_result) {
mysqli_free_result($this->_queryID);
}
$this->_queryID = false;
......
<?php
/*
@version v5.20.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@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.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@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.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@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.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@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.3 01-Jan-2016
@version v5.20.7 20-Sep-2016
@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.
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
<?php
/**
* @version v5.20.3 01-Jan-2016
* @version v5.20.7 20-Sep-2016
* @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.
......
......@@ -57,7 +57,7 @@ class Smarty_Autoloader
set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false
) {
$registeredAutoLoadFunctions = spl_autoload_functions();
if (!isset($registeredAutoLoadFunctions['spl_autoload'])) {
if (!isset($registeredAutoLoadFunctions[ 'spl_autoload' ])) {
spl_autoload_register();
}
} else {
......@@ -90,34 +90,17 @@ class Smarty_Autoloader
public static function autoload($class)
{
$_class = strtolower($class);
$file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php';
if (strpos($_class, 'smarty_internal_') === 0) {
if (strpos($_class, 'smarty_internal_compile_') === 0) {
if (is_file($file)) {
require $file;
}
return;
}
@include $file;
return;
}
if (preg_match('/^(smarty_(((template_(source|config|cache|compiled|resource_base))|((cached|compiled)?resource)|(variable|security)))|(smarty(bc)?)$)/',
$_class, $match)) {
if (!empty($match[3])) {
@include $file;
return;
} elseif (!empty($match[9]) && isset(self::$rootClasses[$_class])) {
$file = self::$rootClasses[$_class];
require $file;
return;
}
}
if (0 !== strpos($_class, 'smarty')) {
if (strpos($_class, 'smarty') !== 0) {
return;
}
$file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php';
if (is_file($file)) {
require $file;
return;
include $file;
} else if (isset(self::$rootClasses[ $_class ])) {
$file = self::$SMARTY_DIR . self::$rootClasses[ $_class ];
if (is_file($file)) {
include $file;
}
}
return;
}
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -5,7 +5,7 @@ This does resolve all known existing restrictions (see below).
The $smarty::$inheritance_merge_compiled_includes property has been removed.
Any access to it is ignored.
This does enable some new features:
New features:
Any code outside root {block} tags in child templates is now executed but any output will be ignored.
......@@ -31,7 +31,16 @@ Any code outside root {block} tags in child templates is now executed but any ou
{/if}
{/block}
{block} tags can have variable names.
{block $foo}
....
{/block}
Starting with 3.1.28 you can mix inheritance by extends resuorce with the {extends} tag.
A template called by extends resoure can extend a subtemple or chain buy the {extends} tag.
NOTE There is a BC break. If you used the extends resource {extends} tags have been ignored.
THE FOLLOWING RESTRICTIONS ARE NO LONGER EXISTING:
In Smarty 3.1 template inheritance is a compile time process. All the extending of {block} tags
......
......@@ -2,6 +2,108 @@
This file contains a brief description of new features which have been added to Smarty 3.1
Smarty 3.1.30
Loop optimization {foreach} and {section}
=========================================
Smarty does optimize the {foreach} and {section} loops by removing code for not needed loop
properties.
The compiler collects needed properties by scanning the current template for $item@property,
$smarty.foreach.name.property and $smarty.section.name.property.
The compiler does not know if additional properties will be needed outside the current template scope.
Additional properties can be generated by adding them with the property attribute.
Example:
index.tpl
{foreach $from as $item properties=[iteration, index]}
{include 'sub.tpl'}
{$item.total}
{/foreach}
sub.tpl
{$item.index} {$item.iteration} {$item.total}
In above example code for the 'total' property is automatically generated as $item.total is used in
index.tpl. Code for 'iteration' and 'index' must be added with properties=[iteration, index].
New tag {make_nocache}
======================
Syntax: {make_nocache $foo}
This tag makes a variable which does exists normally only while rendering the compiled template
available in the cached template for use in not cached expressions.
Expample:
{foreach from=$list item=item}
<li>{$item.name} {make_nocache $item}{if $current==$item.id} ACTIVE{/if}</li>
{/foreach}
The {foreach} loop is rendered while processing the compiled template, but $current is a nocache
variable. Normally the {if $current==$item.id} would fail as the $item variable is unkown in the
cached template. {make_nocache $item} does make the current $item value known in thee cached template.
{make_nocache} is ignored when caching is disabled or the variable does exists as nocache variable.
NOTE: if the variable value does contain objects these must have the __set_state method implemented.
Scope Attributes
================
The scope handling has been updated to cover all cases of variable assignments in templates.
The tags {assign}, {append} direct assignments like {$foo = ...}, {$foo[...]= ...} support
the following optional scope attributes:
scope='parent' - the variable will be assigned in the current template and if the template
was included by {include} the calling template
scope='tpl_root' - the variable will be assigned in the outermost root template called by $smarty->display()
or $smarty->fetch() and is bubbled up all {include} sub-templates to the current template.
scope='smarty' - the variable will be assigned in the Smarty object and is bubbled up all {include} sub-templates
to the current template.
scope='global' - the variable will be assigned as Smarty object global variable and is bubbled up all {include}
sub-templates to the current template.
scope='root' - the variable will be assigned if a data object was used for variable definitions in the data
object or in the Smarty object otherwise and is bubbled up all {include} sub-templates to the
current template.
scope='local' - this scope has only a meaning if the tag is called within a template {function}.
The variable will be assigned in the local scope of the template function and the
template which did call the template function.
The {config_load} tag supports all of the above except the global scope.
The scope attribute can be used also with the {include} tag.
Supported scope are parent, tpl_root, smarty, global and root.
A scope used together with the {include} tag will cause that with some exceptions any variable
assignment within that sub-template will update/assign the variable in other scopes according
to the above rules. It does include also variables assigned by plugins, tags supporting the assign=foo
attribute and direct assignments in {if} and {while} like {if $foo=$bar}.
Excluded are the key and value variables of {foreach}, {for} loop variables , variables passed by attributes
in {include} and direct increments/decrements like {$foo++}, {$foo--}
Note: The scopes should be used only to the extend really need. If a variable value assigned in an included
sub-template should be returned to the calling sub-template just use {$foo='bar' scope='parent'}.
Use scopes only with variables for which it's realy needed. Avoid general scope settings with the
{include} tag as it can have a performance impact.
The {assign}, {append}, {config_load} and {$foo...=...} tags have a new option flag 'noscope'.Thi
Example: {$foo='bar' noscope} This will assign $foo only in the current template and any scope settings
at {include} is ignored.
Caching
=======
Caching does now observe the template_dir setting and will create separate cache files if required
Compiled Templates
==================
The template_dir setting is now encoded in the uid of the file name.
The content of the compiled template may depend on the template_dir search order
{include .... inline} is used or $smarty->merge_compiled_includes is enabled
APC
===
If APC is enabled force an apc_compile_file() when compiled or cached template was updated
Smarty 3.1.28
OPCACHE
......@@ -32,7 +134,7 @@ Smarty 3.1.28
The template_dir array is searched in the order of the indices. (Could be used to change the default search order)
Example:
$smarty->display('[1],[0]foo.bar');
Filter support
==============
Optional filter names
......@@ -47,7 +149,7 @@ Smarty 3.1.28
If you register multiple closures register each with a unique filter name.
- $smarty->registerFilter('pre', function($source) {return $source;}, 'closure_1');
- $smarty->registerFilter('pre', function($source) {return $source;}, 'closure_2');
Smarty 3.1.22
......@@ -120,7 +222,7 @@ Smarty 3.1.22
Debugging
=========
The layout of the debug window has been changed for better readability