Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image editor fixes - crop, resize, filter plugins #1489

Merged
merged 11 commits into from
Aug 21, 2023
Merged
2 changes: 1 addition & 1 deletion htdocs/include/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,7 @@ function icms_random_str($numchar){
$letras = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,x,w,y,z,1,2,3,4,5,6,7,8,9,0";
$array = explode(",", $letras);
shuffle($array);
$senha = implode($array, "");
$senha = implode($array);
return substr($senha, 0, $numchar);
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/libraries/image-editor/image-edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
if (!empty($op) && $op == 'cancel') {
/* make sure the file is in the temp folder and prevent arbitrary deletes of any file */
$valid_path = ICMS_IMANAGER_FOLDER_PATH . '/temp';
if (!empty($image_path) && strncmp(realpath($image_path), strlen($valid_path)) == 0) {
if (!empty($image_path) && strncmp(realpath($image_path), $image_path, strlen($valid_path)) == 0) {
$image_path = realpath($image_path);
} else {
$image_path = NULL;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/libraries/image-editor/plugins/crop/crop_image.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/* prevent remote file inclusion */
$valid_path = ICMS_IMANAGER_FOLDER_PATH . '/temp';
if (!empty($image_path) && strncmp(realpath($image_path), strlen($valid_path)) == 0) {
if (!empty($image_path) && strncmp(realpath($image_path), $image_path, strlen($valid_path)) == 0) {
$image_path = realpath($image_path);
} else {
$image_path = null;
Expand Down
Loading