From: <txm...@us...> - 2012-04-12 17:26:44
|
Revision: 9307 http://xoops.svn.sourceforge.net/xoops/?rev=9307&view=rev Author: txmodxoops Date: 2012-04-12 17:26:38 +0000 (Thu, 12 Apr 2012) Log Message: ----------- Update function Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/include/functions.php Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/include/functions.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/include/functions.php 2012-04-12 15:16:44 UTC (rev 9306) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/include/functions.php 2012-04-12 17:26:38 UTC (rev 9307) @@ -21,7 +21,22 @@ die('XOOPS root path not defined'); } -function clearDir($folder) { +function TDMCreate_CleanVars( &$global, $key, $default = '', $type = 'int' ) { + switch ( $type ) { + case 'string': + $ret = ( isset( $global[$key] ) ) ? filter_var( $global[$key], FILTER_SANITIZE_MAGIC_QUOTES ) : $default; + break; + case 'int': default: + $ret = ( isset( $global[$key] ) ) ? filter_var( $global[$key], FILTER_SANITIZE_NUMBER_INT ) : $default; + break; + } + if ( $ret === false ) { + return $default; + } + return $ret; +} + +function TDMCreate_clearDir($folder) { $opening=@opendir($folder); if (!$opening) return; while($file=readdir($opening)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |