diff --git a/wp-admin/css/press-this.css b/wp-admin/css/press-this.css
index 70c7e64b13..daf60bafe6 100644
--- a/wp-admin/css/press-this.css
+++ b/wp-admin/css/press-this.css
@@ -4,6 +4,8 @@ body {
margin: 0px;
padding: 0px;
}
+
+img { border: 0; }
/* Tabs */
@media projection , screen {
.ui-tabs-hide {
diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php
index ed9f598d77..ce60aa5570 100644
--- a/wp-admin/press-this.php
+++ b/wp-admin/press-this.php
@@ -184,19 +184,21 @@ if($_REQUEST['ajax'] == 'photo_images') {
$host = parse_url($uri);
- $pattern = '/]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif)[^<>\'\"]*)(\2)([^>\/]*)\/*>/is';
+ $pattern = '/
]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))[^<>\'\"]*(\2)([^>\/]*)\/*>/is';
preg_match_all($pattern, $content, $matches);
-
+
if ( empty($matches[1]) ) return '';
$sources = array();
foreach ($matches[3] as $src) {
+ // if no http in url
if(strpos($src, 'http') === false)
- if(strpos($src, '../') === false && strpos($src, './') === false)
+ // if it doesn't have a relative uri
+ if( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === true)
$src = 'http://'.str_replace('//','/', $host['host'].'/'.$src);
else
- $src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src);
-
+ $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src);
+
$sources[] = clean_url($src);
}
return "'" . implode("','", $sources) . "'";
@@ -247,12 +249,12 @@ if($_REQUEST['ajax'] == 'photo_js') { ?>
}
function pick(img, desc) {
- if (img) {
- length = jQuery('.photolist input').length;
+ if (img) {
+ if('object' == typeof jQuery('.photolist input') && jQuery('.photolist input').length != 0) length = jQuery('.photolist input').length;
if(length == 0) length = 1;
jQuery('.photolist').append('');
jQuery('.photolist').append('');
- append_editor("\n\n" + '