Replace spaces in file name

parent ba34bb99
...@@ -52,7 +52,7 @@ if(!class_exists('SH_VideoUpload')) { ...@@ -52,7 +52,7 @@ if(!class_exists('SH_VideoUpload')) {
else $uniqid = uniqid(); else $uniqid = uniqid();
$uploadFolder = get_option('sexhack_video_tmp_path', '/tmp'); $uploadFolder = get_option('sexhack_video_tmp_path', '/tmp');
$uploadFileName = $uniqid . "_" . sanitize_text_field($request->getFileName()); $uploadFileName = $uniqid . "_" . str_replace(" ", "_", sanitize_text_field($request->getFileName()));
$uploadPath = $uploadFolder."/".$uploadFileName; $uploadPath = $uploadFolder."/".$uploadFileName;
if (\Flow\Basic::save($uploadPath, $config, $request)) { if (\Flow\Basic::save($uploadPath, $config, $request)) {
......
...@@ -211,7 +211,7 @@ get_header(); ?> ...@@ -211,7 +211,7 @@ get_header(); ?>
else if($gif_preview) echo '<img class="sexhack_videopreview" src="'.$gif_preview.'" loading="lazy"></img>'; else if($gif_preview) echo '<img class="sexhack_videopreview" src="'.$gif_preview.'" loading="lazy"></img>';
else echo '<img class="sexhack_videopreview" src="'.$thumb.'" loading="lazy"></img>'; else echo '<img class="sexhack_videopreview" src="'.$thumb.'" loading="lazy"></img>';
?> ?>
<h2 class='sexhack-videonotify' style="padding:5%;"><b>PUBLIC VIDEO NOT AVAILABLE</b></h2> <h2 class='sexhack-videonotify' style="padding:5%;"><b>LOGIN TO WATCH THIS VIDEO</b></h2>
<?php <?php
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment