diff --git a/class/class-mainwp-child-branding.php b/class/class-mainwp-child-branding.php
index df25001..5d1655c 100644
--- a/class/class-mainwp-child-branding.php
+++ b/class/class-mainwp-child-branding.php
@@ -498,14 +498,14 @@ class MainWP_Child_Branding {
}
if ( ! empty( $header_css ) ) {
- echo '';
+ echo '';
}
}
function custom_login_css() {
$extra_setting = $this->settings['extra_settings'];
if ( is_array( $extra_setting ) && isset( $extra_setting['login_css'] ) && ! empty( $extra_setting['login_css'] ) ) {
- echo '';
+ echo '';
}
}
@@ -658,7 +658,7 @@ class MainWP_Child_Branding {
-
+
array(),
) );
- remove_filter( 'http_request_args', array( &$this, 'http_request_reject_unsafe_urls' ), 99, 2 );
- if ( isset( $_POST['sslVerify'] ) && '0' === $_POST['sslVerify'] ) {
- remove_filter( 'http_request_args', array( &$this, 'noSSLFilterFunction' ), 99 );
- }
if ( is_wp_error( $result ) ) {
- $error = $result->get_error_codes();
- if ( is_array( $error ) ) {
- MainWP_Helper::error( implode( ', ', $error ) );
- } else {
- MainWP_Helper::error( $error );
+ if ( true == $ssl_verify && strpos( $url, 'https://' ) === 0) {
+ // retry
+ add_filter( 'http_request_args', array( &$this, 'noSSLFilterFunction' ), 99, 2 );
+ $ssl_verify = false;
+ $result = $installer->run( array(
+ 'package' => $url,
+ 'destination' => ( 'plugin' === $_POST['type'] ? WP_PLUGIN_DIR
+ : WP_CONTENT_DIR . '/themes' ),
+ 'clear_destination' => ( isset( $_POST['overwrite'] ) && $_POST['overwrite'] ),
+ //overwrite files?
+ 'clear_working' => true,
+ 'hook_extra' => array(),
+ ) );
}
+
+ if ( is_wp_error( $result ) ) {
+ if ( $result->get_error_data() && is_string( $result->get_error_data() ) ) {
+ $error = $result->get_error_data();
+ MainWP_Helper::error( $error );
+ } else {
+ $error = $result->get_error_code();
+ MainWP_Helper::error( implode( ', ', $error ) );
+ }
+ }
+ }
+
+ remove_filter( 'http_request_args', array( &$this, 'http_request_reject_unsafe_urls' ), 99, 2 );
+ if ( false == $ssl_verify ) {
+ remove_filter( 'http_request_args', array( &$this, 'noSSLFilterFunction' ), 99 );
}
$args = array( 'success' => 1, 'action' => 'install' );
diff --git a/class/class-mainwp-clone-install.php b/class/class-mainwp-clone-install.php
index cada613..098af7b 100644
--- a/class/class-mainwp-clone-install.php
+++ b/class/class-mainwp-clone-install.php
@@ -207,9 +207,9 @@ class MainWP_Clone_Install {
$var = $wpdb->get_var( $wpdb->prepare( 'SELECT option_value FROM ' . $this->config['prefix'] . 'options WHERE option_name = %s', $name) );
if ( null === $var ) {
- $wpdb->query( $wpdb->prepare( 'INSERT INTO ' . $this->config['prefix'] . 'options (`option_name`, `option_value`) VALUES (%s, "' . MainWPChildDB::real_escape_string( maybe_serialize( $value ) ) . '")', $name) );
+ $wpdb->query( $wpdb->prepare( 'INSERT INTO ' . $this->config['prefix'] . 'options (`option_name`, `option_value`) VALUES (%s, "' . MainWP_Child_DB::real_escape_string( maybe_serialize( $value ) ) . '")', $name) );
} else {
- $wpdb->query( $wpdb->prepare( 'UPDATE ' . $this->config['prefix'] . 'options SET option_value = "' . MainWPChildDB::real_escape_string( maybe_serialize( $value ) ) . '" WHERE option_name = %s', $name) );
+ $wpdb->query( $wpdb->prepare( 'UPDATE ' . $this->config['prefix'] . 'options SET option_value = "' . MainWP_Child_DB::real_escape_string( maybe_serialize( $value ) ) . '" WHERE option_name = %s', $name) );
}
}
diff --git a/class/class-mainwp-helper.php b/class/class-mainwp-helper.php
index 298a225..ef851e6 100644
--- a/class/class-mainwp-helper.php
+++ b/class/class-mainwp-helper.php
@@ -29,6 +29,96 @@ class MainWP_Helper {
MainWP_Helper::write( $information );
}
+ /**
+ * PARSE
+ * Parses some CSS into an array
+ * CSSPARSER
+ * Copyright (C) 2009 Peter Kröner
+ */
+ public static function parse_css($css){
+
+ // Remove CSS-Comments
+ $css = preg_replace('/\/\*.*?\*\//ms', '', $css);
+ // Remove HTML-Comments
+ $css = preg_replace('/([^\'"]+?)(\