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

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

Всего: 872 Доступных коммитов | Отфильтровано: 872 Коммиты | Страница: 53 / 88
03.03.2026
Refactor: rename functions in core/user.php to SLAED VerbNoun convention
Автор: Eduard Laas | Дата: 14:19 03.03.2026

Standardizes all 16 non-conforming function names in core/user.php and updates every call site across 20 files so the codebase is consistent with the approved verb set (get, set, add, update, delete, is, check, filter).

Core changes:

  1. Function renames (core/user.php):
  2. getusrinfo() → getUserInfo() (no camelCase)
  3. is_mod_group() → isModGroup() (snake_case)
  4. userblock() → getUserBlock() (missing verb)
  5. savecom() → addComment() (save not in SLAED verbs)
  6. editpost() → updatePost() (edit not in SLAED verbs)
  7. prmess() → getPmView() (no verb, no camelCase)
  8. prmesssend() → addPmMsg() (no verb, no camelCase)
  9. prmesssave() → setPmSaved() (no verb, no camelCase)
  10. prmessdel() → deletePmMsg() (no verb, no camelCase)
  11. favorview() → getFavorBtn() (no verb, no camelCase)
  12. favoradd() → addFavor() (verb at end, no camelCase)
  13. favorliste() → getFavorList() (no verb, no camelCase)
  14. favordel() → deleteFavor() (no verb, no camelCase)
  15. rss_channel() → getRssChannel() (snake_case)
  16. open_search() → getOpenSearch() (snake_case)
  17. open_xsl() → getOpenXsl() (snake_case)
  18. Code quality fixes (core/user.php):
  19. list() → [] destructuring (28 occurrences)
  20. Indentation: 1-space global lines → 4 spaces
  21. getFavorBtn($fid, $mod): added type hints int/string
  22. Strict comparisons in isModGroup() and addComment()
  23. Call sites updated in 20 files:
  24. core/system.php, core/template.php, index.php
  25. blocks/block-user_info.php, templates/lite/index.php
  26. modules/account, auto_links, contact, faq, files, forum, help, links, media, money, news, order, pages, recommend, shop

Benefits:

  • Consistent SLAED VerbNoun naming across core/user.php
  • list() removal eliminates PHP 8 deprecation warnings
  • Strict comparisons prevent type-juggling edge cases

Technical notes:

  • op= URL routing strings (savecom, editpost, prmess, etc.) unchanged
  • No logic changes; signature types only on getFavorBtn
  • Backward compatibility: internal API only
Fix: rename addmail() → addAdminMail() to resolve fatal redeclaration
Автор: Eduard Laas | Дата: 13:47 03.03.2026

addmail() collided with addMail() (core/security.php) because PHP function names are case-insensitive; renamed to addAdminMail() to follow VerbNoun convention and eliminate the fatal redeclaration error.

Core changes:

  1. Function declaration (core/system.php):
  2. addmail() → addAdminMail(); comment updated
  3. No logic changes, signature unchanged
  4. Call sites (11 files):
  5. core/user.php
  6. modules/news, links, files, media, jokes, faq, pages, help, whois, auto_links

Benefits:

  • Resolves Fatal error: Cannot redeclare function addMail()
  • Consistent VerbNoun camelCase naming per SLAED §3-4
  • No ambiguity between low-level addMail() and admin-notify addAdminMail()

Technical notes:

  • addMail() (security.php) queues a single email
  • addAdminMail() (system.php) dispatches notifications to all subscribed admins
  • Backward compatibility: internal API only; no external callers
Fix: complete is_admin → isAdmin rename in core/system.php
Автор: Eduard Laas | Дата: 13:44 03.03.2026

Replaces all remaining legacy function calls that were missed in the previous Refactor commit, ensuring system.php is consistent with the merged isAdmin(bool \$super = false) API in core/security.php.

Core changes:

  1. Function call replacements (core/system.php):
  2. is_admin() → isAdmin() (12 occurrences)
  3. isAdminSuper() → isAdmin(true) (4 occurrences)

Benefits:

  • No legacy shim required; all call sites now use unified API
  • Static cache in isAdmin() shared across all 16 call sites per request
  • One DB query per request regardless of super check

Technical notes:

  • isAdmin(true) is equivalent to removed isAdminSuper()
  • isAdmin() is equivalent to removed is_admin()
  • Backward compatibility: none needed; legacy functions deleted
Refactor: replace save_datetime() with getVar('req', ..., 'time') and fix quote style
Автор: Eduard Laas | Дата: 13:39 03.03.2026

Migrates remaining save_datetime() calls to the unified getVar() API, and corrects a single-quote style issue in the changelog French language file.

Core changes:

  1. modules/faq/admin/index.php:
  2. save_datetime(1, 'time') → getVar('req', 'time', 'time') (×2, add/save)
  3. modules/changelog/language/fr.php:
  4. Double to single quote on one define() line

Benefits:

  • Consistent input handling via getVar() throughout admin modules
  • No more calls to removed save_datetime() helper

Technical notes:

  • Behaviour unchanged; getVar 'time' type validates and formats identically
Test: update test suite for renamed functions and API changes
Автор: Eduard Laas | Дата: 13:39 03.03.2026

Adapts all test files to the camelCase rename sprint: function calls, helper wrappers and comments updated throughout the Unit and integration test suites.

Core changes:

  1. tests/Unit/InputFilterTest.php:
  2. saveText → filterHtml in helper and comments
  3. tests/Unit/PasswordHashTest.php, TemplateIfTest.php:
  4. Minor naming alignment
  5. tests/bootstrap.php:
  6. Updated function references
  7. Validation tests (BlockValidationTest, SecurityValidationTest, etc.):
  8. Updated function name expectations

Benefits:

  • Test suite reflects current API
  • No regressions introduced by the rename sprint

Technical notes:

  • phpunit: all tests expected to pass after rename completion
Docs: update documentation for renamed security and utility functions
Автор: Eduard Laas | Дата: 13:39 03.03.2026

Updates all user-facing and developer-facing documentation to reflect the camelCase function rename sprint completed in core/security.php.

Core changes:

  1. CONTRIBUTING.md:
  2. getVar() type table updated (filterWord, filterHtml, filterFields)
  3. SECURITY.md:
  4. New section: renamed security functions reference table (20 entries)
  5. UPGRADING.md:
  6. Breaking changes section: full migration table for renamed functions
  7. Version history updated
  8. docs/TEMPLATES.md:
  9. Date updated to 2026
  10. docs/TESTS.md:
  11. Function names updated to camelCase equivalents

Benefits:

  • Developers can look up old names and find new equivalents
  • Migration path is clearly documented for upgraders

Technical notes:

  • No code changes; documentation only
  • Covers all renames tracked in GLOSSARY.md
Refactor: rename legacy snake_case functions to camelCase across codebase
Автор: Eduard Laas | Дата: 13:38 03.03.2026

Completes the security/utility function rename sprint: all legacy snake_case identifiers in core/security.php are replaced with camelCase VerbNoun names per SLAED coding standard §3-4, and every call site across the project is updated accordingly.

Core changes:

  1. Function renames (core/security.php):
  2. log_report() → addLog()
  3. is_admin_god() / is_admin() → isAdmin(bool $super = false)
  4. get_host() → getHost()
  5. get_referer() → getReferer()
  6. zip_check() / zip_compress() → checkCompress() / addCompress()
  7. isVar() / analyze() → filterVar()
  8. url_filter() → filterUrl()
  9. num_filter() → filterNum()
  10. var_filter() → filterWord()
  11. text_filter() → filterText()
  12. cutstrc() → filterCut()
  13. ed2k_link() → getEd2kLink()
  14. url_clickable() → filterClickable()
  15. save_text() → filterHtml()
  16. fields_save() → filterFields()
  17. display_time() → getDuration()
  18. rest_time() → getTimeLeft()
  19. mail_send() → addMail()
  20. doHackReport() → addHackReport()
  21. doWarnReport() → addWarnReport()
  22. error_sql_log() → addSqlLog() (core/classes/pdo.php)
  23. isAdmin() optimisation (core/security.php):
  24. Merged isAdminSuper() into isAdmin(bool $super = false)
  25. Single DB query fills both cache slots (key 0 and key 1)
  26. hash_equals() for constant-time password comparison
  27. Strict === throughout; getSqlRow() null-guard added
  28. Variable renames (core/security.php):
  29. $ua → $uagt, $ag → $agent, $ipt_base → $iptbase
  30. $array_index → $arridx, $is_array_all → $allarr
  31. $date_time → $dtime
  32. Bug fixes (core/security.php):
  33. @ suppression removed from $lwrite closure
  34. getIp() / getAgent() hoisted out of blocker foreach loop
  35. setCookies() uses implode() instead of fixed $value[0..5] indexing
  36. getTimeLeft() calls time() once; getHost() has ?: '' fallback
  37. getSqlRow() null-guard added via ?? ['', '', '']
  38. Call sites updated across 68 files:
  39. admin/modules/*.php, modules//index.php, modules//admin/index.php
  40. core/admin.php, core/system.php, core/user.php, templates/admin/index.php
  41. core/legacy.php removed (empty guard-only file)

Benefits:

  • Consistent camelCase API throughout the project
  • Merged admin-check function reduces DB queries per request
  • Security hardened: timing-safe comparison, no error suppression

Technical notes:

  • All renames tracked in .agents/skills/slaed/GLOSSARY.md
  • php -l: no syntax errors in all changed files
  • Backward compatible: no public API exposed outside this project
Style: apply php-cs-fixer (double to single quotes) across codebase
Автор: Eduard Laas | Дата: 13:37 03.03.2026

Replaces all double-quoted strings with single quotes in language files, blocks, and plugins to align with SLAED coding standard §17 (always use single quotes for simple strings).

Core changes:

  1. Language files (language/, admin/language/, modules/*/language/):
  2. 150+ define() calls: double to single quotes
  3. Block files (blocks/*.php):
  4. All string literals converted to single quotes
  5. Plugin files (plugins/filemanager/**):
  6. All string literals converted to single quotes
  7. Template (templates/lite/index.php):
  8. array() → [] syntax; string literals to single quotes

Benefits:

  • Consistent code style across the project
  • Alignment with SLAED coding standard §17

Technical notes:

  • Behaviour unchanged; purely cosmetic
  • Applied via php-cs-fixer
  • Backward compatible
02.03.2026
Revert: restore legacy functions to system.php
Автор: Eduard Laas | Дата: 22:25 02.03.2026

Revert the function extraction introduced in commit 6ec4ea7 due to a production failure. The refactored split (system.php + legacy.php) caused 500 errors on the live server that persisted even after PHP-FPM restart.

Core changes:

  1. core/system.php:
  2. Restore all legacy functions that were moved to core/legacy.php

    • Production server failed silently after deployment of the split
  3. core/legacy.php:
  4. Remove all functions; restore to stub (guard only)

Benefits:

  • Production stability restored

Technical notes:

  • Root cause not yet confirmed; suspected: config file format mismatch between old doConfig() output and new getConfig() reader

  • Refactor to be re-attempted after diagnosing production config format
Fix: indentation and remove stray setThemeInclude() in money admin module
Автор: Eduard Laas | Дата: 21:15 02.03.2026

Correct over-indented variable declaration in rechn() and remove a redundant setThemeInclude() call that was left after a prior refactor.

Core changes:

  1. rechn() (modules/money/admin/index.php):
  2. Fix indentation: $id = getVar(...) was at 8 spaces, corrected to 4
  3. Remove setThemeInclude() call

    • Function is called by the dispatcher before rechn() is invoked;
calling it again inside the function is redundant and incorrect

Benefits:

  • Consistent indentation aligned with project code style
  • Eliminates double theme-include side effect

Technical notes:

  • No behavioral change for normal request flow
  • setThemeInclude() removal has no visible effect as template is already loaded

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

1 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 88

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

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