Skip to content

Commit

Permalink
Fix deprecated functionality: trim(): passing null to parameter #1 ($…
Browse files Browse the repository at this point in the history
…string) of type string is deprecated
  • Loading branch information
luigifab committed Oct 14, 2021
1 parent 1e8f87f commit f25c406
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/code/core/Mage/Core/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ public function getGroupedClassName($groupType, $classId, $groupRootNode = null)
*/
public function getBlockClassName($blockType)
{
if (strpos($blockType, '/')===false) {
if (strpos($blockType, '/') === false) {
return $blockType;
}
return $this->getGroupedClassName('block', $blockType);
Expand Down Expand Up @@ -1365,11 +1365,10 @@ public function getResourceHelper($moduleName)
*/
public function getModelClassName($modelClass)
{
$modelClass = trim($modelClass);
if (strpos($modelClass, '/')===false) {
if (empty($modelClass) || (strpos($modelClass, '/') === false)) {
return $modelClass;
}
return $this->getGroupedClassName('model', $modelClass);
return $this->getGroupedClassName('model', trim($modelClass));
}

/**
Expand Down

0 comments on commit f25c406

Please sign in to comment.