Skip to content

Commit dd7f5a6

Browse files
committed
use str_contains() instead of preg_match() in LfmHelpers
1 parent 7f7b45d commit dd7f5a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/traits/LfmHelpers.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ private function appendThumbFolderPath($is_thumb)
9696
}
9797

9898
$thumb_folder_name = config('lfm.thumb_folder_name');
99-
//if user is inside thumbs folder there is no need
100-
// to add thumbs substring to the end of $url
101-
$in_thumb_folder = preg_match('/'.$thumb_folder_name.'$/i', $this->getFormatedWorkingDir());
99+
// if user is inside thumbs folder, there is no need
100+
// to add thumbs substring to the end of url
101+
$in_thumb_folder = str_contains($this->getFormatedWorkingDir(), $this->ds . $thumb_folder_name);
102102

103103
if (!$in_thumb_folder) {
104104
return $thumb_folder_name . $this->ds;

0 commit comments

Comments
 (0)