[TYPO3-core] BUG found? RFC: enhance UPDATE/INSERT-API

Peter Niederlag peter at niederlag.de
Fri Jan 27 20:04:45 CET 2006


Hi,

Martin Kutschker schrieb:
> This is a CVS patch request.
> 
> Branch: HEAD or TYPO3_4-0
> 
> Problem: Sometimes you want to insert or update data, but some of the values are not strings/numbers but SQL functions. In such a case you cannot use the t3lib_db functions directly.
> 
> Solution: Add a new parameter that contains a list of keys NOT to quote. The patch affects the following functions:

I don't really know what's going on here but I am afraid something is
still not like intended. Thsi code still seems uptodate.

t3lib-div::refindex() does not like it as you can find out by using
"Tools"/"DB-Check"(lowlevel)/"Manage reference Index"/"Check now:"

t3lib_db throws guts cause 'pages' is not quoted. :-<
--- snipp ----
SELECT hash
FROM sys_refindex
WHERE
tablename NOT IN (pages,'be_users',.....
---- snapp ----

> fullQuoteArray
[...]

$noQuote is not set at all on calltime

> -	function fullQuoteArray($arr, $table)	{
> +	function fullQuoteArray($arr, $table, $noQuote='')	{

$noQuote = ''

> +		if (is_string($noQuote))	{

$noQuote = array (
	0 => '',
)

> +			$noQuote = explode(',',$noQuote);
> +		} elseif (!is_array($noQuote))	{
> +			$noQuote = array();
> +		}

>  		foreach($arr as $k => $v)	{
> +			if (!in_array($v,$noQuote))	{
> +				$arr[$k] = $this->fullQuoteStr($v, $table);

first entry on $arr is *not* quoted. :-<

> +			}
>  		}

In Case it depends on php-version, here we have:

pn at virginia:~/$ php -v
PHP 5.0.5-3 (cli) (built: Oct 20 2005 17:52:24)
(using mod_php of very same version)

HtH,
Peter

(Have not filed a bug-report, neither have a fix and will be off now)
-- 
Peter Niederlag * Neuer Sandberg 9 * 31535 Neustadt *
Fon (privat): 05036 / 924 100 * Fon (Büro): 05036 / 924 101
Fon (mobil): 0172 / 516 48 55 * Fax 05036 / 924 105
callto:typo3support (skype)
http://www.niekom.de * TYPO3 und EDV Dienstleistungen *
http://www.clown-goli.de * Clown-Comedy-Jonglage-Animation *



More information about the TYPO3-team-core mailing list