diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2004-11-14 17:12:07 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2004-11-14 17:12:07 +0000 |
| commit | d4d1307e1546393b40eeda8d762a6663d831a882 (patch) | |
| tree | c6053d736e983598fdfe1f5de42e24efce1a313d /phpBB/includes/bbcode.php | |
| parent | d62c5a6fcd06605087b5084beb897798fbf11ec9 (diff) | |
| download | forums-d4d1307e1546393b40eeda8d762a6663d831a882.tar forums-d4d1307e1546393b40eeda8d762a6663d831a882.tar.gz forums-d4d1307e1546393b40eeda8d762a6663d831a882.tar.bz2 forums-d4d1307e1546393b40eeda8d762a6663d831a882.tar.xz forums-d4d1307e1546393b40eeda8d762a6663d831a882.zip | |
- letting urls work again, fixing [code] breakage on urls, corrected magic_url to be able to parse urls at the beginning/end of bbcode blocks
- fixed "edited by" message.
git-svn-id: file:///svn/phpbb/trunk@5027 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/bbcode.php')
| -rw-r--r-- | phpBB/includes/bbcode.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 1e4183109d..e0b22fd140 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -163,11 +163,10 @@ class bbcode case 0: $this->bbcode_cache[$bbcode_id] = array( 'str' => array( - '[quote:$uid]' => $this->bbcode_tpl('quote_open', $bbcode_id), '[/quote:$uid]' => $this->bbcode_tpl('quote_close', $bbcode_id) ), 'preg' => array( - '#\[quote="(.*?)":$uid\]#' => $this->bbcode_tpl('quote_username_open', $bbcode_id) + '#\[quote(?:="(.*?)")?:$uid\](.)#ise' => "\$this->bbcode_second_pass_quote('\$1', '\$2')" ) ); break; @@ -459,6 +458,23 @@ class bbcode return str_replace('{LIST_TYPE}', $type, $this->bbcode_tpl($tpl)); } + function bbcode_second_pass_quote($username, $quote) + { + // when using the /e modifier, preg_replace slashes double-quotes but does not + // seem to slash anything else + $quote = str_replace('\"', '"', $quote); + + // remove newline at the beginning + if ($quote{0} == "\n") + { + $quote = substr($quote, 1); + } + + $quote = (($username) ? str_replace('$1', $username, $this->bbcode_tpl('quote_username_open')) : $this->bbcode_tpl('quote_open')) . $quote; + + return $quote; + } + function bbcode_second_pass_code($type, $code) { // when using the /e modifier, preg_replace slashes double-quotes but does not |
