summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank2017-08-09 19:52:47 (GMT)
committerFrank2017-08-09 19:52:47 (GMT)
commit87f51bd2a79ff740824218ff9e958458c10aa693 (patch)
tree4b253d3c4126e16911d4def51c022b6c4d21b422
parent5cccfa373b65bb0ac1912a935322352629eddaa0 (diff)
[size] tags with large values (phpBB compatible)
-rw-r--r--bbcode-filter.inc19
1 files changed, 8 insertions, 11 deletions
diff --git a/bbcode-filter.inc b/bbcode-filter.inc
index 5c5fe46..52ed769 100644
--- a/bbcode-filter.inc
+++ b/bbcode-filter.inc
@@ -87,7 +87,7 @@ function _bbcode_filter_process(&$body, $settings) {
$arr = array(
'tag' => 'size',
'pattern' => '#\[\x07=([\d]+)(?::\w+)?\]([^\x07]*)\[/\x07(?::\w+)?\]#esi',
- 'replacement' => '"<span style=\"font-size:". _bbcode_round_size_val(\'$1\') ."px\">". str_replace(\'\"\', \'"\', \'$2\') ."</span>"',
+ 'replacement' => '"<span style=\"font-size:". _bbcode_size_val(\'$1\') ."\">". str_replace(\'\"\', \'"\', \'$2\') ."</span>"',
'text' => $body,
);
$body = _bbcode_replace_nest_tag($arr);
@@ -385,16 +385,13 @@ function _bbcode_php_tag($text = NULL) {
return '<pre>' . highlight_string( str_replace('<br />', '', stripslashes($text)), TRUE) . '</pre>';
}
-function _bbcode_round_size_val($size) {
- if ($size < 6) {
- return 6;
- }
- elseif ($size > 48) {
- return 48;
- }
- else {
- return $size;
- }
+function _bbcode_size_val($size) {
+ if ($size < 6)
+ return '6px';
+ elseif ($size <= 48)
+ return $size . 'px';
+ else
+ return $size . '%';
}
function _bbcode_replace_nest_tag($arr = NULL) {