Permalink
Browse files

MDL-12158 Applied Matt's patch

  • Loading branch information...
nicolasconnault
nicolasconnault committed Feb 5, 2008
1 parent 0b2f6d1 commit a22772f8e31b7b22ac8c9b80af8023260b1f3338
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/datalib.php
View
@@ -511,7 +511,7 @@ function count_records_select($table, $select='', $countitem='COUNT(*)') {
function count_records_sql($sql) {
$rs = get_recordset_sql($sql);
- if ($rs) {
+ if (is_object($rs) and is_array($rs->fields)) {
return $rs->fields[0];
} else {
return 0;
@@ -3178,4 +3178,4 @@ function category_parent_visible($parent = 0) {
}
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
-?>
+?>

0 comments on commit a22772f

Please sign in to comment.