diff --git a/core/modules/editor/src/Form/EditorImageDialog.php b/core/modules/editor/src/Form/EditorImageDialog.php
index dcacf64..bb2d569 100644
--- a/core/modules/editor/src/Form/EditorImageDialog.php
+++ b/core/modules/editor/src/Form/EditorImageDialog.php
@@ -90,8 +90,8 @@ public function buildForm(array $form, FormStateInterface $form_state, FilterFor
 
     // Construct strings to use in the upload validators.
     $image_upload = $editor->getImageUploadSettings();
-    if (!empty($image_upload['dimensions'])) {
-      $max_dimensions = $image_upload['dimensions']['max_width'] . '×' . $image_upload['dimensions']['max_height'];
+    if (!empty($image_upload['max_dimensions']['width']) && !empty($image_upload['max_dimensions']['height'])) {
+      $max_dimensions = $image_upload['max_dimensions']['width'] . 'x' . $image_upload['max_dimensions']['height'];
     }
     else {
       $max_dimensions = 0;
diff --git a/core/modules/editor/src/Tests/EditorUploadImageScaleTest.php b/core/modules/editor/src/Tests/EditorUploadImageScaleTest.php
new file mode 100644
index 0000000..0a060fb
--- /dev/null
+++ b/core/modules/editor/src/Tests/EditorUploadImageScaleTest.php
@@ -0,0 +1,140 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\editor\Tests\EditorUploadImageScaleTest.
+ */
+
+namespace Drupal\editor\Tests;
+
+use Drupal\editor\Entity\Editor;
+use Drupal\filter\Entity\FilterFormat;
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests scaling of uploaded images.
+ *
+ * @group editor
+ */
+class EditorUploadImageScaleTest extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['editor', 'editor_test'];
+
+  /**
+   * A user with permission as administer for testing.
+   *
+   * @var \Drupal\user\Entity\User
+   */
+  protected $adminUser;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    // Add text format.
+    FilterFormat::create([
+      'format' => 'basic_html',
+      'name' => 'Basic HTML',
+      'weight' => 0,
+    ])->save();
+
+    // Set up text editor.
+    Editor::create([
+      'format' => 'basic_html',
+      'editor' => 'unicorn',
+      'image_upload' => [
+        'status' => TRUE,
+        'scheme' => file_default_scheme(),
+        'directory' => 'inline-images',
+        'max_size' => '',
+        'max_dimensions' => [
+          'width' => '',
+          'height' => ''
+        ],
+      ]
+    ])->save();
+
+    // Create admin user.
+    $this->adminUser = $this->drupalCreateUser(['administer filters', 'use text format basic_html']);
+    $this->drupalLogin($this->adminUser);
+  }
+
+  /**
+   * Tests scaling of inline image.
+   */
+  public function testEditorUploadImageScale() {
+    // Generate testing images.
+    $testing_image_list = $this->drupalGetTestFiles('image');
+
+    // Case 1: no max dimensions set: uploaded image not scaled.
+    $test_image = $testing_image_list[0];
+    list($image_file_width, $image_file_height) = $this->getTestImageInfo($test_image->uri);
+    $max_width = '';
+    $max_height = '';
+    $this->setMaxDimensions($max_width, $max_height);
+    list($uploaded_image_file_width, $uploaded_image_file_height) = $this->uploadImage($test_image->uri);
+    $this->assertEqual($uploaded_image_file_width, $image_file_width);
+    $this->assertEqual($uploaded_image_file_height, $image_file_height);
+    $this->assertNoRaw(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', ['%dimensions' => $max_width . 'x' . $max_height]));
+
+    // Case 2: max dimensions smaller than uploaded image: image scaled down.
+    $test_image = $testing_image_list[1];
+    list($image_file_width, $image_file_height) = $this->getTestImageInfo($test_image->uri);
+    $max_width = $image_file_width - 5;
+    $max_height = $image_file_height - 5;
+    $this->setMaxDimensions($max_width, $max_height);
+    list($uploaded_image_file_width, $uploaded_image_file_height) = $this->uploadImage($test_image->uri);
+    $this->assertNotEqual($uploaded_image_file_width, $max_width);
+    $this->assertNotEqual($uploaded_image_file_height, $max_height);
+    $this->assertRaw(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', ['%dimensions' => $max_width . 'x' . $max_height]));
+
+    // Case 3: max dimensions greater than uploaded image: image not scaled.
+    $test_image = $testing_image_list[2];
+    list($image_file_width, $image_file_height) = $this->getTestImageInfo($test_image->uri);
+    $max_width = $image_file_width + 5;
+    $max_height = $image_file_height + 5;
+    $this->setMaxDimensions($max_width, $max_height);
+    list($uploaded_image_file_width, $uploaded_image_file_height) = $this->uploadImage($test_image->uri);
+    $this->assertEqual($uploaded_image_file_width, $image_file_width);
+    $this->assertEqual($uploaded_image_file_height, $image_file_height);
+    $this->assertNoRaw(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', ['%dimensions' => $max_width . 'x' . $max_height]));
+  }
+
+  protected function getTestImageInfo($uri) {
+    $image_file = $this->container->get('image.factory')->get($uri);
+    return [
+      (int) $image_file->getWidth(),
+      (int) $image_file->getHeight(),
+    ];
+  }
+
+  protected function setMaxDimensions($width, $height) {
+    $editor = Editor::load('basic_html');
+    $image_upload_settings = $editor->getImageUploadSettings();
+    $image_upload_settings['max_dimensions']['width'] = $width;
+    $image_upload_settings['max_dimensions']['height'] = $height;
+    $editor->setImageUploadSettings($image_upload_settings);
+    $editor->save();
+  }
+
+  protected function uploadImage($uri) {
+    $edit = [
+        'files[fid]' => drupal_realpath($uri),
+    ];
+    $this->drupalGet('editor/dialog/image/basic_html');
+    $this->drupalPostForm('editor/dialog/image/basic_html', $edit, t('Upload'));
+    $uploaded_image_file = $this->container->get('image.factory')->get($uri);
+    return [
+      (int) $uploaded_image_file->getWidth(),
+      (int) $uploaded_image_file->getHeight(),
+    ];
+  }
+
+}
