Просмотр файла zagrcent/jad.php

Размер файла: 1.27Kb
  1. <?php
  2. include('func.php');
  3. include('db.php');
  4. include('nast.php');
  5. $time=time();
  6. if (!strstr($file, '..') and file_exists($file) and r($file)=='jar')
  7. {header("Content-type: text/vnd.sun.j2me.app-descriptor");
  8. $file=mysql_escape_string($file);
  9. $dirname=dirname($file);
  10. $basename=basename($file);
  11. while($file[0]=='/')
  12. $sd=substr($file,1,strlen($file));
  13. $result=mysql_query("SELECT * from `file` WHERE `sd`='$dirname' and `file`='$basename'");
  14. if(
  15. (in_array(r($file), $progf) or in_array(r($file), $filef) or in_array(r($file), $imagef)) and !in_array(r($file,1), $progf) and !strstr($dirname,"..") and file_exists($file))
  16. {
  17. if(!mysql_num_rows($result))
  18. {
  19. mysql_query("INSERT into `file` VALUES(0,'$dirname','$basename','1','0','0','".time()."')");
  20. }
  21. else
  22. {
  23. $fileinfo=mysql_fetch_array($result);
  24. mysql_query("UPDATE `file` SET `rat`=`rat`+1,`ldate`='$time' WHERE `id`='$fileinfo[id]'") or die(mysql_error());
  25. }
  26. $filesize=filesize($file);
  27. include('pclzip.lib.php');
  28. $open='META-INF/MANIFEST.MF';
  29. $dir=dirname($file);
  30. $arch=basename($file);
  31.  
  32. $zip=new PclZip("$dir/$arch");
  33. $content = $zip->extract(PCLZIP_OPT_BY_NAME,$open,PCLZIP_OPT_EXTRACT_AS_STRING);
  34. $content = $content[0]['content'];
  35. print $content."\nMIDlet-Jar-Size: $filesize\nMIDlet-Jar-URL: $file";
  36. }}
  37. ?>