Severity: 8192
Message: Function create_function() is deprecated
Filename: geshi/geshi.php
Line Number: 4698
Backtrace:
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once
<?php /** * @file BBCodeConverter.php * @brief This file contains the BBCodeConverter class. * @details * @author Filippo F. Fadda */ /** * @brief A rudimental converter that takes as input a BBCode formatted text and converts it to Markdown. */ class BBCodeConverter extends Converter { /** * @brief Removes BBCode size. */ protected function removeSize() { function ($matches) { return $matches[1]; }, $this->text ); } /** * @brief Removes BBCode center. */ protected function removeCenter() { function ($matches) { return $matches[1]; }, $this->text ); } /** * @brief Replaces BBCode bold. */ protected function replaceBold() { function ($matches) { }, $this->text ); } /** * @brief Replaces BBCode italic. */ protected function replaceItalic() { function ($matches) { }, $this->text ); } /** * @brief Replaces BBCode underline. Hoedown support underline. */ protected function replaceUnderline() { function ($matches) { }, $this->text ); } /** * @brief Replaces BBCode strikethrough. */ protected function replaceStrikethrough() { function ($matches) { }, $this->text ); } /** * @brief Replaces BBCode lists. */ protected function replaceLists() { function ($matches) { $buffer = ""; throw new \RuntimeException(sprintf("Text identified by '%d' has malformed BBCode lists", $this->id)); // We start from 1 to discard the first string, in fact, it's empty. for ($i = 1; $i < $counter; $i++) } else { // unordered list // We start from 1 to discard the first string, in fact, it's empty. for ($i = 1; $i < $counter; $i++) } // We need a like break above the list and another one below. $buffer = PHP_EOL.$buffer.PHP_EOL; return $buffer; }, $this->text ); } /** * @brief Replaces BBCode urls. */ protected function replaceUrls() { $this->text = preg_replace_callback('%\[url\s*=\s*("(?:[^"]*")|\A[^\']*\Z|(?:[^\'">\]\s]+))\s*(?:[^]\s]*)\]([\W\D\w\s]*?)\[/url\]%iu', function ($matches) { return "[".$matches[2]."](".$matches[1].")"; else throw new \RuntimeException(sprintf("Text identified by '%d' has malformed BBCode urls", $this->id)); }, $this->text ); } /** * @brief Replaces BBCode images. */ protected function replaceImages() { $this->text = preg_replace_callback('%\[img\s*\]\s*("(?:[^"]*")|\A[^\']*\Z|(?:[^\'">\]\s]+))\s*(?:[^]\s]*)\[/img\]%iu', function ($matches) { return PHP_EOL."![]"."(".$matches[1].")".PHP_EOL; else throw new \RuntimeException(sprintf("Text identified by '%d' have malformed BBCode images", $this->id)); }, $this->text ); } /** * @brief Replaces BBCode quotes. * @details Thanks to Casimir et Hippolyte for helping me with this regex. */ protected function replaceQuotes() { // Removes the inner quotes, leaving just one level. $this->text = preg_replace('~\G(?<!^)(?>(\[quote\b[^]]*](?>[^[]++|\[(?!/?quote)|(?1))*\[/quote])|(?<!\[)(?>[^[]++|\[(?!/?quote))+\K)|\[quote\b[^]]*]\K~', '', $this->text); // Replaces all the remaining quotes with '> ' characters. function($matches) { return "> ".$quote.PHP_EOL.PHP_EOL; }, $this->text ); } /** * @brief Replaces BBCode snippets. */ protected function replaceSnippets() { $this->text = preg_replace_callback('%\[code\s*=?(?P<language>\w*)\](?P<snippet>[\W\D\w\s]*?)\[\/code\]%iu', function ($matches) { if ($language == 'html4strict' or $language == 'div') $language = 'html'; elseif ($language == 'shell' or $language == 'dos' or $language == 'batch') $language = 'sh'; elseif ($language == 'xul' or $language == 'wpf') $language = 'xml'; elseif ($language == 'asm') $language = 'nasm'; elseif ($language == 'vb' or $language == 'visualbasic' or $language == 'vba') $language = 'vb.net'; elseif ($language == 'asp') $language = 'aspx-vb'; elseif ($language == 'xaml') $language = 'xml'; elseif ($language == 'cplusplus') $language = 'cpp'; elseif ($language == 'txt' or $language == 'gettext') $language = 'text'; elseif ($language == 'basic') $language = 'cbmbas'; elseif ($language == 'lisp') $language = 'clojure'; elseif ($language == 'aspnet') $language = 'aspx-vb'; } else throw new \RuntimeException(sprintf("Text identified by '%d' has malformed BBCode snippet.", $this->id)); }, $this->text ); } /** * @brief Converts the provided BBCode text to an equivalent Markdown text. */ public function toMarkdown() { $this->removeCenter(); $this->removeSize(); $this->replaceBold(); $this->replaceItalic(); $this->replaceUnderline(); $this->replaceStrikethrough(); $this->replaceLists(); $this->replaceUrls(); $this->replaceImages(); $this->replaceQuotes(); $this->replaceSnippets(); return $this->text; } }
Title | Name | Language | UNIX | When |
---|---|---|---|---|
Re: dddddddd | aaa | python | 1438007022 | 10 Years ago. |