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

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

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

Всего: 1045 Доступных коммитов | Отфильтровано: 1045 Коммиты | Страница: 85 / 105
19.02.2026
Refactor: Modernize setConfigFile() to return-array format
Автор: Eduard Laas | Дата: 09:57 19.02.2026

Remove legacy variable-assignment format and update all callers. The function now writes config files in the modern return [...] format compatible with getConfig() which uses require $file.

Core changes:

  1. setConfigFile() (core/system.php, setup/index.php):
  2. Signature simplified: removed $name and $type parameters
  3. Output format changed from $name = var_export(...) to return var_export(...)
  4. Guard if (!defined(...)) die(...) removed (no longer needed)
  5. Wrapping logic added: global.php → flat array, others → [$key => $arr]
  6. setup/index.php copy also modernized to match core version
  7. All 30 callers updated (20 files):
  8. Removed 2nd string argument (variable name like 'conf', 'confmd')
  9. Removed 5th empty string argument where present
  10. PHP warnings fixed (core/system.php, core/user.php):
  11. rss_select(): added global $confrs
  12. bb_decode(): preg_replace null guard added (?? '')
  13. user.php: $cid undefined key, $fstatus, user variables

Benefits:

  • Config writes now produce files readable by getConfig()
  • Saved admin settings no longer break the entire CMS
  • Cleaner API without semantic-free string parameters

Technical notes:

  • Wrapping: pathinfo(basename($fp), PATHINFO_FILENAME) determines key
  • global.php → flat merge into $conf; all others → keyed sub-array
  • Both system.php and setup/index.php versions kept in sync
18.02.2026
Refactor: Replace \$prefix with PREFIX_DB constant in core/admin.php and core/user.php
Автор: Eduard Laas | Дата: 21:57 18.02.2026

Replaces direct usage of the global \$prefix variable with the PREFIX_DB constant defined in core/security.php. This eliminates the need to declare \$prefix in every function's global list and makes DB table references explicit.

Core changes:

  1. core/admin.php:
  2. All SQL queries: \$prefix."_table" → PREFIX_DB."_table"
  3. Removed \$prefix from global declarations in affected functions
  4. Applies to admininfo(), fav_aliste(), fav_adel(), ajax_privat() and others
  5. core/user.php:
  6. All SQL queries: \$prefix."_table" → PREFIX_DB."_table"
  7. Removed \$prefix from global declarations in affected functions
  8. Consistent with the modernization pattern applied to admin/modules/

Benefits:

  • Fewer global declarations per function (cleaner signatures)
  • Consistent with admin modules already using PREFIX_DB
  • Eliminates risk of \$prefix being unset in a function scope

Technical notes:

  • PREFIX_DB defined as: define('PREFIX_DB', \$conf['db']['prefix']) in core/security.php
  • Backward compat: \$prefix alias still set for not-yet-modernized modules
Fix: Remove direct config requires from modernized module files
Автор: Eduard Laas | Дата: 21:56 18.02.2026

Modernized modules (changelog, rss, sitemap, account) were still loading config files directly via require_once/include. Since config files now return arrays instead of setting globals, these calls no longer populated the expected \$confX variables. Replace each with a direct \$conf read.

Core changes:

  1. modules/changelog/index.php and changelog/admin/index.php:
  2. Removed: require_once CONFIG_DIR.'/changelog.php'
  3. Added: \$conflog = \$conf['changelog'] ?? []
  4. modules/rss/index.php and rss/admin/index.php:
  5. Removed: require_once CONFIG_DIR.'/rss.php'
  6. Added: \$confrs = \$conf['rss'] ?? []
  7. modules/sitemap/admin/index.php:
  8. Removed: require_once CONFIG_DIR.'/sitemap.php'
  9. Added: \$confma = \$conf['sitemap'] ?? []
  10. modules/account/index.php:
  11. Removed: include('config/config_news.php') and require_once .../rss.php
  12. Added: \$confn = \$conf['news'] ?? [] and \$confrs = \$conf['rss'] ?? []
  13. modules/account/admin/index.php:
  14. Removed: require_once CONFIG_DIR.'/config_news.php' (inside add() function)
  15. Added: \$confn = \$conf['news'] ?? [] (using already-declared global \$conf)

Benefits:

  • Eliminates TypeError: chlogRenderCommits() argument #2 must be array, null given
  • Config data now comes from the single authoritative \$conf source
  • Consistent with the new architecture: no direct config file reads in modules

Technical notes:

  • Un-modernized modules are covered by transition aliases in core/security.php
  • include('config/config_X.php') in old modules are now silent no-ops
Refactor: Add module config transition aliases to core/security.php
Автор: Eduard Laas | Дата: 21:56 18.02.2026

Extends the existing transition alias block to cover all module-specific config variables. This allows not-yet-modernized modules to keep using their legacy \$confX globals while the config files now return arrays instead of setting globals as side effects.

Core changes:

  1. Transition aliases (core/security.php):
  2. Added 17 new module aliases to the existing block:

    • \$confn / \$conffa / \$conff / \$confw / \$confal / \$confl (news, faq, files, whois, auto_links, links)
    • \$confj / \$conffo / \$confh / \$confp / \$confso / \$confm (jokes, forum, help, pages, shop, media)
    • \$confmo / \$confor / \$confco / \$confcn (money, order, contact, content)
    • \$confma / \$conflog (sitemap, changelog)
  3. All set at global scope once at startup via \$conf['namespace'] ?? []

Benefits:

  • 33 not-yet-modernized modules continue working without changes
  • include('config/config_X.php') calls in old modules become harmless no-ops
  • Single authoritative source: all values come from \$conf loaded by getConfig()
  • Enables gradual per-module migration without big-bang changes

Technical notes:

  • Aliases are temporary; remove after full migration to \$conf['namespace']
  • content module uses \$confcn (not \$confn) to avoid collision with news
  • Changelog and RSS admin modules set their alias locally (redundant, harmless)
Refactor: Convert all config/ files to return array format
Автор: Eduard Laas | Дата: 21:56 18.02.2026

Converts the entire config/ directory to the new unified architecture. Every data config file now returns ['namespace' => [...]] so getConfig() can safely merge them all into a single \$conf array without side effects.

Core changes:

  1. Legacy config files (config/config_*.php — 25 files):
  2. All converted from \$confX = array(...) assignments to return ['key' => [...]]
  3. Dangerous files set to return null (getConfig() skips null values safely):

    • config_global.php: was overwriting \$conf in getConfig() function scope
    • config_header.php: was executing echo during config load
    • config_comments.php, config_users.php, config_templ.php: superseded
    • config_chmod.php, system.php: empty files
  4. Active config files (config/comments.php, users.php, fields.php, etc.):
  5. Converted to return ['namespace' => [...]] format
  6. Heredoc strings preserved where needed (filetype.php, config_contact.php, etc.)
  7. Integer values kept as integers (sitemap.auto_t = 86400, not '86400')
  8. New file: config/local.php
  9. Template for server-specific overrides (DB credentials, dev_mode, etc.)
  10. Contains _meta.base_fingerprint placeholder for fingerprint tracking
  11. Only file the system writes to at runtime

Benefits:

  • Zero side effects when loading config files (no global assignments)
  • getConfig() collects all configs in one pass via glob()
  • local.php overrides applied safely via filterConfigMerge()
  • Dangerous files neutralized (return null) instead of deleted

Technical notes:

  • Namespace keys match the module names (news, forum, shop, etc.)
  • Backward compat: transition aliases defined in core/security.php
  • config_rewrite.php and config_rules.php left unchanged (executable code)
Refactor: Add unified config bootstrap to core/system.php
Автор: Eduard Laas | Дата: 21:55 18.02.2026

Replaces scattered per-module config loading with a single, centralized bootstrap system. All config files are now loaded once at startup into a unified \$conf array, eliminating duplicate includes and global variable pollution across modules.

Core changes:

  1. Config loader (core/system.php):
  2. getConfig(): loads all config/*.php via glob(), merges into \$conf

    • Skips local.php (overrides file); applies it separately via filterConfigMerge()
    • Triggers fingerprint update when dev_mode=true and configs have changed
  3. filterConfigMerge(): safe recursive merge — only existing keys, type-matched

    • Prevents adding unknown keys or type mismatches from local.php
  4. getConfigFingerprint(): SHA1 over basename+sha1_file for each default config

    • Including filename in hash detects file additions and removals
  5. checkConfigFingerprint(): convenience wrapper for fingerprint comparison
  6. setConfigFingerprint(): reads local.php as array, updates _meta.base_fingerprint

    • Atomic write: file_put_contents(tmp) + rename(); unlinks tmp on failure
    • var_export output converted to [...] syntax via post-processing regex
    • chmod(0640) only on newly created files

Benefits:

  • Single load point eliminates N redundant file includes per request
  • Fingerprint mechanism enables safe dev-mode config tracking
  • filterConfigMerge prevents accidental key injection from local.php
  • Atomic write prevents corrupt local.php on server crash

Technical notes:

  • config/local.php is the only writable runtime config file
  • dev_mode=true enables auto-update of local.php fingerprint
  • All config files must return ['namespace' => [...]] or null
  • Backward compat: old \$confX globals set as aliases in core/security.php
Feature: Add localized OG/Schema constants to admin config
Автор: Eduard Laas | Дата: 15:24 18.02.2026

Replace hardcoded Open Graph and Schema.org strings in the SEO settings panel with language constants across all 6 supported languages (ru, en, de, fr, pl, uk).

Core changes:

  1. Admin language files (admin/language/*.php):
  2. Add _OGRAPH - Open Graph toggle label

    • Identical in all languages (technical term)
  3. Add _OGRAPHT - Open Graph template field label

    • Translated per language
  4. Add _SCHEMA - Schema.org toggle label

    • Identical in all languages (technical term)
  5. Add _SCHEMAT - Schema.org template field label

    • Translated per language
  6. Add _TPLVARS - Template variables reference with descriptions

    • Format: <b>[var]</b> - Description (matches existing _TPINFO style)
    • Each variable on its own line via <br>
    • Fully translated descriptions per language
  7. Admin config module (admin/modules/config.php):
  8. Replace 4 hardcoded strings with constants _OGRAPH, _OGRAPHT, _SCHEMA, _SCHEMAT

  9. Replace hardcoded variable list with _TPLVARS in both OG and Schema.org template fields

Benefits:

  • Admin panel now fully translatable for OG/Schema section
  • Variable descriptions visible to admin with bold formatting
  • Consistent style with existing _TPINFO constant pattern
  • Zero hardcoded strings remaining in SEO config section

Technical notes:

  • _TPLVARS uses HTML (<b>, <br>) consistent with _TPINFO
  • HTML5 <br> used (not XHTML <br/>)
  • Constants appended after _SEOCTITLE group in each language file
Fix: Resolve PHP warnings and deprecated notices from error log
Автор: Eduard Laas | Дата: 09:47 18.02.2026

Addresses 6 distinct errors found in config/logs/error.txt (17.02.2026). All fixes eliminate PHP 8.x warnings without changing business logic.

Core changes:

  1. engines_word() (core/system.php):
  2. Add null coalescing for missing query key in parse_url() result

    • Fixes 116 log entries: Undefined key "query" + parse_str(null)
    • Triggered by referer URLs without query string
  3. checkFileChmod() (core/system.php):
  4. Create test file before chmod attempt, delete after test

    • config/chmod.php is a temporary test file, must be created first
    • Prevents chmod(): No such file or directory warning
  5. head() session cleanup (core/system.php):
  6. Guard unlink(sess.txt) with file_exists() check

    • Prevents unlink warning when file was never created
  7. create_dump() (core/system.php):
  8. Add is_readable() check before md5_file()

    • Skips files with permission denied (e.g. .htaccess)
  9. bb_decode() (core/system.php):
  10. Cast $sourse to string with null fallback before preg_replace

    • Prevents str_replace(null) deprecation notice
  11. $file initialization (index.php):
  12. Replace undefined $file reference with ?: operator

    • Fixes Undefined variable $file warning on line 39

Benefits:

  • Error log reduced from 120+ entries to 0 for these error types
  • No false warnings masking real errors in production log
  • PHP 8.x deprecation notices eliminated
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):
  2. Add testNoUnusedConstants() that dynamically discovers all ru.php files
  3. Scans entire codebase (core, admin, modules, blocks, templates, setup)
  4. Excludes language directories from search to avoid self-matches
  5. Reports file path and constant name for each unused definition
  6. Security test fix (tests/SecurityValidationTest.php):
  7. Fix testNoIncludesInsideFunctions() token analysis bug
  8. T_WHITESPACE between T_FUNCTION and function name was resetting nextIsFuncName flag, causing all include/require detections to fail

  9. Skip whitespace and comment tokens in the flag reset condition
  10. Removed standalone script (tests/check_constants.php):
  11. Functionality fully covered by new PHPUnit testNoUnusedConstants()
  12. 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):
  2. _TSEP: Title separator for SEO URLs
  3. _SEOTITLE: Add title toggle label
  4. _SEOCTITLE: Add category title toggle label
  5. Removed unused _A_LINKS_LOGO (modules/auto_links/language/):
  6. Constant not referenced anywhere in application code
  7. Removed from all 6 language files (ru, en, de, fr, pl, uk)
  8. Removed unused _CSIZE (modules/clients/):
  9. Removed from admin/language/ (6 files) and language/ (6 files)
  10. Total: 12 files cleaned
  11. Removed unused _NEW_LINKS (modules/links/language/):
  12. 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

Всего: 1045 на 105 страницах по 10 на каждой странице

1 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 105
Хотите опробовать SLAED CMS в действии?
Идеи и предложения
Обратная связь
Подтверждение

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