En vous promenant sur Beamreactor, nous stockons votre IP 48h pour des raisons de sécurité.

Lecteur Markdown

parser_enforcer Documentation › PARSER_ENFORCER_DOCUMENTATION_EN

Parser Enforcer Documentation En

Feature: Parser Enforcer #

Code maintenance tool. Scans plugins for legacy sanitization functions (htmlentities, htmlspecialchars, strip_tags, intval, addslashes, direct echo of superglobals, direct SQL concatenation) and offers to convert them to Parser::sanitize(). Assisted, file-by-file fixing with a preview before applying.

Installation and Configuration

Via FTP: Upload the parser_enforcer/ directory into /plugins/.

Via package manager: Select parser_enforcer from the available plugins list.

Paths:

  • Main plugin: /plugins/parser_enforcer/parser_enforcer.php
  • Library: /plugins/parser_enforcer/lib/parser_enforcer.lib.inc.php
  • AJAX handler: /plugins/parser_enforcer/handlers/parser_enforcer.mod.php
  • CSS / JS: /plugins/parser_enforcer/css/, /plugins/parser_enforcer/js/

Configuration parameters:

| Variable | Default | Description |

|---|---|---|

| $basedatadisplay | 'yes' | Visible in the management interface |

| $basedisplevel | BASE_LEVEL_OVERMIND | Highest access level |

| $ftype | 10 | Tool / utility |

| PARSER_ENFORCER_LEVEL_ADMIN | BASE_LEVEL_OVERMIND | Level required to scan and fix |

Usage

1. Go to ?obj=parser_enforcer.php

2. Click Scan /plugins/ — the number of issues found and affected files is shown.

3. For each issue in the list:

- Click the item → shows the context (previous line, current line, next line).

- Pick the data type from the dropdown (or leave it on auto).

- Preview: preview the corrected code.

- Apply: write the patch to the file.

- Skip: move to the next issue.

Scan results are kept in the session ($_SESSION['parser_enforcer_issues']).

Available data types #

auto, string, int, email, url, name, bool, ip, float, filename, date.

The auto mode guesses the type from the variable name: id/page/numint, email/mailemail, url/link/hrefurl, name/username, etc.

Hooks and Entry Points

text
?obj=parser_enforcer.php   — Scan and fix interface
?obj=parser_enforcer.mod   — AJAX endpoint (preview / apply)

The scan is triggered by a POST (action=scan) to the main page.

Dependencies

  • ParserEnforcer (local library) — scan and patch engine
  • Beamreactor\Sanitizer\Parser — conversion target
  • javascript/dialogs.js — dialog boxes

Security

Required level: OVERMIND. The tool edits plugin source files directly; it must remain restricted to the highest-level administrators.

de en fr