[TYPO3-core] RFC: some missing is_array checks again
Wolfgang Klinger
wolfgang at stufenlos.net
Thu Jul 13 13:43:06 CEST 2006
*hiya!*
I got some errors while playing around with the extension manager ;-)
so I had to find out what's going on...
Take a look at the attached patches, there's nothing fancy, but it
fixes some warnings.
btw: if you want to know how to make a diff with subversion that
ignores whitespace changes:
-----
svn diff --diff-cmd diff -x -uw /path/to/file
-----
(or take a look at the [helpers] section in your ~/.subversion/config
to set this permanently)
bye
Wolfgang
-------------- next part --------------
Index: t3lib/class.t3lib_install.php
===================================================================
--- t3lib/class.t3lib_install.php (revision 1631)
+++ t3lib/class.t3lib_install.php (working copy)
@@ -293,6 +293,7 @@
function getFieldDefinitions_sqlContent($sqlContent) {
$lines = t3lib_div::trimExplode(chr(10), $sqlContent,1);
$isTable = '';
+ $total = Array();
foreach($lines as $value) {
if ($value[0]!='#') {
@@ -365,6 +366,7 @@
// Init SQL parser:
$sqlParser = t3lib_div::makeInstance('t3lib_sqlparser');
foreach($total as $table => $cfg) {
+ if (is_array($cfg['fields'])) {
foreach($cfg['fields'] as $fN => $fType) {
$orig_fType = $fType;
$fInfo = $sqlParser->parseFieldDef($fType);
@@ -398,6 +400,7 @@
}
}
}
+ }
/**
* Reads the field definitions for the current database
-------------- next part --------------
Index: typo3/sysext/dbal/class.ux_t3lib_db.php
===================================================================
--- typo3/sysext/dbal/class.ux_t3lib_db.php (revision 1631)
+++ typo3/sysext/dbal/class.ux_t3lib_db.php (working copy)
@@ -255,6 +255,7 @@
*/
function analyzeFields($parsedExtSQL) {
foreach($parsedExtSQL as $table => $tdef) {
+ if (is_array($tdef['fields'])) {
foreach($tdef['fields'] as $field => $fdef) {
$fdef = $this->SQLparser->parseFieldDef($fdef);
$this->cache_fieldType[$table][$field]['type'] = $fdef['fieldType'];
@@ -269,6 +270,7 @@
}
}
}
+ }
/**
* This function builds all definitions for mapped tables and fields
More information about the TYPO3-team-core
mailing list