summaryrefslogtreecommitdiffstats
path: root/handlers/phpexec.inc.php
blob: 76dccae16abf85123dd1c02b7a4637164372bad1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?PHP
  require_once('code/message.inc.php');
  require_once('code/links.inc.php');
  
  class phpexec_handler {
    function Get($data) {
      if($data['title'])
        $title = strtr($data['title'], array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;'));
      else
        $title = strtr($data['_page'], array(':' => ' - '));
      
      ob_start();
      
      eval('?>' . $data['code']);
      
      $content = ob_get_contents();
      ob_end_clean();
      
      return array('title' => $title, 'content' => $content);
    }
  }
  
  $handlers['phpexec'] = new phpexec_handler;
?>