<?php
/******************************* PHP-P10 v2 *****************************
- * Copyright (C) 2011 Philipp Kreil (pk910) *
+ * Copyright (C) 2011-2012 Philipp Kreil (pk910) *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
if(is_a($this->php, "P10_User")) {
$this->uplink->join($this->php, "#php", (P10_Channel::USERPRIV_OPED | P10_Channel::USERPRIV_VOICE));
$this->uplink->join($this->php, "#dev", P10_Channel::USERPRIV_VOICE);
+ $this->uplink->join($this->php, "#CoderCom", P10_Channel::USERPRIV_VOICE);
}
} else {
$this->php = $old;
return;
}
$entry['time'] = time();
- fwrite($entry['pipes'][0], "<"."?php ".$exp[1]." ?".">");
+ if(preg_match("#pastebin\.com/([a-zA-Z0-9]*)$#i", $exp[1])) {
+ $pasteid = explode("/", $exp[1]);
+ $pasteid = $pasteid[count($pasteid)-1];
+ $codecontent = file_get_contents("http://pastebin.com/download.php?i=".$pasteid);
+ if(preg_match("#Unknown Paste ID!#i", $codecontent)) {
+ $this->uplink->notice($this->bot, $user, "Unknown Paste ID!");
+ return;
+ }
+ $code = $codecontent;
+ } else {
+ $code = "<"."?php " . $exp[1] . " ?".">";
+ };
+ fwrite($entry['pipes'][0], $code);
fclose($entry['pipes'][0]);
$this->phpcache[] = $entry;
break;