Skip to content

Commit 0fdb093

Browse files
committed
fixed problems with empy strings
1 parent cad2069 commit 0fdb093

2 files changed

Lines changed: 30 additions & 6 deletions

File tree

class/Files/CreateArchitecture.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ public function setBaseFoldersFiles($module): void
160160
\copy($copyFile, $copyNewFile);
161161
} else {
162162
// Copy file
163+
if (!\file_exists($logoPng)) {
164+
$logoPng = 'tdmxoops_logo.png';
165+
$logoGifFrom = TDMC_UPLOAD_IMGMOD_PATH . '/' . $logoPng;
166+
}
163167
$copyFile = TDMC_IMAGES_LOGOS_URL . '/' . $logoPng;
164168
$copyNewFile = $logoGifFrom;
165169
\copy($copyFile, $copyNewFile);

class/Files/CreateFile.php

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,11 @@ public function getLanguage($moduleDirname, $prefix = '', $suffix = '', $addFq =
329329
*/
330330
public function getLeftString($string)
331331
{
332-
return \mb_substr($string, 0, (int)\mb_strpos($string, '_'));
332+
$ret = '';
333+
if ('' != $string) {
334+
$ret .= \mb_substr($string, 0, (int)\mb_strpos($string, '_'));
335+
}
336+
return $ret;
333337
}
334338

335339
/**
@@ -340,7 +344,7 @@ public function getLeftString($string)
340344
*/
341345
public function getRightString($string = null)
342346
{
343-
if ('' != \trim($string)) {
347+
if ('' != $string) {
344348
if (\mb_strpos($string, '_')) {
345349
$str = \mb_strpos($string, '_');
346350
if (false !== $str) {
@@ -384,7 +388,11 @@ public function getCamelCase($string, $ucfirst = false, $lcfirst = false)
384388
*/
385389
public function getUcfirst($string)
386390
{
387-
return \ucfirst($string);
391+
$ret = '';
392+
if ('' != $string) {
393+
$ret .= \ucfirst($string);
394+
}
395+
return $ret;
388396
}
389397

390398
/**
@@ -395,7 +403,11 @@ public function getUcfirst($string)
395403
*/
396404
public function getLcfirst($string)
397405
{
398-
return \lcfirst($string);
406+
$ret = '';
407+
if ('' != $string) {
408+
$ret .= \lcfirst($string);
409+
}
410+
return $ret;
399411
}
400412

401413
/**
@@ -406,7 +418,11 @@ public function getLcfirst($string)
406418
*/
407419
public function getStrToUpper($string)
408420
{
409-
return \mb_strtoupper($string);
421+
$ret = '';
422+
if ('' != $string) {
423+
$ret .= \mb_strtoupper($string);
424+
}
425+
return $ret;
410426
}
411427

412428
/**
@@ -417,7 +433,11 @@ public function getStrToUpper($string)
417433
*/
418434
public function getStrToLower($string)
419435
{
420-
return \mb_strtolower($string);
436+
$ret = '';
437+
if ('' != $string) {
438+
$ret .= \mb_strtolower($string);
439+
}
440+
return $ret;
421441
}
422442

423443
/**

0 commit comments

Comments
 (0)