app.inc.php 990 B

12345678910111213141516171819202122232425
  1. <?php
  2. if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
  3. exit('Access Denied');
  4. }
  5. function is_utf8($word)
  6. {
  7. if (preg_match("/^([".chr(228)."-".chr(233)."]{1}[".chr(128)."-".chr(191)."]{1}[".chr(128)."-".chr(191)."]{1}){1}/",$word) == true || preg_match("/([".chr(228)."-".chr(233)."]{1}[".chr(128)."-".chr(191)."]{1}[".chr(128)."-".chr(191)."]{1}){1}$/",$word) == true || preg_match("/([".chr(228)."-".chr(233)."]{1}[".chr(128)."-".chr(191)."]{1}[".chr(128)."-".chr(191)."]{1}){2,}/",$word) == true)
  8. {
  9. return true;
  10. }
  11. else
  12. {
  13. return false;
  14. }
  15. } // function is_utf8
  16. $str=file_get_contents('http://addon.discuz.com/?@2874.developer');
  17. if($_G['charset']=='utf-8'){
  18. if(!is_utf8($str)){
  19. $str=iconv('gbk','utf-8',$str);
  20. }
  21. }
  22. echo str_replace('resource/template/','http://addon.discuz.com/resource/template/',str_replace('resource/developer/','http://addon.discuz.com/resource/developer/',str_replace('resource/plugin/','http://addon.discuz.com/resource/plugin/',$str)));
  23. ?>