Skip to content

Commit

Permalink
remove numeric check
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed May 3, 2022
1 parent 8e6ed37 commit cf1047b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ public function onDisplay(
$externalPlugins = [];
$options = $doc->getScriptOptions('plg_editor_tinymce');
$theme = 'silver';
$width = is_numeric($width) ? $width . 'px' : $width;
$height = is_numeric($height) ? $height . 'px' : $height;

// Data object for the layout
$textarea = new stdClass;
Expand Down Expand Up @@ -237,11 +235,6 @@ public function onDisplay(
$valid_elements = trim($levelParams->get('valid_elements', ''));
}

$html_width = $width ?: $this->params->get('html_width', '');
$html_width = is_numeric($html_width) ? $html_width . 'px' : $html_width;
$html_height = $height ?: $this->params->get('html_height', '550');
$html_height = is_numeric($html_height) ? $html_height . 'px' : $html_height;

// The param is true for vertical resizing only, false or both
$resizing = (bool) $levelParams->get('resizing', true);
$resize_horizontal = (bool) $levelParams->get('resize_horizontal', true);
Expand Down Expand Up @@ -478,8 +471,8 @@ public function onDisplay(
'document_base_url' => Uri::root(true) . '/',
'image_caption' => true,
'importcss_append' => true,
'height' => $html_height,
'width' => $html_width,
'height' => $height ?: $this->params->get('html_height', '550'),
'width' => $width ?: $this->params->get('html_width', ''),
'elementpath' => (bool) $levelParams->get('element_path', true),
'resize' => $resizing,
'templates' => $templates,
Expand Down

0 comments on commit cf1047b

Please sign in to comment.