Problem/Motivation

When enabling the file logging, it will not write any files. When having created the needed directories manually, it will actually fail, because it will use the description string as a filename practically as-is. The description for requests will be something like Response cache tags for GET /my/pages/url. The createFilename function will do some sanitization, but it does not take into account the slashes. Although the method's name might imply it does more to produce a valid filename, the description says: "Creates a full file path from a directory and filename. If a file with the specified name already exists, an alternative will be used." So, nothing there to imply it does any sanitization.

Steps to reproduce

  • Enable the module
  • Enable file logging
  • Do a request, notice no log file is created
  • Create a directory cache_debug/response in the private file location
  • Do a request, notice how it fails

Proposed resolution

Sanitize the filename.

Remaining tasks

Create MR
Review
Merge

User interface changes

None.

API changes

None.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

eelkeblok created an issue. See original summary.

eelkeblok’s picture

Status: Active » Needs review
eelkeblok’s picture

Using cleanCssIdentifier felt a little dirty, but it does the job and I couldn't find anything more appropriate. Reinventing the wheel by doing my own escaping seemed not worth it either.

matthijs’s picture

Status: Needs review » Fixed

Sorry for the long wait... Your changes were merged, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.