Skip to content

Commit

Permalink
Hot fix for #146
Browse files Browse the repository at this point in the history
  • Loading branch information
alimuzzaman committed Aug 29, 2017
1 parent f36a261 commit 591f307
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/classes/class-bootstrap.php
Expand Up @@ -437,7 +437,7 @@ public function the_content_filter( $content ) {
$root_dir = trim( $this->get( 'sm.root_dir' ), '/ ' ); // Remove any forward slash and empty space.
$root_dir = !empty( $root_dir ) ? $root_dir . '/' : false;
$image_host = $this->get_gs_host();
$content = preg_replace( '/(href|src)=(\'|")(https?:\/\/'.str_replace('/', '\/', $baseurl).')\/(.+?)(\.jpg|\.png|\.gif|\.jpeg)(\'|")/i',
$content = preg_replace( '/(href|src)=(\'|")(https?:\/\/'.str_replace('/', '\/', $baseurl).')\/(.+?)(\.jpg|\.png|\.gif|\.jpeg|\.pdf)(\'|")/i',
'$1=$2'.$image_host.'/'.($root_dir?$root_dir:'').'$4$5$6', $content);
}
}
Expand Down Expand Up @@ -517,7 +517,7 @@ public function _convert_to_gs_link($meta){
}
return $meta;
} elseif(is_string($meta)){
return preg_replace( '/(https?:\/\/'.str_replace('/', '\/', $baseurl).')\/(.+?)(\.jpg|\.png|\.gif|\.jpeg)/i', $image_host.'$2$3', $meta);
return preg_replace( '/(https?:\/\/'.str_replace('/', '\/', $baseurl).')\/(.+?)(\.jpg|\.png|\.gif|\.jpeg|\.pdf)/i', $image_host.'$2$3', $meta);
}
}
}
Expand Down

1 comment on commit 591f307

@alimuzzaman
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added pdf support.

Please sign in to comment.