cvs: pear /MDB2_Schema/MDB2/Schema Validate.php
| From: | Igor Feghali | Date: | Sat, 19 Aug 2006 13:35:03 +0000 |
| Subject: | cvs: pear /MDB2_Schema/MDB2/Schema Validate.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-41721@lists.php.net to get a copy of this message | ||
ifeghali Sat Aug 19 13:35:03 2006 UTC
Modified files:
/pear/MDB2_Schema/MDB2/Schema Validate.php
Log:
- checking if fail_on_invalid_names is an array before walking on it
http://cvs.php.net/viewvc.cgi/pear/MDB2_Schema/MDB2/Schema/Validate.php?r1=1.9&r2=1.10&diff_format=u
Index: pear/MDB2_Schema/MDB2/Schema/Validate.php
diff -u pear/MDB2_Schema/MDB2/Schema/Validate.php:1.9 pear/MDB2_Schema/MDB2/Schema/Validate.php:1.10
--- pear/MDB2_Schema/MDB2/Schema/Validate.php:1.9 Sat Aug 19 12:33:35 2006
+++ pear/MDB2_Schema/MDB2/Schema/Validate.php Sat Aug 19 13:35:03 2006
@@ -43,7 +43,7 @@
// | Author: Igor Feghali <ifeghali@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Validate.php,v 1.9 2006/08/19 12:33:35 lsmith Exp $
+// $Id: Validate.php,v 1.10 2006/08/19 13:35:03 ifeghali Exp $
//
/**
@@ -119,7 +119,7 @@
if (!$table_name) {
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE_NO_TABLE_NAME,
'a table has to have a name');
- } elseif ($this->fail_on_invalid_names) {
+ } elseif (is_array($this->fail_on_invalid_names) &&
!empty($this->fail_on_invalid_names)) {
$name = strtoupper($table_name);
foreach ($this->fail_on_invalid_names as $rdbms) {
if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) {
@@ -216,7 +216,7 @@
'field "'.$field_name.'" already exists');
}
- if ($this->fail_on_invalid_names) {
+ if (is_array($this->fail_on_invalid_names) &&
!empty($this->fail_on_invalid_names))
$name = strtoupper($field_name);
foreach ($this->fail_on_invalid_names as $rdbms) {
if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) {
@@ -340,7 +340,7 @@
if (!$sequence_name) {
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE_NO_SEQUENCE_NAME,
'a sequence has to have a name');
- } elseif ($this->fail_on_invalid_names) {
+ } elseif (is_array($this->fail_on_invalid_names) &&
!empty($this->fail_on_invalid_names))
$name = strtoupper($sequence_name);
foreach ($this->fail_on_invalid_names as $rdbms) {
if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) {
@@ -374,7 +374,7 @@
if (!isset($database['name']) || !$database['name']) {
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE_NO_DATABASE_NAME,
'a database has to have a name');
- } elseif ($this->fail_on_invalid_names) {
+ } elseif (is_array($this->fail_on_invalid_names) &&
!empty($this->fail_on_invalid_names))
$name = strtoupper($database['name']);
foreach ($this->fail_on_invalid_names as $rdbms) {
if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) {