Commit 797f8bd0 authored by metzlerd's avatar metzlerd
Browse files

Fixed differentiation between 0 and NULL

parent 92104746
......@@ -61,7 +61,7 @@ class FrxDrupal extends FrxDataSource {
public function format($value, $key, $data) {
$db = Database::getConnection('default');
if ($db) {
if ($value=='')
if ($value==='' || $value===NULL)
$value = 'NULL';
else {
if (is_array($value)) {
......
......@@ -138,7 +138,7 @@ class FrxMSSQL extends FrxDataSource {
* @param unknown_type $data
*/
public function format($value, $key, $data) {
if ($value=='') $value = 'NULL'; else $value = "'" . str_replace("'", "''", $value) . "'";
if ($value===''||$value===NULL) $value = 'NULL'; else $value = "'" . str_replace("'", "''", $value) . "'";
return $value;
}
......
......@@ -273,7 +273,7 @@ class FrxOracle extends FrxDataSource {
* @param unknown_type $data
*/
public function format($value, $key, $data) {
if ($value=='' || $value ==array())
if ($value==='' || $value ===NULL || $value ===array())
$value = 'NULL';
else {
if (is_array($value)) {
......
......@@ -121,7 +121,7 @@ class FrxPDO extends FrxDataSource {
public function format($value, $key, $data) {
$db = $this->db;
if ($db) {
if ($value=='' || $value == array()) {
if ($value==='' || $value ===NULL || $value == array()) {
$value = 'NULL';
}
elseif (is_array($value)) {
......
......@@ -131,7 +131,7 @@ class FrxPostgres extends FrxDataSource {
* @param unknown_type $data
*/
public function format($value, $key, $data) {
if ($value=='')
if ($value===''||$value===NULL)
$value = 'NULL';
else {
if (is_array($value)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment