Skip to content

Commit 80653fb

Browse files
author
Md. Alimuzzaman Alim
committed
Update lite-speed-cache.php
1 parent 4138d98 commit 80653fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/classes/compatibility/lite-speed-cache.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function sync_image($row_img, $local_file){
8787

8888
if ( ! $rm_ori_bkup ){
8989
$extension = pathinfo( $gs_name, PATHINFO_EXTENSION ) ;
90-
$bk_file = substr( $gs_name, -strlen( $extension ) ) . 'bk.' . $extension ;
90+
$bk_file = substr( $gs_name, 0, -strlen( $extension ) ) . 'bk.' . $extension ;
9191
$cloud_meta['fileMd5'][$bk_file] = $cloud_meta['fileMd5'][$gs_name];
9292
do_action( 'sm:sync::copyFile', $gs_name, $bk_file);
9393
}
@@ -256,7 +256,7 @@ public function cloud_meta_add_file_md5($cloud_meta, $media, $image_size, $img,
256256
if($file_hash = md5_file( $img['path'] )){
257257
$gs_name = !empty($media['name']) ? $media['name'] : $img['gs_name'];
258258
$extension = pathinfo( $gs_name, PATHINFO_EXTENSION ) ;
259-
$bk_file = substr( $gs_name, -strlen( $extension ) ) . 'bk.' . $extension ;
259+
$bk_file = substr( $gs_name, 0, -strlen( $extension ) ) . 'bk.' . $extension ;
260260

261261
// Storing file hash
262262
$cloud_meta['fileMd5'][$gs_name] = $file_hash;
@@ -319,8 +319,8 @@ public function update_md5_and_manual_sync($attachment_id){
319319

320320
if(!$rm_ori_bkup){
321321
$extension = pathinfo( $file_path, PATHINFO_EXTENSION ) ;
322-
$bk_file = substr( $file_path, -strlen( $extension ) ) . 'bk.' . $extension ;
323-
$bk_file_optm = substr( $file_path, -strlen( $extension ) ) . 'bk.optm.' . $extension;
322+
$bk_file = substr( $file_path, 0, -strlen( $extension ) ) . 'bk.' . $extension ;
323+
$bk_file_optm = substr( $file_path, 0, -strlen( $extension ) ) . 'bk.optm.' . $extension;
324324
if(file_exists($bk_file)){
325325
$gs_name = apply_filters( 'wp_stateless_file_name', $bk_file);
326326
$cloud_meta['fileMd5'][$gs_name] = md5_file($bk_file);

0 commit comments

Comments
 (0)