Чтение RSS каналов

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

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

Всего: 500 Доступных коммитов | Отфильтровано: 500 Коммиты | Страница: 44 / 50
28.02.2026
Refactor: remove manual getLang() calls from 23 frontend modules
Автор: Eduard Laas | Дата: 14:40 28.02.2026

Bootstrap in index.php now calls getLang(\$name) before require_once for every module. The explicit getLang(\$conf['name']) on line 9-12 of each module file is therefore redundant and removed.

Core changes:

  1. 23 frontend modules — each modules/*/index.php:
  2. Remove get_lang(\$conf['name']); line * account, auto_links, changelog, clients, contact, content, faq,

files, forum, help, jokes, links, media, money, news, order,
pages, recommend, rss, search, shop, users, whois

Benefits: - Modules no longer responsible for their own language bootstrapping - Reduces per-module boilerplate by one line - New modules work out of the box without extra setup

Technical notes: - modules/main, voting, sitemap had no getLang() call — untouched - No functional change: getLang() static cache makes double-call a no-op

Refactor: auto-load module language in bootstrap; migrate entrypoint getLang() calls
Автор: Eduard Laas | Дата: 14:40 28.02.2026

Moves module language loading from individual modules into the bootstrap (index.php), so any module gets its language file automatically without needing an explicit getLang() call inside the module file itself. Replaces three direct require_once language file statements in admin/index.php with getLang(\$name, true), adding locale-fallback that was previously missing.

Core changes:

  1. index.php — frontend module bootstrap:
  2. Add getLang(\$name) before require_once in all 4 module load branches * view=0 (public), view=1 (user/group), view=2 (moder), home-module branch

  3. Replace get_lang('shop') → getLang('shop') in \$go==2 AJAX branch
  4. Replace get_lang('admin') → getLang('admin') in \$go==5 AJAX branch
  5. admin/index.php — admin panel:
  6. Replace get_lang('admin') → getLang('admin') on bootstrap line
  7. Replace 3x direct require_once language file with getLang(\$name, true) * getAdminPanelBlocks() panel-off branch (line 60) * getAdminPanel() panel-on branch (line 111) * module dispatch block (line 238) * All three now benefit from locale-fallback to \$mlang when locale file missing

Benefits: - New modules auto-receive language file without boilerplate getLang() call - Admin module language loading gains locale-fallback (was missing before) - Consistent load pattern: bootstrap always owns language lifecycle

Technical notes: - getLang() static cache is idempotent — double call from bootstrap + module is safe - \$locale global is set by getLang() before require_once executes

Refactor: rename get_lang() to getLang(), add \$admin context for module-admin language
Автор: Eduard Laas | Дата: 14:40 28.02.2026

Renames get_lang() to getLang() following camelCase naming convention (coding-standards.md §4). Extends the function with a bool \$admin parameter that routes to modules/{module}/admin/language/ when true, making the loader universal for frontend, admin-panel and module-admin contexts. Removes the obsolete commented-out legacy function block (# OLD DELETE, 47 lines).

Core changes:

  1. getLang() (core/security.php):
  2. Rename get_lang() → getLang() — camelCase per project standard * Signature: getLang(string \$module = '', bool \$admin = false): string

  3. Add bool \$admin parameter for module-admin language path routing * getLang('news', true) → modules/news/admin/language/{locale}.php

  4. Update \$lmods cache key to module|ctx|locale (ctx = 'a'|'f') * Prevents cache collision between frontend and admin contexts

  5. Rename internal vars: \$candidates → \$list, \$loaded → \$done, \$fallback → \$fall * Aligns with 4-8 char rule (coding-standards.md §6)

  6. Remove # OLD DELETE block (legacy commented-out get_lang, lines 868–914)
  7. Bootstrap call (core/security.php:26):
  8. get_lang() → getLang()

Benefits: - Single universal function covers all three language-load contexts - Eliminates direct require_once language file scattered across admin/index.php - Consistent naming with getVar(), getAdminTabs(), getTheme() etc.

Technical notes: - \$lmods static cache remains: prevents redundant is_readable() per request - require_once PHP-level deduplication still prevents double file inclusion - filemanager plugin uses 'get_lang' as a string literal — unrelated, untouched

Refactor: normalize frontend modules — indentation, copyright, variable names
Автор: Eduard Laas | Дата: 02:18 28.02.2026

Standardises all public-facing module controllers: converts tab indentation to 4-space (recommend, users), corrects copyright header encoding and year (2021/2022 → 2026) across modules that were outdated, shortens verbose loop variables to concise local names, and adds defensive directory handling in main/index.php to prevent warnings when the screenshots directory is absent.

Core changes:

  1. main/index.php:
  2. Fix copyright year 2022 → 2026 and encoding © → ©
  3. Wrap opendir() in is_dir() + false check before loop * Prevents PHP warning when uploads/screens/thumb is missing

  4. Guard shuffle() call with if ($screens) to skip empty arrays
  5. Add closedir() inside the safe branch
  6. recommend/index.php:
  7. Convert tabs to 4-space indentation throughout
  8. Fix copyright year 2021 → 2026
  9. users/index.php:
  10. Convert tabs to 4-space indentation
  11. Rename verbose loop variables ($user_id → $uid, etc.)
  12. account, faq, forum, help, jokes, links, media, money, news, order, pages, shop, whois, search, files, clients, changelog, auto_links, content, contact, sitemap, rss/index.php:

  13. Rename DB-prefixed destructured vars to short local names
  14. Normalise copyright encoding/year where broken (© → ©)
  15. CRLF → LF line-ending normalisation on Windows-edited files

Benefits: - Consistent 4-space indentation across all frontend controllers - Correct copyright year in all module headers (2026) - No PHP warnings when optional directories are absent - Shorter variable names reduce line width in dense row-rendering loops

Technical notes: - No logic changes beyond the defensive is_dir() guard in main - CRLF → LF applied automatically by git on staging - Encoding fixes are cosmetic; runtime behaviour unchanged

Refactor: normalize variable names and config access in admin modules
Автор: Eduard Laas | Дата: 02:18 28.02.2026

Renames verbose DB-prefixed loop variables (user_id, ip_sender, user_name, ad_view, etc.) to concise local names ($uid, $ip, $nick, $view) across all admin module controllers. Migrates pagination config from deprecated $confu global to $conf['users'] sub-array in account admin. Removes unused $confu and $confn imports from global declarations.

Core changes:

  1. account/admin/index.php:
  2. Rename $psearch → $search, $cnt_params → $pars in navi() * Avoids shadowing the search variable read later

  3. Shorten all 26 $user_* destructured vars to single-word names * $user_id → $uid, $user_name → $name, $user_email → $mail, etc.

  4. Replace $confu['anum'] / $confu['anump'] with $conf['users'][...] * Removes dependency on $confu global in account() and add()

  5. Remove $confn and $confu from global declarations in add()
  6. news/admin/index.php:
  7. Rename $ip_sender → $ip, $user_name → $nick, $ad_view → $view
  8. Inline $assoc_arr to $associated in save()
  9. Remove unused $confu from global declaration
  10. media, money, links, shop, sitemap, whois, voting, files, faq, forum, help, jokes, pages, order, clients, changelog, auto_links, content, rss, contact/admin/index.php:

  11. Rename verbose loop/result variables to short local names
  12. Remove unused global imports ($confu, $confn where applicable)

Benefits: - Shorter destructuring lines fit within 120-char line limit - Eliminates $confu dependency in admin layer (uses $conf['users']) - Consistent naming style across all admin controllers

Technical notes: - No logic changes; purely cosmetic variable renames - $conf['users'] sub-array must exist (set by config loader) - CRLF → LF normalisation applied by git on staging

Chore: remove obsolete template file and fix billing variable name
Автор: Eduard Laas | Дата: 02:17 28.02.2026

Removes the stale templates/lite/0index.php which contained hardcoded site-specific navigation and SQL queries inside a presentation layer — a structural anti-pattern not compatible with the current template architecture. Also corrects a renamed variable reference in billing.html.

Core changes:

  1. templates/lite/0index.php:
  2. Delete entire file (184 lines) * Contained hardcoded menu HTML, direct DB queries, and

mixed presentation/business logic
  • Incompatible with {%placeholder%} template architecture
  1. modules/money/templates/billing.html:
  2. Replace $site_logo with $logo to match renamed config variable
  3. Add missing newline at end of file

Benefits: - Eliminates hardcoded SQL inside template layer - Fixes broken variable reference in billing invoice template - Reduces dead code footprint in templates/lite/

Technical notes: - templates/lite/0index.php was not referenced by any active module - billing.html $logo aligns with current config naming convention

Fix: add explicit type casts in cutstr() for safety
Автор: Eduard Laas | Дата: 02:17 28.02.2026

Adds (string) cast for $strip and (int) cast for $size at the top of cutstr() to prevent type coercion issues when callers pass non-scalar or null values.

Core changes:

  1. cutstr() (core/system.php):
  2. Add (string)$strip cast before length check * Prevents TypeError on null input

  3. Add (int)$size cast before arithmetic * Ensures consistent numeric behaviour

Benefits: - Prevents silent type coercion bugs at string truncation boundary - Aligns with PHP 8.4 strict-type expectations - Defensive guard for legacy call sites passing untyped values

Technical notes: - No change to function signature or return type - Backward compatible: existing callers unaffected

27.02.2026
Docs: update project documentation for SLAED 6.3 modernization phase
Автор: Eduard Laas | Дата: 23:31 27.02.2026

Synchronize all project documentation with the changes implemented in the current modernization phase: getVar() coverage, func_get_args() elimination, tpl_eval/tpl_func/tpl_warn removal, setRedirect() introduction, filterMarkdown() addition, and migration progress update to ~80% complete.

Core changes:

  1. README.md:
  2. Migration badge and text: 75% → 80% complete
  3. Tech Stack: added filterMarkdown() (safe Markdown parser) to Security line
  4. Completed section: added func_get_args() elimination, tpl_eval/tpl_func/tpl_warn removal, setRedirect(), filterMarkdown() entries

  5. Documentation table: added TESTS.md row
  6. CONTRIBUTING.md:
  7. getVar() type reference: added 'let', 'word', 'title', 'field', 'raw' types; corrected 'var' description (was "Raw variable"; now "Alphanumeric/underscore/dash")

  8. Admin Module Conventions: replaced manual header()/exit section with full setRedirect() documentation including signature and all parameters

  9. Template Functions: tpl_eval/tpl_func/tpl_warn marked as fully REMOVED (not deprecated) — calling them causes fatal error

  10. SECURITY.md:
  11. Version 6.3.0 changelog: added getVar() core coverage, func_get_args removed, tpl_eval/tpl_func/tpl_warn removed, filterMarkdown added, setRedirect added

  12. Removed (Insecure) table: added tpl_func() row, func_get_args() row, inline header()+exit row

  13. UPGRADING.md:
  14. Template Functions migration: tpl_eval/tpl_func changed from "deprecated" to "fully removed — causes fatal error in 6.3.x"; added tpl_func() row

  15. New section: Admin Redirects — setRedirect() with full signature and examples
  16. New section: Admin Help Files — info file rename table (en.html → english.html)
  17. Migration Checklist: updated tpl_eval item, added setRedirect and info rename
  18. Version History: expanded Major Changes list with all 6.3 improvements
  19. docs/TEMPLATES.md:
  20. [!WARNING] → [!CAUTION]: tpl_eval/tpl_func/tpl_warn have been REMOVED (not "will be removed") — updated wording and added tpl_func() to table

  21. docs/TESTS.md:
  22. Minor alignment with current test suite structure
  23. CODE_OF_CONDUCT.md:
  24. Added contribution guideline note for variable naming in examples and patches
  25. docs/DISCUS.md / docs/PARSE.md:
  26. Status lines updated to reflect filterMarkdown() implementation status

Benefits: - Documentation accurately reflects current codebase state - getVar() type table is complete and correct for all contributors - setRedirect() fully documented — replaces scattered header()/exit patterns - No invented functionality — all documented features verified in source

Technical notes: - docs/DISCUS.md and docs/PARSE.md are temporary working files - filterMarkdown() signature: (string $src, bool $safe, string $mod): string - setRedirect() signature: (string $url, bool $refer, int $code): never

Test: add informational audit tests; harden SecurityValidationTest
Автор: Eduard Laas | Дата: 23:30 27.02.2026

Add two new informational test suites for language constant usage and unused function detection; update SecurityValidationTest to convert the include-inside-functions check from a hard assertion to an informational STDERR report with deduplication and truncation.

Core changes:

  1. New test: tests/LanguageConstantsUsageTest.php:
  2. Scans language/.php, admin/language/.php, modules//language/.php
  3. Counts total defined constants vs. actual usage in PHP source
  4. Reports: total, unused, low-use (1-2 occurrences), top unused/low-used
  5. Informational only — no hard assertions that would block CI
  6. New test: tests/UnusedCodeAuditTest.php:
  7. Scans core/*.php for defined functions vs. usage in project source
  8. Reports unused functions, low-use functions, top candidates for removal
  9. Scans local variables for unused assignment candidates (heuristic)
  10. Informational only — assists human review, does not fail CI
  11. Updated: tests/SecurityValidationTest.php (testNoIncludesInsideFunctions):
  12. $errors[] hard assert → informational STDERR report
  13. Deduplication: $seen[] map prevents double-counting same file:line
  14. Truncation: output capped at 30 warnings + "... and N more" summary
  15. Rationale: legacy SLAED codebase has many include-inside-functions patterns that require staged migration; hard failure blocked test runs

  16. Updated: tests/LanguageValidationTest.php:
  17. Minor cleanup and alignment with new audit test patterns

Benefits: - Two new audit tools surface unused code and dead language constants - SecurityValidationTest no longer fails CI on known legacy patterns - All audit output goes to STDERR — visible in verbose mode, not in summary

Technical notes: - Both new tests extend PHPUnit TestCase with self::assertTrue(true) anchor - Output format: plain text with key metrics for human readability - Tests run after: ./vendor/bin/phpunit (no additional configuration needed)

Refactor: migrate templates from positional $arg[N] to named {%placeholder%} syntax
Автор: Eduard Laas | Дата: 23:29 27.02.2026

Replace all positional $arg[N] variable references in HTML template files with named {%placeholder%} tokens compatible with setTemplateBasic(). This completes the migration from tpl_eval()/tpl_func() (removed) to the strtr-based template renderer introduced in SLAED 6.3.

Core changes:

  1. Admin templates (templates/admin/*.html):
  2. login.html: $arg[1]→{%route%}, $arg[2]→{%nickname%}, $arg[3]→{%password%}, $arg[4]→{%captcha%}, $arg[5]→{%login%}

  3. registration.html: all $arg[N] → named placeholders
  4. comment.html: positional args → semantic names (username, avatar, rank, etc.)
  5. voting-close/open/post/view.html: updated to named placeholders
  6. index.php (admin theme entry): positional variable references updated
  7. Default theme templates (templates/default/*.html):
  8. comment.html: $arg[1-25] → {%id%}, {%username%}, {%avatar%}, {%rank%}, {%post_count%}, {%user_rate%}, {%hclass%}, etc.

  9. login.html / login-logged.html / login-without.html: named placeholders
  10. privat-message.html: message template fully updated
  11. basic-search.html, basic-media-view.html: search/media templates updated
  12. liste-basic.html, liste-open.html: list templates updated
  13. block-voting.html: voting block placeholder names
  14. Lite theme templates (templates/lite/*.html, templates/lite/0index.php):
  15. Same pattern applied: all $arg[N] → {%named%} placeholders
  16. comment.html, privat-message.html, basic-search.html, basic-media-view.html

Benefits: - Template variables are now self-documenting (name conveys meaning) - setTemplateBasic() uses strtr() with named keys — no eval() required - Template maintenance simplified: no need to count positional arg indices - All CRLF → LF normalized; missing EOF newlines added

Technical notes: - setTemplateBasic(string $tpl, array $vars): string uses strtr($raw, $vars) - Template files loaded from templates/$theme/$name.html by getThemeFile() - Callers (module index.php files) updated to pass named key arrays

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

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

Технологии

PHP MySQL HTML 5 CSS 3 jQuery jQuery UI

Контакты

  • D-49179, Deutschland
    Ostercappeln, Im Siek 6
  • +49 176 61966679

  • https://slaed.net
Идеи и предложения
Обратная связь