Advertisement
jargon

one less glitch

Apr 25th, 2017
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.18 KB | None | 0 0
  1. $buf.='[/tbl]';
  2.  
  3. $iobuffer.=nenscript_pcre_from_source('[<]'.$buf.'[>]');
  4. $buf='';
  5. $resources=zoey_rip_resources($iobuffer);
  6.  
  7. $restable='';
  8. if(is_array($resources))
  9.     if(count($resources)>0)
  10.     {
  11.         $restable.'[tbl]';
  12.         foreach($resources as $key => $value)
  13.             $restable.'[row][col][<]##'.strval($key).'[>][/col][col style="text-align: left;"][<][tt][url="'.$value.'"]'.htmlentities($value).'[/url][/tt][>][/col][/row]';
  14.         $restable.'[/tbl]';
  15.     }
  16. $iobuffer.=nenscript_pcre_from_source('[<]'.$restable.'[>]');
  17.    
  18. $iobuffer.='<script language="JavaScript">document.title=\''.addslashes(preg_replace('/\r\n/','',$nenini['title'])).'\';</script>';
  19.  
  20. $iobuffer.='</body>';
  21. $iobuffer.='</html>';
  22.  
  23. echo $iobuffer;
  24.  
  25. function zoey_rip_resources($subject=NULL)
  26. {
  27.     switch(gettype($subject))
  28.     {
  29.         case 'NULL':
  30.             break;
  31.         case 'string':
  32.             break;
  33.         case 'integer':
  34.         case 'float':
  35.         case 'boolean':
  36.             $subject=strval($subject);
  37.             break;
  38.         default:
  39.             $subject=NULL;
  40.     }
  41.  
  42.     if(!is_string($subject))
  43.         $ret=NULL;
  44.     else
  45.     {
  46.         $ret=array();
  47.         for($test=NULL;$test!==false;)
  48.         {
  49.             echo '<h1>test="<tt>'.strval($test).'</tt>"</h1>';
  50.             $test=false;
  51.             $pattern='(.*) href="([^"]*)"(.*)';
  52.             if(preg_match('/'.$pattern.'/',$subject,$matches))
  53.             {
  54.                 echo '<h1><tt>href="<tt>'.htmlentities($matches[2]).'</tt>"</h1>';
  55.                 echo '<h1><tt>0="<tt>'.htmlentities(strlen($matches[0])).'</tt>"</h1>';
  56.                 echo '<h1><tt>s="<tt>'.htmlentities(strlen($subject)).'</tt>"</h1>';
  57.                 if($matches[0]===$subject)
  58.                 {
  59.                     echo '<h1><tt>href="<tt>'.htmlentities($matches[2]).'</tt>"</h1>';
  60.                     $test=true;
  61.                     $ret[count($ret)]=$matches[2];
  62.                     $subject=preg_replace('/'.$pattern.'/','$1$3',$subject);
  63.                 }
  64.             }
  65.             $pattern='(.*) src="([^"]*)"(.*)';
  66.             if(preg_match('/'.$pattern.'/',$subject,$matches))
  67.             {
  68.                 echo '<h1><tt>src="<tt>'.htmlentities($matches[2]).'</tt>"</h1>';
  69.                 if($matches[0]===$subject)
  70.                 {
  71.                     echo '<h1><tt>src="<tt>'.htmlentities($matches[2]).'</tt>"</h1>';
  72.                     $test=true;
  73.                     $ret[count($ret)]=$matches[2];
  74.                     $subject=preg_replace('/'.$pattern.'/','$1$3',$subject);
  75.                 }
  76.             }
  77.         }
  78.     }
  79.     echo '<h1>test="<tt>'.strval($test).'</tt>"</h1>';
  80.     return $ret;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement