summaryrefslogtreecommitdiffstats
path: root/handlers/phpexec.inc.php
blob: fa84d61eeba1c958fe72d68d2b042bbd34810b7f (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
  include('code/message.inc.php');
  include('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;
?>