Skip to content

Commit

Permalink
Don't pass null to the mysql error functions. Even though the PHP doc…
Browse files Browse the repository at this point in the history
…umentation states a null value can be passed, a warning message is given it is passed.
  • Loading branch information
haraldpdl committed Sep 25, 2013
1 parent a0be78b commit 06fc87e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
16 changes: 16 additions & 0 deletions catalog/admin/includes/functions/database.php
Expand Up @@ -190,10 +190,18 @@ function mysqli_connect($server, $username, $password, $database) {
}

function mysqli_connect_errno($link = null) {
if ( is_null($link) ) {
return mysql_errno();
}

return mysql_errno($link);
}

function mysqli_connect_error($link = null) {
if ( is_null($link) ) {
return mysql_error();
}

return mysql_error($link);
}

Expand All @@ -212,10 +220,18 @@ function mysqli_query($link, $query) {
}

function mysqli_errno($link = null) {
if ( is_null($link) ) {
return mysql_errno();
}

return mysql_errno($link);
}

function mysqli_error($link = null) {
if ( is_null($link) ) {
return mysql_error();
}

return mysql_error($link);
}

Expand Down
16 changes: 16 additions & 0 deletions catalog/includes/functions/database.php
Expand Up @@ -176,10 +176,18 @@ function mysqli_connect($server, $username, $password, $database) {
}

function mysqli_connect_errno($link = null) {
if ( is_null($link) ) {
return mysql_errno();
}

return mysql_errno($link);
}

function mysqli_connect_error($link = null) {
if ( is_null($link) ) {
return mysql_error();
}

return mysql_error($link);
}

Expand All @@ -198,10 +206,18 @@ function mysqli_query($link, $query) {
}

function mysqli_errno($link = null) {
if ( is_null($link) ) {
return mysql_errno();
}

return mysql_errno($link);
}

function mysqli_error($link = null) {
if ( is_null($link) ) {
return mysql_error();
}

return mysql_error($link);
}

Expand Down
12 changes: 12 additions & 0 deletions catalog/install/includes/functions/database.php
Expand Up @@ -133,10 +133,18 @@ function osc_db_install($database, $sql_file) {

if ( !function_exists('mysqli_connect') ) {
function mysqli_connect_errno($link = null) {
if ( is_null($link) ) {
return mysql_errno();
}

return mysql_errno($link);
}

function mysqli_connect_error($link = null) {
if ( is_null($link) ) {
return mysql_error();
}

return mysql_error($link);
}

Expand Down Expand Up @@ -165,6 +173,10 @@ function mysqli_query($link, $query) {
}

function mysqli_error($link = null) {
if ( is_null($link) ) {
return mysql_error();
}

return mysql_error($link);
}

Expand Down

0 comments on commit 06fc87e

Please sign in to comment.