Changeset 1836 for trunk


Ignore:
Timestamp:
09/01/2010 11:43:44 PM (17 months ago)
Author:
Gongwei.Yu
Message:

[omcollab]fixed sql injection issue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/w/extensions/DataDrivenLinks/DataDrivenLinks.php

    r1820 r1836  
    6666        $page = $this->dbr->tableName( 'page' ); 
    6767        // Get all possible articles and categories 
    68         $res = $this->dbr->query("SELECT * FROM $om_categorylinks WHERE cl_to in (SELECT cl_to FROM $om_categorylinks WHERE cl_sortkey = '" . $this->articleOBJ->mTextform . "') AND cl_sortkey <> '" . $this->articleOBJ->mTextform . "' ORDER BY cl_sortkey"); 
     68        $res = $this->dbr->query("SELECT * FROM $om_categorylinks WHERE cl_to in (SELECT cl_to FROM $om_categorylinks WHERE cl_sortkey = '" . mysql_real_escape_string($this->articleOBJ->mTextform) . "') AND cl_sortkey <> '" . mysql_real_escape_string($this->articleOBJ->mTextform) . "' ORDER BY cl_sortkey"); 
    6969        //echo "SELECT * FROM $om_categorylinks WHERE cl_to in (SELECT cl_to FROM $om_categorylinks WHERE cl_sortkey = '" . $this->articleOBJ->mTextform . "') AND cl_sortkey > '" . $this->articleOBJ->mTextform . "' ORDER BY cl_sortkey"; 
    7070        while( $row = $this->dbr->fetchObject( $res ) ) { // Filter to extract only articles 
    71             $temp = str_replace(" ", "_", strtolower($row->cl_sortkey)); // temp string to make the string to page_title style 
     71            $temp = mysql_real_escape_string(str_replace(" ", "_", strtolower($row->cl_sortkey))); // temp string to make the string to page_title style 
    7272             
    7373            // Get data from page table by using $temp to know if it is a category or article 
Note: See TracChangeset for help on using the changeset viewer.