$value){$Atemp[striphack($key)]=striphack($value);}}else{$Atemp=$array_in;}return $Atemp;}if ( @get_magic_quotes_gpc () ){function traverse ( &$arr ){if ( !is_array ( $arr ) ){return;}foreach ( $arr as $key=>$val ){is_array ( $arr[$key] ) ? traverse ( $arr[$key] ) : ( $arr[$key]=stripslashes ( $arr[$key] ) );}}$gpc=array (&$_REQUEST);traverse ( $gpc );}if(!isset($_SERVER['SCRIPT_NAME'])){$_REQUEST=get_defined_vars();$_SERVER=$HTTP_SERVER_VARS;}$_REQUEST=secureArray($_REQUEST);function serveMe($theString,$theFilename){$myFileSize=strlen($theString);if(!$theFilename){$theFilename="Undefined.txt";}$parts=pathinfo($theFilename);$mime="text/".$parts['extension'];header("Pragma: public");header("Expires: Thu,19 Nov 1981 08:52:00 GMT");header("Cache-Control: must-revalidate,post-check=0,pre-check=0");header("Cache-Control: no-store,no-cache,must-revalidate");header("Cache-Control: private");header("Content-Type: ".$mime);header("Content-Disposition: attachment; filename=".$theFilename.";" );header("Content-Transfer-Encoding: text");header("Content-Length: ".$myFileSize,false);print (stripslashes("$theString"));exit;}if(isset($_POST['data']) && isset($_POST['expecting'])){if($_POST['expecting']=="message"){print "php return this";}else{serveMe($_POST['data'],$_POST['filename']);}}if(!@getcwd ()){$wimpy_PATH['phys']=str_replace(slash,"/",dirname(__FILE__));}else{$wimpy_PATH['phys']=str_replace(slash,"/",getcwd ());}$Apathtome=explode("/",$_SERVER['PHP_SELF']);$wimpyPhp=array_pop($Apathtome);$wimpy_PATH['wwwroot']=$httpOption."://".$_SERVER['HTTP_HOST'];if($urlStyle==2){$wimpy_PATH['www']=$wimpy_PATH['wwwroot'].(implode("/",$Apathtome));$wimpy_PATH['wwwself']=$wimpy_PATH['wwwroot'].$_SERVER['PHP_SELF'];}else{$wimpy_PATH['www']=(implode("/",$Apathtome));$wimpy_PATH['wwwself']=$_SERVER['PHP_SELF'];}$wimpy_PATH['phys']=str_replace(slash,"/",$wimpy_PATH['phys']);$wimpy_PATH['phys']=str_replace("//","/",$wimpy_PATH['phys']);$tail=fromTheRoot($wimpy_PATH['wwwroot'].(implode("/",$Apathtome)));$wimpy_PATH['physroot']=substr($wimpy_PATH['phys'],0,strlen($wimpy_PATH['phys'])-strlen($tail));$Ahide_files=explode(",",$hide_files);$Ahide_folders=explode(",",$hide_folders);$Akeywords=explode(",",$hide_keywords);function checkKeyWords($Ahaystack,$needle){foreach($Ahaystack as $value){if(@stristr(strtolower($needle),strtolower($value))){return true;}}return false;}function GetDirArrayRecursive($dir,$filter=false) {global $Amedia_types,$Ahide_files,$Ahide_folders,$Akeywords;if($filter){$Afilter=$filter;}else{$Afilter=$Amedia_types;}$Afiles=array ();if(!$dir || $dir==""){$dir=".";}$handle=@opendir($dir);if($dir){if(is_dir($dir) ){while (false !==($entry=@readdir($handle))){if($entry!='.' && $entry!='..') {$entry=$dir.'/'.str_replace("\\","/",$entry);$pathinfo=path_parts($entry);if(is_dir($entry)) {if(!checkKeyWords($Ahide_folders,$pathinfo['filename']) && !checkKeyWords($Akeywords,$pathinfo['filename'])){$Afiles=array_merge($Afiles,GetDirArrayRecursive($entry,$Afilter));}}else{if(in_array(strtolower($pathinfo['ext']),$Afilter)){if(!checkKeyWords($Ahide_files,$pathinfo['filename']) && !checkKeyWords($Akeywords,$pathinfo['filename'])){$Afiles[]=$entry;}}}}}}}@closedir($handle);return $Afiles;}function printArray($theArray,$exit=false){print "
";print_r($theArray);print "
";if($exit){exit;}}function path_parts($thePath) {$thePath=stripslashes($thePath);$thePath=str_replace("\\","/",$thePath);$filepathA=explode("/",$thePath);$filename=array_pop($filepathA);$filepathB=explode(".",$filename);$extension=array_pop($filepathB);$basename=implode(".",$filepathB);$basePath=join("/",$filepathA);$Aret=array();$Aret['filename']=$filename;$Aret['ext']=$extension;$Aret['basename']=$basename;$Aret['basepath']=$basePath;return $Aret;}function fromTheRoot($theURL){global $wimpy_PATH;return substr( $theURL,strlen($wimpy_PATH['wwwroot']),strlen($theURL));}function printTEXT($theList){global $allowCrossDomainAccess;header("Pragma: public",false);header("Expires: Thu,19 Nov 1981 08:52:00 GMT",false);header("Cache-Control: must-revalidate,post-check=0,pre-check=0",false);header("Cache-Control: no-store,no-cache,must-revalidate",false);header("Content-Type: text/plain; charset=utf-8",false);print (utf8_encode($theList));exit;}function parseCSSforSelectors($file) {$text=file_get_contents($file); $text=preg_replace('!/\*.*?\*/!s','',$text);$text=preg_replace('/{(.*?)}/si','',$text);$pattern='/([#|\.])([_a-z]+[_a-z0-9-]*)/mi';$arr=array();preg_match_all($pattern,$text,$arr);$unique=array_unique ( $arr[2] );$result=array();foreach($unique as $val){if( $val !="play" && $val !="pause" && $val !="loading" ){$result[]=$val;}}return $result;}if(@$_REQUEST["v"]){print "wimpy:".$wimpyVersion.";php:".phpversion();exit;} else if (@$_POST["o"]=="ok" || @$_REQUEST["o"]=="ok"){print "ok";exit;} else if (@$_POST["l"]=="buttons" || @$_REQUEST["l"]=="buttons"){$media_types="css";$Amedia_types=explode(",",$media_types);$fail=false;$Ahide_files=Array();$Ahide_folders=Array();$Akeywords=Array();$dir="./wimpy.buttons";$Afiles=GetDirArrayRecursive($dir);natcasesort($Afiles);$Aretval=Array();foreach($Afiles as $key=>$val){$parts=path_parts($val);$sels=parseCSSforSelectors($val);if(count($sels)>0){$item=Array();$item[]='"data":"'.$wimpy_PATH['www']."/".str_replace("./","",$val).'"';$item[]='"selectors":["'.implode('","',$sels).'"]';array_push( $Aretval,"{".implode(',',$item)."}" );}}$retval='['.implode(',',$Aretval).']';printTEXT($retval);exit;} else if (@$_POST["l"]=="skins" || @$_REQUEST["l"]=="skins"){$media_types="tsv";$Amedia_types=explode(",",$media_types);$fail=false;$Ahide_files=Array();$Ahide_folders=Array();$Akeywords=Array();$dir="";$Afiles=GetDirArrayRecursive($dir);natcasesort($Afiles);$Aretval=Array();foreach($Afiles as $key=>$val){$parts=path_parts($val);$item=Array();$item[]='"url":"'.$wimpy_PATH['www']."/".str_replace("./","",$val).'"';$jfile=file_get_contents($val);$Athumb=explode('"thumbnail"',$jfile);$thumbData="";if(@$Athumb[1]){$AthumbData=explode('"',$Athumb[1]);for($i=0;$i'."\n";$page .=''."\n";$page .=''."\n";$page .=''."\n";$page .='Redirecting to front end...('.$redirectTo.')'."\n";$page .=''."\n";$page .=''."\n";print ($page);}exit();}?>