PEAK XOOPS - required fileter congig patch in englishin japanese

required fileter congig patch

List posts in the topic

report required fileter congig patch

msg# 1
depth:
0
Previous post - Next post | Parent - Children.1 | Posted on 2007/3/23 7:18
hoshiyan  二等兵   Posts: 8
Hi,GIJOE!

Whwn required filters config item in admin menu is not specified by user, I have a php warning message
"empty heystack" in file transact_function.php.

This is a patch for suppless the warning.

// forced filters
$filters_forced = array_map( 'trim' , explode( ',' , $mod_config['filters_forced'] ) ) ;
foreach( $filters_forced as $filter_forced ) {
$regs = explode( ':' , $filter_forced ) ;
if( strlen( $filter_forced ) > 0 ) { // hoshiyan(hoshiba-farm.com) 2007/03/23
if( stristr( $filter_forced , ':LAST' ) ) {
$filters[ $regs[0] ] = 0 ;
} else {
$filters = array( $regs[0] => 0 ) + $filters ;
}
}
}

In your pico code, usege of array_map php function is useful for reference. Its excellent!

PHP/5.2.0-8, Apache2

Hoshiyan
Votes:5 Average:8.00

Posts tree

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!