- Added comprehensive AI Assistant system (aiassist/ directory): * Vector search and embedding capabilities * Typebot proxy integration * Elastic search functionality * Message classification and chat history * MCP proxy for external integrations - Implemented Court Status API (GetCourtStatus.php): * Real-time court document status checking * Integration with external court systems * Comprehensive error handling and logging - Enhanced S3 integration: * Improved file backup system with metadata * Batch processing capabilities * Enhanced error logging and recovery * Copy operations with URL fixing - Added Telegram contact creation API - Improved error logging across all modules - Enhanced callback system for AI responses - Extensive backup file storage with timestamps - Updated documentation and README files - File storage improvements: * Thousands of backup files with proper metadata * Fix operations for broken file references * Project-specific backup and recovery systems * Comprehensive file integrity checking Total: 26,461+ files added/modified including AWS SDK, vendor dependencies, and extensive backup system.
43 lines
1.5 KiB
PHP
43 lines
1.5 KiB
PHP
<?php
|
|
|
|
class HTMLPurifier_Injector_RemoveEmpty extends HTMLPurifier_Injector
|
|
{
|
|
|
|
private $context, $config;
|
|
|
|
public function prepare($config, $context) {
|
|
parent::prepare($config, $context);
|
|
$this->config = $config;
|
|
$this->context = $context;
|
|
$this->attrValidator = new HTMLPurifier_AttrValidator();
|
|
}
|
|
|
|
public function handleElement(&$token) {
|
|
if (!$token instanceof HTMLPurifier_Token_Start) return;
|
|
$next = false;
|
|
for ($i = $this->inputIndex + 1, $c = count($this->inputTokens); $i < $c; $i++) {
|
|
$next = $this->inputTokens[$i];
|
|
if ($next instanceof HTMLPurifier_Token_Text && $next->is_whitespace) continue;
|
|
break;
|
|
}
|
|
if (!$next || ($next instanceof HTMLPurifier_Token_End && $next->name == $token->name)) {
|
|
if ($token->name == 'colgroup') return;
|
|
$this->attrValidator->validateToken($token, $this->config, $this->context);
|
|
$token->armor['ValidateAttributes'] = true;
|
|
if (isset($token->attr['id']) || isset($token->attr['name'])) return;
|
|
$token = $i - $this->inputIndex + 1;
|
|
for ($b = $this->inputIndex - 1; $b > 0; $b--) {
|
|
$prev = $this->inputTokens[$b];
|
|
if ($prev instanceof HTMLPurifier_Token_Text && $prev->is_whitespace) continue;
|
|
break;
|
|
}
|
|
// This is safe because we removed the token that triggered this.
|
|
$this->rewind($b - 1);
|
|
return;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
// vim: et sw=4 sts=4
|