updated plugin GP Premium
version 2.0.3
This commit is contained in:
@ -239,24 +239,20 @@ class GeneratePress_External_CSS_File {
|
||||
if ( defined( 'DOMAIN_MAPPING' ) && DOMAIN_MAPPING ) {
|
||||
if ( function_exists( 'domain_mapping_siteurl' ) && function_exists( 'get_original_url' ) ) {
|
||||
$mapped_domain = domain_mapping_siteurl( false );
|
||||
$mapped_domain = str_replace( 'https://', '//', $domain_mapping );
|
||||
$mapped_domain = str_replace( 'http://', '//', $mapped_domain );
|
||||
|
||||
$original_domain = get_original_url( 'siteurl' );
|
||||
$original_domain = str_replace( 'https://', '//', $original_domain );
|
||||
$original_domain = str_replace( 'http://', '//', $original_domain );
|
||||
|
||||
$content = str_replace( $original_domain, $mapped_domain, $content );
|
||||
}
|
||||
}
|
||||
|
||||
// Strip protocols.
|
||||
$content = str_replace( 'https://', '//', $content );
|
||||
$content = str_replace( 'http://', '//', $content );
|
||||
|
||||
if ( is_writable( $this->file( 'path' ) ) || ( ! file_exists( $this->file( 'path' ) ) && is_writable( dirname( $this->file( 'path' ) ) ) ) ) {
|
||||
$chmod_file = 0644;
|
||||
|
||||
if ( ! $wp_filesystem->put_contents( $this->file( 'path' ), wp_strip_all_tags( $content ), FS_CHMOD_FILE ) ) {
|
||||
if ( defined( 'FS_CHMOD_FILE' ) ) {
|
||||
$chmod_file = FS_CHMOD_FILE;
|
||||
}
|
||||
|
||||
if ( ! $wp_filesystem->put_contents( $this->file( 'path' ), wp_strip_all_tags( $content ), $chmod_file ) ) {
|
||||
|
||||
// Fail!
|
||||
return false;
|
||||
@ -279,7 +275,7 @@ class GeneratePress_External_CSS_File {
|
||||
global $blog_id;
|
||||
|
||||
// Get the upload directory for this site.
|
||||
$upload_dir = wp_upload_dir();
|
||||
$upload_dir = wp_get_upload_dir();
|
||||
|
||||
// If this is a multisite installation, append the blogid to the filename.
|
||||
$css_blog_id = ( is_multisite() && $blog_id > 1 ) ? '_blog-' . $blog_id : null;
|
||||
@ -335,7 +331,7 @@ class GeneratePress_External_CSS_File {
|
||||
global $blog_id;
|
||||
|
||||
// Get the upload directory for this site.
|
||||
$upload_dir = wp_upload_dir();
|
||||
$upload_dir = wp_get_upload_dir();
|
||||
|
||||
// If this is a multisite installation, append the blogid to the filename.
|
||||
$css_blog_id = ( is_multisite() && $blog_id > 1 ) ? '_blog-' . $blog_id : null;
|
||||
@ -360,9 +356,7 @@ class GeneratePress_External_CSS_File {
|
||||
}
|
||||
}
|
||||
|
||||
// Strip protocols.
|
||||
$css_uri = str_replace( 'https://', '//', $css_uri );
|
||||
$css_uri = str_replace( 'http://', '//', $css_uri );
|
||||
$css_uri = set_url_scheme( $css_uri );
|
||||
|
||||
if ( 'path' === $target ) {
|
||||
return $file_path;
|
||||
|
Reference in New Issue
Block a user