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

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

Всего: 872 Доступных коммитов | Отфильтровано: 872 Коммиты | Страница: 67 / 88
19.02.2026
Chore: Rename config files and remove obsolete editrewrite editor
Автор: Eduard Laas | Дата: 18:08 19.02.2026

Simplify file names in config/ by dropping the redundant config_ prefix. Remove the editrewrite admin function that was editing the now-deleted config/config_rules.php file.

Core changes:

  1. Config file renames:
  2. config/config_chmod.php → config/chmod.php
  3. config/config_header.php → config/header.php
  4. config/config_rules.php — deleted (no longer used)
  5. Security guard (config/system.php):
  6. Add FUNC_FILE guard to match style of all other config files
  7. Remove duplicate license header (already in repo root)
  8. Reference updates (core/admin.php, admin/modules/editor.php):
  9. end_chmod(): update tdir to 'config/chmod.php'
  10. editheader(): switch to CONFIG_DIR.'/header.php'
  11. htaccess(), robots(): switch to BASE_DIR-prefixed paths
  12. Remove editrewrite() function entirely
  13. Admin navigation (admin/modules/editor.php):
  14. Remove "System Rewrite" tab from editor navigation
  15. Renumber remaining tabs accordingly
  16. Documentation (admin/info/blocks-*.html, 6 languages):
  17. Update all references from config/config_header.php → config/header.php
  18. Tests (tests/ConfigValidationTest.php):
  19. Update required file list: config_global.php → global.php

Benefits:

  • Cleaner, shorter file names consistent with the rest of config/
  • Dead code (editrewrite) removed, reducing surface area
  • All paths now use constants (BASE_DIR, CONFIG_DIR) for portability

Technical notes:

  • config/chmod.php and config/header.php already existed as new files
  • Storage format unchanged; only file names differ
Refactor: Remove _REDAKTOR constant, use _EDITOR
Автор: Eduard Laas | Дата: 18:07 19.02.2026

_REDAKTOR was a legacy alias for _EDITOR. Consolidate all references to a single constant and drop the outdated definition from every language file.

Core changes:

  1. Language files (admin/language/*.php, 6 files):
  2. Remove define("_REDAKTOR", ...) from de, en, fr, pl, ru, uk
  3. Remove define("_EREW", ...) and define("_EREWN", ...) — editor rewrite labels
  4. Remove define("_EINFO3", ...) — rewrite editor info text
  5. Admin config panel (admin/modules/config.php):
  6. Replace _REDAKTOR with _EDITOR in editor-selector label
  7. Editor selector labels (core/system.php):
  8. Remove redundant _EDITOR prefix from option strings in redaktor() (e.g., _EDITOR.' SLAED BB' → 'SLAED BB')

Benefits:

  • Single constant _EDITOR used consistently everywhere
  • Removes dead constants that referenced removed functionality
  • Reduces translation maintenance overhead

Technical notes:

  • _REDAKTOR was functionally identical to _EDITOR
  • admin/modules/admins.php already updated in previous commit
Refactor: Replace \$prefix global with PREFIX_DB constant
Автор: Eduard Laas | Дата: 18:07 19.02.2026

Drop all uses of the legacy \$prefix variable in favour of the PREFIX_DB constant defined in core/security.php. This completes the migration started in earlier commits and removes the last runtime dependency on the dynamic global.

Core changes:

  1. Remove \$prefix assignment (core/security.php):
  2. Delete the \$prefix = \$conf['db']['prefix'] line
  3. PREFIX_DB constant was already defined; variable was redundant
  4. All blocks (blocks/block-*.php, 15 files):
  5. Remove \$prefix from global declarations
  6. Replace ".$prefix."_table with ".PREFIX_DB."_table in all queries
  7. All front-end modules (modules/*/index.php, 24 files):
  8. Remove \$prefix from function global declarations
  9. Replace \$prefix in every SQL query string
  10. All admin modules (admin/index.php, admin/modules/.php, modules//admin/index.php):
  11. Same substitution as front-end modules
  12. Templates (templates/admin/index.php, templates/lite/index.php, templates/lite/0index.php):
  13. Remove \$prefix from global declarations
  14. Replace \$prefix in SQL queries

Benefits:

  • Single source of truth: PREFIX_DB constant eliminates accidental overrides
  • Consistent style across the entire codebase
  • Prepares for full removal of legacy globals

Technical notes:

  • No behaviour change; queries produce identical SQL
  • Backward-compatible: PREFIX_DB was already defined before any query runs
Fix: Security and code quality improvements
Автор: Eduard Laas | Дата: 14:19 19.02.2026

Harden .htaccess and fix string quoting in setConfigFile().

Core changes:

  1. .htaccess:
  2. Added Options -Indexes (prevent directory listing)
  3. Added RewriteRule ^config/ [F,L] (block config access)
  4. Added RewriteRule ^setup/ [F,L] (block installer access)
  5. Split commented deflate/expires into separate IfModule blocks
  6. setConfigFile() (core/system.php, setup/index.php):
  7. Replaced double-quoted "\n" with PHP_EOL and single quotes
  8. '['.PHP_EOL and ','.PHP_EOL consistent with rest of function

Benefits:

  • config/ directory with DB credentials no longer web-accessible
  • setup/ installer blocked after initial setup
  • Directory listing disabled sitewide
  • String quoting consistent with Rule 17 (single quotes)
Style: Fix variable names in setConfigFile() per Rule 6
Автор: Eduard Laas | Дата: 11:02 19.02.2026

Rename single-letter and over-length variables to comply with SLAED coding rules (Rule 6: prefer 4-8 chars, no camelCase).

Core changes:

  1. setConfigFile() (core/system.php, setup/index.php):
  2. \$normalize (9 chars) → \$norm
  3. \$exp closure: \$a→\$arr, \$d→\$dep, \$p→\$pad, \$i→\$ind, \$s→\$out
  4. Loop vars: \$k→\$key, \$v→\$val throughout the function

Benefits:

  • Compliant with Rule 6 (4-8 char variable names)
  • No functional changes
Feature: Add dev_mode toggle to admin config panel
Автор: Eduard Laas | Дата: 10:30 19.02.2026

Expose the existing dev_mode flag in the admin interface so it can be toggled without manually editing config files or local.php.

Core changes:

  1. admin/modules/config.php:
  2. Added radio_form row for dev_mode (after site close toggle)
  3. Added 'dev_mode' => getVar('post', 'dev_mode', 'num') to save \$cont
  4. admin/language/*.php (6 files):
  5. Added _DEVMODE constant after _DEAKTIVE (alphabetical order) ru: «Режим разработки» en: «Developer Mode» de: «Entwicklermodus» fr: «Mode développeur» pl: «Tryb deweloperski» uk: «Режим розробника»

  6. config/global.php:
  7. Added 'dev_mode' => false as explicit default

Benefits:

  • dev_mode can be enabled/disabled without file editing
  • Config fingerprint tracking active when dev_mode is on
  • Consistent with all other boolean toggles in general preferences

Technical notes:

  • getConfig() already provides $conf['dev_mode'] ??= false fallback
  • normalize() converts false → '0', true → '1' on save
  • String '0' is falsy in PHP, behavior unchanged
Fix: setConfigFile() — use []-bracket format instead of array()
Автор: Eduard Laas | Дата: 10:11 19.02.2026

Replace var_export() with a recursive closure that produces modern PHP short-array syntax ([]) consistent with all config/*.php files.

Core changes:

  1. setConfigFile() (core/system.php, setup/index.php):
  2. Added $exp closure: renders arrays as [...] with 4-space indent
  3. Replaced var_export($data, true) with $exp($data)
  4. Output format now matches manually-converted config files

Benefits:

  • Config files saved by admin panel are readable and consistent
  • No more array() vs [] style mismatch after save
  • Multi-level arrays (ratings, modules) properly indented

Technical notes:

  • $exp recurses for nested arrays using depth counter
  • Scalar values still use var_export() for correct quoting
  • Both system.php and setup/index.php versions kept in sync
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

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

1 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 88

Хотите опробовать SLAED CMS в действии?

Идеи и предложения
Обратная связь