Posted on: 10/13/02 05:45am
By: Anonymous (jim)
/**
* Makes an ID based on current date/time
*
* This function COM_creates a 17 digit sid for stories based on the 14 digit date
* and a 3 digit random number that was seeded with the number of microseconds
* (.000001th of a second) since the last full second. NOTE: this is now used for more than
* just stories!
*
* 10/13/2002 4:19AM jim AT jimweller.net added handling for mulitple meta-tags
*
* @return string $sid Story ID
*
*/
function COM_checkHTML( $str )
{
global $_CONF;
$str = stripslashes($str);
// Get rid of any newline characters
$str = preg_replace( "/\n/", '', $str );
// Replace any $ with $ (HTML equiv)
$str = str_replace( '$', '$', $str );
// loop through consecutive meta tags
$start_pos = strpos( strtolower( $str ), '' );
$end_pos = 0;
while ( ! ( $start_pos === false ) )
{
$end_pos = strpos( strtolower( $str ), '
', $end_pos );
$end_pos += 7; // to account for the length of the tag
$orig_pre_string = substr( $str, $start_pos, $end_pos - $start_pos );
$new_pre_string = str_replace( '', '', $orig_pre_string );
$new_pre_string = str_replace( '', '>', $new_pre_string );
$new_pre_string = str_replace( '', '', $new_pre_string );
$new_pre_string = str_replace( '', '', $new_pre_string );
$new_pre_string = str_replace( '</code></pre>', '', $new_pre_string );
$new_pre_string = str_replace( '
', '', $new_pre_string );
$new_pre_string = nl2br( $new_pre_string );
$str = str_replace( $orig_pre_string, '' . $new_pre_string . '
', $str );
$start_pos = strpos( strtolower( $str ), '', $end_pos );
} // ends while loop
if( !SEC_hasRights( 'story.edit' ) || empty ( $_CONF['adminhtml'] ))
{
$str = strip_tags( $str, $_CONF['allowablehtml'] );
}
else
{
$str = strip_tags( $str, $_CONF['adminhtml'] );
}
return COM_killJS( $str );
}
Posted on: 10/13/02 11:56am
By: Dirk
... or you could have taken my fix from CVS[*4] ;-)
bye, Dirk
Posted on: 10/13/02 03:06pm
By: Anonymous (jim)
Posted on: 10/13/02 03:09pm
By: Anonymous (jim)