Skip to content
Permalink
Browse files
[K5.2] Check before install template that are compatible (Part 2)
  • Loading branch information
xillibit committed Dec 22, 2020
1 parent 5b9bc53 commit 13769ab
Showing 1 changed file with 13 additions and 2 deletions.
@@ -145,7 +145,11 @@ public static function parseKunenaInstallFile($path)

$data = new stdClass;
$data->name = (string) $xml->name;
$data->targetversion = (string) $xml->targetversion->attributes()->version;
if ($xml->targetversion->attributes()!==null)
{
$data->targetversion = (string) $xml->targetversion->attributes()->version;
}

$data->type = (string) $xml->attributes()->type;
$data->creationdate = (string) $xml->creationDate;
$data->author = (string) $xml->author;
@@ -193,8 +197,13 @@ public static function parseKunenaInstallFile($path)
* @return boolean
* @since Kunena 5.2
*/
public static function templateIsKunenaCompatible($targetversion)
public static function templateIsKunenaCompatible($targetversion = null)
{
if ($targetversion === null)
{
return true;
}

// Get the Kunena version family (e.g. 5.2)
$kVersion = KunenaForum::version();
$kVersionParts = explode('.', $kVersion);
@@ -215,6 +224,8 @@ public static function templateIsKunenaCompatible($targetversion)
{
return false;
}

return true;
}

/**

0 comments on commit 13769ab

Please sign in to comment.