Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

+4 -12
View File
@@ -69,7 +69,7 @@ class _Hook extends \IPS\Patterns\ActiveRecord
) ) );
$form->add( new \IPS\Helpers\Form\Text( 'plugin_hook_class', NULL, FALSE, array(), function( $val )
{
if ( $val and !@class_exists( 'IPS\\' . $val ) )
if ( $val and !class_exists( 'IPS\\' . $val ) )
{
throw new \DomainException('plugin_hook_class_err');
}
@@ -192,29 +192,21 @@ class _Hook extends \IPS\Patterns\ActiveRecord
{
if ( $row['plugin'] )
{
$hooks[ $row['class'] ][ $row['id'] ] = array(
$hooks[ trim( $row['class'] ) ][ $row['id'] ] = array(
'file' => "plugins/{$row['plugin_location']}/hooks/{$row['filename']}.php",
'class' => "hook{$row['id']}",
);
}
else
{
$hooks[ $row['class'] ][ $row['id'] ] = array(
$hooks[ trim( $row['class'] ) ][ $row['id'] ] = array(
'file' => "applications/{$row['app']}/hooks/{$row['filename']}.php",
'class' => $row['app'] . '_hook_' . $row['filename'],
);
}
}
$json = json_encode( $hooks );
$encrypted = '';
$time = date( 'jny' );
for ( $i = 0; $i < \strlen( $json ); $i++ )
{
$encrypted .= chr( ord( \substr( $json, $i, 1 ) ) + \substr( $time, ( $i % \strlen( $time ) ) - 1, 1 ) );
}
\file_put_contents( \IPS\ROOT_PATH . '/plugins/hooks.txt', $encrypted );
\file_put_contents( \IPS\ROOT_PATH . '/plugins/hooks.php', "<?php\nreturn " . var_export( $hooks, TRUE ) . ';' );
}
/**