diff --git a/crayon_formatter.class.php b/crayon_formatter.class.php index 9adf4c46..eef77fa8 100644 --- a/crayon_formatter.class.php +++ b/crayon_formatter.class.php @@ -115,8 +115,8 @@ public static function print_code($hl, $code, $line_numbers = TRUE, $print = TRU $_line_height = $hl->setting_val(CrayonSettings::LINE_HEIGHT); // Don't allow line height to be less than font size $line_height = ($_line_height > $_font_size ? $_line_height : $_font_size) . 'px !important;'; - $toolbar_height = $font_size * 1.5 . 'px !important;'; - $info_height = $font_size * 1.4 . 'px !important;'; + $toolbar_height = ($_font_size * 1.5) . 'px !important;'; + $info_height = ($_font_size * 1.4) . 'px !important;'; $font_style .= "font-size: $font_size line-height: $line_height"; $toolbar_style .= "font-size: $font_size"; diff --git a/crayon_langs.class.php b/crayon_langs.class.php index 651f55c8..f522cca6 100644 --- a/crayon_langs.class.php +++ b/crayon_langs.class.php @@ -337,7 +337,7 @@ function __construct($id, $name = NULL) { // Override function clean_id($id) { $id = CrayonUtil::space_to_hyphen( strtolower(trim($id)) ); - return preg_replace('/[^\w-+#]/msi', '', $id); + return preg_replace('/[^\w+#-]/msi', '', $id); } function ext($ext = NULL) { @@ -411,7 +411,7 @@ function element($name, $element = NULL) { $name = trim(strtoupper($name)); if (array_key_exists($name, $this->elements) && $element === NULL) { return $this->elements[$name]; - } else if (@get_class($element) == CRAYON_ELEMENT_CLASS) { + } else if ($element !== NULL && @get_class($element) == CRAYON_ELEMENT_CLASS) { $this->elements[$name] = $element; } } diff --git a/util/crayon_util.class.php b/util/crayon_util.class.php index 9a40608c..e81172f2 100644 --- a/util/crayon_util.class.php +++ b/util/crayon_util.class.php @@ -70,7 +70,7 @@ public static function lines($path, $opts = NULL) { if ($whitespace) { $delimiter = CRAYON_NL; } - $lines = implode($lines, $delimiter); + $lines = implode($delimiter, $lines); } return $lines;