コード例 #1
0
ファイル: Error.php プロジェクト: aquarion/Plank
    function defaultError($status, $message, $response)
    {
        $trace = debug_backtrace();
        if (is_object($message) && is_subclass_of($message, 'Exception')) {
            $trace = $message->getTrace();
            $message = $message->getMessage();
        }
        if (defined('DESTRUCT')) {
            die($message);
        }
        $view = new Plank_View('Errors', 'Error503');
        $view->error = '		
		<p>Something\'s drastically wrong. Sorry about this, this is a last-ditch fail message, caused by terror upon terror to have been inflicted upon my poor innocent paradiems. Nothing\'s worked. The thing you asked for? Failed. The recovery from error system? Broken. The error display system itself? F****d. I have no idea what to try next, so I\'m going to throw data at you until you go away.</p>
				
		<h2>' . $message . '</h2>
		
		';
        $view->error .= Plank_Error::getBacktrace($trace);
        $response->setContent($view->render());
        $response->respond();
        if (defined("TEXTMODE")) {
            echo "Uh-Oh\n";
            echo striptags($view->error);
            die;
        } else {
            echo Plank_Logger_Display::display();
        }
    }
コード例 #2
0
ファイル: QueryBuilder.php プロジェクト: emachiels/SqlXS
 /**
  * Constructs a new query builder
  *
  * @param int $type The type of query
  * @param string $table The name of the table to perform actions on
  * @param array $fields The fields, used by SELECT and UPDATE
  */
 public function __construct($type, $table, array $fields = array())
 {
     if ($type < 0 && $type > 3) {
         throw new DomainException('Type #' . striptags($type) . ' is no valid Query type.');
     }
     $this->type = $type;
     $this->table = $table;
     $this->fields = $fields;
 }
コード例 #3
0
ファイル: InputFilter.php プロジェクト: Clansuite/Clansuite
 /**
  * Modifies a given String
  *
  * @param string $string       String to modify
  * @param string $modificators One OR Multiple Modificators to use on the String
  */
 public function modify($string = '', $modificators = '')
 {
     $mods = array();
     $mods = mb_split('[|]', $modificators);
     foreach ($mods as $key => $value) {
         switch ($value) {
             case 'add_slashes':
                 $string = addslashes($string);
                 break;
             case 'strip_slashes':
                 $string = stripslashes($string);
                 break;
             case 'strip_tags':
                 $string = striptags($string);
                 break;
             case 'urlencode':
                 $string = urlencode($string);
                 break;
             case 'urldecode':
                 $string = urldecode($string);
                 break;
                 // Replacement: ? instead of &#233
                 // todo: include replacement of & with amp -> menueditor.module.php line155
             // Replacement: ? instead of &#233
             // todo: include replacement of & with amp -> menueditor.module.php line155
             case 'html_replace:numeric_entities':
                 $string = preg_replace('/[^!-%\\x27-;=?-~ ]/e', '"&#".ord("$0").chr(59)', $str);
                 break;
                 // Replacement: zB &#8364 instead of &euro
             // Replacement: zB &#8364 instead of &euro
             case 'html_replace:normal_to_numerical_entities':
                 $string = $this->modify(html_entity_decode($string), 'html_numeric_entities');
                 break;
             default:
                 break;
         }
     }
     return $string;
 }
コード例 #4
0
 $item->setListingType($auction_type_name);
 $item->Currency = DEFAULT_CURRENCY;
 //currency
 $item->Site = 'Germany';
 //site (ebay.de)
 //use sheduling if there is one
 if (isset($future_auction)) {
     $item->setScheduleTime($mynewstarttime);
 }
 //set title
 $product_title = stripcslashes($product_title);
 $product_title = striptags($product_title);
 $item->Title = $product_title;
 //set subtitle
 $product_title = stripcslashes($product_subtitle);
 $product_title = striptags($product_subtitle);
 $item->setSubTitle($product_subtitle);
 //set 1st category
 $item->PrimaryCategory = new CategoryType();
 $item->PrimaryCategory->CategoryID = $cat1;
 //set 2nd category
 $pos = strpos($cat1, LPAREN);
 if ($pos) {
     $cat1 = substr($cat1, $pos);
 }
 if ($cat2) {
     $item->SecondaryCategory = new CategoryType();
     $item->SecondaryCategory->CategoryID = $cat2;
 }
 //set description
 $item->Description = $products_description;