Для версий IPB 2.1.xsources\ipsclass.php, код:
CODE
$this->forum_read[$id] = $stamp;
заменить на:
CODE
$this->forum_read[ intval($id) ] = intval($stamp);
и еще код:
CODE
/*--------*/
// Makes incoming info "safe"
/*--------*/
заменить на:
CODE
/*--------*/
// Makes topics read or forum read cookie safe
/*--------*/
/**
* Makes int based arrays safe
* XSS Fix: Ticket: 243603
* Problem with cookies allowing SQL code in keys
*
* @param array Array
* @return array Array (Cleaned)
* @since 2.1.4(A)
*/
function clean_int_array( $array=array() )
{
$return = array();
if ( is_array( $array ) and count( $array ) )
{
foreach( $array as $k => $v )
{
$return[ intval($k) ] = intval($v);
}
}
return $return;
}
/*--------*/
// Makes incoming info "safe"
/*--------*/
sources\action_public\forums.php, код:
CODE
$this->read_array = unserialize(stripslashes($read));
заменить на:
CODE
$this->read_array = $this->ipsclass->clean_int_array( unserialize(stripslashes($read)) );
sources\action_public\search.php, код:
CODE
$this->read_array = unserialize(stripslashes($read));
заменить на:
CODE
$this->read_array = $this->ipsclass->clean_int_array( unserialize(stripslashes($read)) );
sources\action_public\topics.php, код:
CODE
$this->read_array = unserialize(stripslashes($read));
заменить на:
CODE
$this->read_array = $this->ipsclass->clean_int_array( unserialize(stripslashes($read)) );
sources\action_public\usercp.php, найти код:
CODE
$topic_array = array_slice( array_keys( $topics ), 0, 5 );
после него добавить следующую строку:
CODE
$topic_array = $this->ipsclass->clean_int_array( $topic_array );
Для версий IPB 2.0.x:Файл sources\functions.php, найти код:
CODE
$ibforums->forum_read[$id] = $stamp;
заменить на:
CODE
$ibforums->forum_read[ intval($id) ] = intval($stamp);
а также найти код:
CODE
/*--------*/
// Makes incoming info "safe"
/*--------*/
заменить на:
CODE
/*--------*/
// Makes topics read or forum read cookie safe
/*--------*/
/**
* Makes int based arrays safe
* XSS Fix: Ticket: 243603
* Problem with cookies allowing SQL code in keys
*
* @param array Array
* @return array Array (Cleaned)
* @since 2.1.4(A)
*/
function clean_int_array( $array=array() )
{
$return = array();
if( !is_array($array) OR count($array) < 1 )
{
return $return;
}
foreach( $array as $k => $v )
{
$return[ intval($k) ] = intval($v);
}
return $return;
}
/*--------*/
// Makes incoming info "safe"
/*--------*/
Файл sources\forums.php, найти код:
CODE
$this->read_array = unserialize(stripslashes($read));
заменить на:
CODE
$this->read_array = $std->clean_int_array( unserialize(stripslashes($read)) );
Файл sources\search.php, найти код:
CODE
$this->read_array = unserialize(stripslashes($read));
заменить на:
CODE
$this->read_array = $std->clean_int_array( unserialize(stripslashes($read)) );
Файл sources\topics.php, найти код:
CODE
$this->read_array = unserialize(stripslashes($read));
заменить на:
CODE
$this->read_array = $std->clean_int_array( unserialize(stripslashes($read)) );
Файл sources\usercp.php, найти код:
CODE
$topic_array = array_slice( array_keys( $topics ), 0, 5 );
добавить ниже:
CODE
$topic_array = $std->clean_int_array( $topic_array );