Журнал изменений

Журнал изменений

Фильтр и поиск

Всего: 1347 Доступных коммитов | Отфильтровано: 1347 Коммиты | Страница: 116 из 135
17.02.2026
Test: Improve language and security validation tests
Автор: Eduard Laas | Дата: 21:38 17.02.2026

Add unused constants detection to PHPUnit, fix token analysis bug in security test, and remove standalone script replaced by the new test.

Core changes:

  1. Unused constants test (tests/LanguageValidationTest.php):
  • Add testNoUnusedConstants() that dynamically discovers all ru.php files
  • Scans entire codebase (core, admin, modules, blocks, templates, setup)
  • Excludes language directories from search to avoid self-matches
  • Reports file path and constant name for each unused definition
  1. Security test fix (tests/SecurityValidationTest.php):
  • Fix testNoIncludesInsideFunctions() token analysis bug
  • T_WHITESPACE between T_FUNCTION and function name was resetting nextIsFuncName flag, causing all include/require detections to fail
  • Skip whitespace and comment tokens in the flag reset condition
  1. Removed standalone script (tests/check_constants.php):
  • Functionality fully covered by new PHPUnit testNoUnusedConstants()
  • PHPUnit test is broader: checks all module language files automatically

Benefits:

  • Automated detection of dead language constants in CI pipeline
  • Security test now correctly identifies include/require inside functions
  • Single test runner (PHPUnit) for all validation checks
Refactor: Sync language constants across all translations
Автор: Eduard Laas | Дата: 21:34 17.02.2026

Add missing SEO constants to non-Russian admin language files and remove unused constants detected by the new automated validation test.

Core changes:

  1. Added missing constants (admin/language/{en,de,fr,pl,uk}.php):
  • _TSEP: Title separator for SEO URLs
  • _SEOTITLE: Add title toggle label
  • _SEOCTITLE: Add category title toggle label
  1. Removed unused _A_LINKS_LOGO (modules/auto_links/language/):
  • Constant not referenced anywhere in application code
  • Removed from all 6 language files (ru, en, de, fr, pl, uk)
  1. Removed unused _CSIZE (modules/clients/):
  • Removed from admin/language/ (6 files) and language/ (6 files)
  • Total: 12 files cleaned
  1. Removed unused _NEW_LINKS (modules/links/language/):
  • Removed from all 6 language files

Benefits:

  • All languages have complete set of admin SEO constants
  • No dead constants cluttering language files
  • Automated test now passes for constant usage validation
Fix: Prevent double-encoding of template fields and update URLs to HTTPS
Автор: Eduard Laas | Дата: 21:34 17.02.2026

Fix config save function that double-encoded HTML in graph, schema, and mtemp fields through save_text() when admin editor was enabled.

Core changes:

  1. Config save function (admin/modules/config.php):
  • Switch graph, schema, mtemp fields from 'text' to 'raw' type in getVar()
  • Remove unnecessary preg_replace for <br> tag stripping
  • Prevents save_text() from applying htmlspecialchars() to already-encoded HTML
  1. Global config (config/global.php):
  • Update Schema.org context URLs from http to https
  • Store raw quotes in graph/schema templates instead of HTML entities
  • Alphabetical key reordering, add tsep separator setting
  • Update slogan text
  1. Directory index (config/index.html):

Benefits:

  • Eliminates progressive corruption of template fields on each save
  • Correct HTML output for OG meta tags and JSON-LD schema
  • HTTPS everywhere for external URLs

Technical notes:

  • Fields with 'raw' type bypass save_text() processing entirely
  • Output in core/system.php uses str_replace() on raw values, no encoding needed
Fix: Update admin blocks routing to unified URL scheme
Автор: Eduard Laas | Дата: 21:33 17.02.2026

Align block management URLs with the standard module routing convention used across the admin panel (name=blocks&op=action&id=N).

Core changes:

  1. Block toggle function (admin/modules/blocks.php):
  • Rename parameter 'bid' to 'id' for consistency with other modules
  • Update SQL binding to match new parameter name
  1. Block listing URLs (core/admin.php):
  • Change action URLs from legacy format (op=blocks_change&bid=) to unified format (name=blocks&op=change&id=)
  • Update edit and delete links to match new routing scheme

Benefits:

  • Consistent URL scheme across all admin modules
  • Eliminates legacy routing format for block management
Chore: Remove deprecated Flash radio plugin and IPB forum block
Автор: Eduard Laas | Дата: 21:33 17.02.2026

Remove legacy blocks and plugins that depend on obsolete technologies (Flash SWF player, IPB forum integration) no longer supported by modern browsers.

Core changes:

  1. Removed blocks (blocks/):
  • block-radio.php: Flash-based SWF radio player block
  • block-ipb_center_forum.php: IPB forum integration block with raw SQL
  1. Removed radio plugin (plugins/radio/):
  • mju.swf: Flash player binary
  • playlist.mpl: Radio station playlist with dead stream URLs
  • radio.html: Popup window for radio player
  • index.html: Directory index redirect

Benefits:

  • Reduces attack surface (raw SQL in IPB block, Flash vulnerabilities)
  • Removes dead code depending on discontinued technologies
  • Cleaner project structure without obsolete third-party integrations
Refactor: Replace getHref() with getSeoUrl() across all modules
Автор: Eduard Laas | Дата: 15:23 17.02.2026

Migrate all 98 getHref() calls in 16 files to the new getSeoUrl() with named parameters. Remove getHref() (75 lines dead code), getUrlMeta() and its dead callers from core. Delete unused config_seo.php.

Test: Add unused language constants checker script
Автор: Eduard Laas | Дата: 14:12 17.02.2026

Utility script to detect define() constants in language files that are not referenced anywhere in the codebase.

  1. Checker (tests/check_constants.php):
  • Parses all define() constants from a given language file
  • Searches core, admin, modules, blocks, templates, setup directories
  • Reports unused constants with line numbers and values
  • Usage: php tests/check_constants.php [language_file]
Refactor: Remove meta keywords and migrate OG/Schema to admin config
Автор: Eduard Laas | Дата: 14:12 17.02.2026

Meta keywords have been ignored by search engines since 2009. This commit removes the entire keyword system and migrates Open Graph / Schema.org settings from static $confse to admin-managed $conf.

Core changes:

  1. Keyword removal (config/global.php, config_seo.php, config.php):
  • Remove 7 config keys: keys, dkeys, kwords, kletter, kmix, ksep, akeys
  • Remove keyword form fields and save handlers from admin UI
  • Delete 3 block files: block-keywords*.php
  1. Keyword removal (core/system.php, core/user.php):
  • Remove keyword auto-generation in getHref()
  • Remove <meta name="keywords"> output from head()
  • Remove <Tags> from OpenSearch XML
  1. OG/Schema migration (config/global.php, admin/modules/config.php):
  • Move agraph, graph, aschema, schema from $confse to $conf
  • Add admin UI fields for Open Graph and Schema.org templates
  1. Safety fix (core/system.php):
  • Add is_user() guard for $uid = intval($user[0])
  1. Language cleanup (admin/language/, language/):
  • Remove 12 keyword constants from 6 admin language files
  • Remove 7 unused constants from admin language files
  • Remove 15 unused constants from 6 frontend language files

Benefits:

  • Cleaner codebase without dead keyword functionality
  • OG/Schema templates editable from admin panel
  • No more undefined variable warnings

Technical notes:

  • $kprotect in save() retained (used for bots, css_f, script_f)
  • getUrlMeta() already deactivated, no DB changes needed
  • config/config_seo.php cleaned but kept for remaining OG/Schema defaults
Refactor: Optimize img_find() and clean up SEO config
Автор: Eduard Laas | Дата: 11:08 17.02.2026

Simplify img_find() by removing global $theme side-effect and adding static cache. Comment out SEO settings now managed via admin panel.

Core changes:

  1. img_find() optimization (core/system.php):
  • Remove global $theme variable manipulation
  • Add static $base cache for theme image path
    • getTheme() called once per request instead of every invocation
    • Preserves per-user/admin theme resolution via getTheme()
  1. SEO config cleanup (config/config_seo.php):
  • Comment out $confse['adesc'] and $confse['dletter']
    • Values now managed through admin interface via $conf

Benefits:

  • Cleaner img_find() without global state side-effects
  • Single source of truth for SEO settings in admin panel
Fix: Address PHP runtime errors and add HTTP error page handling
Автор: Eduard Laas | Дата: 11:05 17.02.2026

Resolve multiple PHP 8.x warnings from error logs and ensure HTTP errors (404/400) terminate with a clean SLAED error page instead of continuing execution and feeding crawler traps.

Core changes:

  1. Null-safety for $conff access (templates/lite/index.php):
  • Add !empty($conff) guard before accessing $conff['defis']
    • Prevents "array offset on null" when files module not loaded
  1. Fallback for unknown file types (core/system.php):
  • Add null coalescing for $conftp[$type] in encode_attach()
    • Handles .mid/.avi and other unmapped extensions gracefully
  1. Fix fields_in() globals (core/system.php):
  • Replace require_once with global $conffi declaration
    • Config already loaded; avoids redundant include
  1. HTTP error handling (core/security.php):
  • Call setExit() after logging HTTP errors to terminate request
  • Use $conf['theme'] for logo path in setExit() instead of img_find()
    • img_find()/getTheme() not available during early boot

Benefits:

  • Eliminates ~290 PHP warnings per day from bot traffic
  • Stops crawler trap caused by bots following links on error pages
  • Clean exit page with logo and auto-redirect for HTTP errors
Хотите опробовать SLAED CMS в действии?
Идеи и предложения
Обратная связь
Подтверждение

Поделиться
QR-код

Предварительный просмотр