Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for PHP 8.0 #481

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crayon_formatter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = floatval($font_size) * 1.5 . 'px !important;';
$info_height = floatval($font_size) * 1.4 . 'px !important;';

$font_style .= "font-size: $font_size line-height: $line_height";
$toolbar_style .= "font-size: $font_size";
Expand All @@ -131,7 +131,7 @@ public static function print_code($hl, $code, $line_numbers = TRUE, $print = TRU
} else if (!$hl->is_inline()) {
if (($font_size = CrayonGlobalSettings::get(CrayonSettings::FONT_SIZE)) !== FALSE) {
$font_size = $font_size->def() . 'px !important;';
$line_height = ($font_size * 1.4) . 'px !important;';
$line_height = (floatval($font_size) * 1.4) . 'px !important;';
}
}

Expand Down
4 changes: 2 additions & 2 deletions util/crayon_util.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -645,7 +645,7 @@ public static function get_var_str() {
foreach ($_GET as $get => $val) {
$get_vars[] = $get . '=' . $val;
}
return implode($get_vars, '&');
return implode('&', $get_vars);
}

// Creates a unique ID from a string
Expand Down