Merge with branch01 + version update

This commit is contained in:
ruben- 2015-05-23 13:11:13 +02:00
parent 9f56bb7ada
commit 4e9d20aa04
5 changed files with 2063 additions and 12 deletions

View file

@ -11,7 +11,7 @@ include_once(ABSPATH . '/wp-admin/includes/plugin.php');
class MainWPChild
{
private $version = '2.0.16';
private $version = '2.0.17';
private $update_version = '1.2';
private $callableFunctions = array(
@ -1176,13 +1176,16 @@ class MainWPChild
}
$plugins = $newPlugins;
}
if (count($plugins) > 0)
{
//Fix bug
//Fix bug
if ((count($plugins) > 0) || (count($premiumPlugins) > 0)) {
global $wp_current_filter;
$wp_current_filter[] = 'load-update.php';
wp_update_plugins();
wp_update_plugins();
}
if (count($plugins) > 0)
{
//@see wp-admin/update.php
$upgrader = new Plugin_Upgrader(new Bulk_Plugin_Upgrader_Skin(compact('nonce', 'url')));
$result = $upgrader->bulk_upgrade($plugins);
@ -2614,8 +2617,13 @@ class MainWPChild
$request = wp_remote_get( $url, array('timeout' => 50));
$favi = "";
if (is_array($request) && isset($request['body'])) {
$preg_str = '/(<link\s+(?:[^\>]*)(?:rel="(?:shortcut\s+)?icon"\s*)(?:[^>]*)?href="([^"]+)"(?:[^>]*)?>)/is';
if (preg_match($preg_str, $request['body'], $matches))
// to fix bug
$preg_str1 = '/(<link\s+(?:[^\>]*)(?:rel="shortcut\s+icon"\s*)(?:[^>]*)?href="([^"]+)"(?:[^>]*)?>)/is';
$preg_str2 = '/(<link\s+(?:[^\>]*)(?:rel="(?:shortcut\s+)?icon"\s*)(?:[^>]*)?href="([^"]+)"(?:[^>]*)?>)/is';
if (preg_match($preg_str1, $request['body'], $matches))
{
$favi = $matches[2];
} else if (preg_match($preg_str2, $request['body'], $matches))
{
$favi = $matches[2];
} else if (file_exists(ABSPATH . 'favicon.ico')) {

View file

@ -169,9 +169,17 @@ class MainWPHelper
$localUrl = $downloadfile['url'];
$linkToReplaceWith = dirname($localUrl);
if ($hrefLink != '')
{
$lnkToReplace = dirname($hrefLink);
if ($lnkToReplace != 'http:' && $lnkToReplace != 'https:') $new_post['post_content'] = str_replace($lnkToReplace, $linkToReplaceWith, $new_post['post_content']);
{
$server = get_option('mainwp_child_server');
$serverHost = parse_url($server, PHP_URL_HOST);
if (!empty($serverHost) && strpos($hrefLink, $serverHost) !== false) {
$serverHref = "href=\"" .$serverHost;
$replaceServerHref = "href=\"" .parse_url($localUrl, PHP_URL_SCHEME) . "://" . parse_url($localUrl, PHP_URL_HOST);
$new_post['post_content'] = str_replace($serverHref, $replaceServerHref, $new_post['post_content']);
} if (strpos($hrefLink, "http") !== false) {
$lnkToReplace = dirname($hrefLink);
if ($lnkToReplace != 'http:' && $lnkToReplace != 'https:') $new_post['post_content'] = str_replace($lnkToReplace, $linkToReplaceWith, $new_post['post_content']);
}
}
$lnkToReplace = dirname($imgUrl);

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,7 @@
Description: Child Plugin for MainWP. The plugin is used so the installed blog can be securely managed remotely by your network. Plugin documentation and options can be found here http://docs.mainwp.com
Author: MainWP
Author URI: http://mainwp.com
Version: 2.0.16
Version: 2.0.17
*/
header('X-Frame-Options: ALLOWALL');
//header('X-Frame-Options: GOFORIT');