Use of deprecated function db_fetch_object().

views_datasource/views/theme/views_views_rdf_style.theme.inc

LINE 435 -- Deprecated function
.
.
$roles = array();
$roles_query = db_query("SELECT r.name AS name, r.rid AS rid FROM {users_roles} ur, {role} r WHERE ur.uid = %d AND ur.rid = r.rid", $user["uid"]);
while ($role = db_fetch_object($roles_query)) {
    $roles[$role->rid] = $role->name;
}
.
.
LINE 468 -- Deprecated function
.
.
  /* Add taxonomy terms as SIOC topics */
  $query = db_query('SELECT tn.tid AS tid, td.name AS name FROM {term_node} tn, {term_data} td WHERE td.tid = tn.tid AND tn.nid = %d', $nid);
  while ($term = db_fetch_object($query)) { 
    $taxonomy_terms = "  <sioc:topic rdfs:label=\"$term->name\" rdf:resource=\"" . url("taxonomy/term/$term->tid", array('absolute' => TRUE)) . "\" />\n";
  }
.
.
LINE 482 -- Deprecated function
.
.
  $result = db_query($query, $query_args);
  while ($comment = db_fetch_object($result)) {
    $comment = drupal_unpack($comment);
  }

views_datasource/views/theme/views-views-rdf-style-sioc.tpl.php (line:64)


    $roles = array();
    $roles_query = db_query("SELECT r.name AS name, r.rid AS rid FROM {users_roles} ur, {role} r WHERE ur.uid = %d AND ur.rid = r.rid", $uid);
    while ($role = db_fetch_object($roles_query)) {
        $roles[$role->rid] = $role->name;
    }

CommentFileSizeAuthor
#5 views_datasource-3175746-5.patch3.21 KBsachint1996

Comments

SachinT1996 created an issue. See original summary.

chaseontheweb’s picture

Can you elaborate how it's a security issue? Function db_fetch_object was removed from Drupal 7.x, and so the SIOC formatter of views_rdf.module is probably broken, but that's a runtime error.

sachint1996’s picture

Issue summary: View changes
sachint1996’s picture

Title: Security scan report » Deprecated function db_fetch_object.
Issue summary: View changes

Updated the issue to use of deprecated function db_fetch_object(). Apologies for the confusion.

sachint1996’s picture

StatusFileSize
new3.21 KB
sachint1996’s picture

Status: Active » Needs review
Issue tags: +Deprecation Removal
shashwat purav’s picture

The patch in #5 applied successfully to 7.x-1.x branch.