]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/image/plugin.js
WordPress 4.1
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / image / plugin.js
index 9d105eff303477d0a71d53a654ffb9a3e410bdc1..a478da5cabeaf8e162b778d94dd53a8c11064626 100644 (file)
@@ -228,6 +228,15 @@ tinymce.PluginManager.add('image', function(editor) {
                        });
 
                        if (!meta.width && !meta.height) {
+                               var srcURL = this.value(),
+                               absoluteURLPattern = new RegExp('^(?:[a-z]+:)?//', 'i'),
+                               baseURL = editor.settings.document_base_url;
+
+                               //Pattern test the src url and make sure we haven't already prepended the url
+                               if (baseURL && !absoluteURLPattern.test(srcURL) && srcURL.substring(0, baseURL.length) !== baseURL) {
+                                       this.value(baseURL + srcURL);
+                               }
+
                                getImageSize(this.value(), function(data) {
                                        if (data.width && data.height && imageDimensions) {
                                                width = data.width;