Skip to content

Import fails when forbidden_filename_characters are in the recipe's title #2821

@Scaenicus

Description

@Scaenicus

Description

  • I have a couple of forbidden_filename_characters in nextcloud's config.php
  • When a recipe contains such character in the title during import, the directory is created, but the import fails

Reproduction
Steps to reproduce the behavior:

  1. Open config/config.php and forbid a character from a recipe's title you know import works
    Here is mine if you want to be particularly at war with the import function for most recipe-authors (double spaces are forbidden), but you can also just add something like 'e' to the forbidden characters to test.
 'forbidden_filename_characters' =>
  array (
    0 => '/',
    1 => '\\',
    2 => '?',
    3 => '%',
    4 => '*',
    5 => ':',
    6 => '|',
    7 => '"',
    8 => '>',
    9 => '<',
    10 => ',',
    11 => '=',
    12 => '&',
    13 => '`',
    14 => '  ',
    15 => ' ^=',
    16 => '  ',
    17 => ' ^d',
    18 => '  ',
    19 => ' ^v',
    20 => '  ',
    21 => ' ^|',
  ),
  1. Go to the cookbook app in nextcloud and import a previously known to work recipe
  2. Import will fail as described above.

Expected behavior
Either:

  • Bypass the restriction if possible OR
  • All characters forbidden are removed from the string. If that would make the string empty, save as r001 (on conflict raise the counter).

Actual behavior
The target directory gets created but is empty.

Versions
Nextcloud server version: 31.0.7
Cookbook version: 0.11.3
Database system: MySQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions