Skip to content

Commit

Permalink
Merge branch 'master' of github.com:freescout-helpdesk/freescout into…
Browse files Browse the repository at this point in the history
… dist
  • Loading branch information
freescout-help-desk committed Feb 28, 2025
2 parents b8f82a1 + 5e56a47 commit 31c72b8
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/FetchEmails.php
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ public function separateReply($body, $is_html, $is_reply, $user_reply_to_notific
libxml_use_internal_errors(true);
//$dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
//$dom->loadHTML(\Helper::mbConvertEncodingHtmlEntities($html));
$dom->loadHTML(\Symfony\Polyfill\Mbstring\Mbstring::mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
$dom->loadHTML(\Symfony\Polyfill\Mbstring\Mbstring::mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8') ?: $html);
libxml_use_internal_errors(false);
$bodies = $dom->getElementsByTagName('body');
if ($bodies->length == 1) {
Expand Down
12 changes: 9 additions & 3 deletions app/Http/Controllers/ModulesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,16 @@ public function modules(Request $request)

if (empty($latest_version)) {
continue;
} else {
// Get the current version of the module
$current_version = $module['version'];
}

// If it is the module.json file - try to parse the body.
preg_match('#"version":[^"]*"([\d\.]+)"#', $latest_version, $m);
if (!empty($m[1])) {
$latest_version = $m[1];
}

// Get the current version of the module
$current_version = $module['version'];
} catch (\Exception $e) {
// If there's an exception, skip to the next iteration
continue;
Expand Down
13 changes: 12 additions & 1 deletion app/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,12 @@ private static function updateFromUrl($module, $url, $result)
} else {
// Extract.
try {
$module_path = $module->getPath();

// Sometimes by some reason Public folder becomes a symlink leading to itself.
// It causes an error during updating process.
// https://github.com/freescout-helpdesk/freescout/issues/2709
$public_folder = $module->getPath() . DIRECTORY_SEPARATOR . 'Public';
$public_folder = $module_path.DIRECTORY_SEPARATOR.'Public';
try {
if (is_link($public_folder)) {
unlink($public_folder);
Expand All @@ -508,6 +510,15 @@ private static function updateFromUrl($module, $url, $result)
}

\Helper::unzip($module_archive, \Module::getPath());

// Rename the folder if the archive has been downloaded from GitHub:
// SomeModule-master >> SomeModule.
// https://github.com/freescout-help-desk/freescout/issues/4611
$basename = basename($url, '.zip');

if (file_exists($module_path.'-'.$basename)) {
\File::moveDirectory($module_path.'-'.$basename, $module_path, true);
}
} catch (\Exception $e) {
$result['msg'] = $e->getMessage();
}
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
| or any other location as required by the application or its packages.
*/

'version' => '1.8.172',
'version' => '1.8.173',

/*
|--------------------------------------------------------------------------
Expand Down
18 changes: 7 additions & 11 deletions public/js/summernote/summernote.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions resources/views/customers/profile_snippet.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
@php
$location = array_filter([$customer->city, $customer->state, $customer->getCountryName()]);
@endphp
@if ($customer->company || $customer->job_title || $location || $customer->address)
@if ($customer->company || $customer->job_title || $location || $customer->address || $customer->zip)
<div class="customer-section">
@if ($customer->company)<div>{{ $customer->company }}</div>@endif
@if ($customer->job_title)<div>{{ $customer->job_title }}</div>@endif
@if ($location)<div>{{ implode(', ', $location) }}</div>@endif
@if ($customer->address)<div>{{ $customer->address }}</div>@endif
@if ($customer->address || $customer->zip)<div>{{ $customer->address }}@if ($customer->address && $customer->zip), @endif{{ $customer->zip }}</div>@endif
</div>
@endif
@if ($customer->notes)
Expand Down

0 comments on commit 31c72b8

Please sign in to comment.