Skip to content

Move introduces a link corruption in Include links #414

Open

Description

@s-asoft

What triggers the bug: explode('|', …) on a trailing pipe yields ["page", ""], array_shift leaves [""] — a non-empty array holding an empty string, so if ($replacers) passes and concatenates Array. The malformed markup was the trigger all along.

So the repair is just to delete |Array. Let me find every other include carrying the same time bomb:

Found all malformed includes that will corrupt on move
Complete picture now, and it's clean to fix.

No include anywhere uses a genuine replacer. Every | in your 218 includes is a malformed empty one — someone half-typed a link. So the repair is pure deletion, nothing to reconstruct.

sudo sed -i "364s/.*/            if (\$replacers) \$result .= '|' . implode('|', \$replacers);/" \
  /var/www/dokuwiki/lib/plugins/include/action.php
php -l /var/www/dokuwiki/lib/plugins/include/action.php

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions