<?xml version="1.0" encoding="UTF-8"?>
<plugin name="Babble Mb String Split Fix" version_long="10000" version_human="1.0.0" author="" website="" update_check=""><hooks><hook type="C" class="\IPS\babble\Application" filename="application"><![CDATA[//<?php

/* To prevent PHP errors (extending class does not exist) revealing path */

use IPS\Http\Url;
use IPS\Settings;

if ( !\defined('\IPS\SUITE_UNIQUE_KEY' ) )
{
	exit;
}

class hook183 extends _HOOK_CLASS_
{

    public static function siteKey(): string
    {
	try
	{
	        if (\IPS\babble\Settings::$service === true) {
	            $license = explode('-', trim(Settings::i()->babble_settings_license_key));
	            $toCount = array_shift($license );
	            if( mb_strlen( $toCount ) === 7 ){
	                $site = str_replace( ['http://', 'https://'], '', rtrim(Url::baseUrl(),'/'));
	                $key = implode( '-',str_split(sha1( $site),7));
	                return sha1( trim($key));
	            }
	            return sha1(trim(Settings::i()->babble_settings_license_key));
	        }
	
	        return sha1(Url::baseUrl());
	}
	catch ( \RuntimeException $e )
	{
		if ( method_exists( get_parent_class(), __FUNCTION__ ) )
		{
			return \call_user_func_array( 'parent::' . __FUNCTION__, \func_get_args() );
		}
		else
		{
			throw $e;
		}
	}
    }
}
]]></hook></hooks><htmlFiles/><cssFiles/><jsFiles/><resourcesFiles/><lang/><versions><version long="10000" human="1.0.0"><![CDATA[//<?php


/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * Install Code
 */
class ips_plugins_setup_install
{
	/**
	 * ...
	 *
	 * @return	array	If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
	 */
	public function step1()
	{
		

		return TRUE;
	}
	
	// You can create as many additional methods (step2, step3, etc.) as is necessary.
	// Each step will be executed in a new HTTP request
}]]></version></versions></plugin>
