append()
Usage
append(filepath, data...)
Description
Appends a string representation of the given values to a file underneath the Structr exchange/
directory. See Anatomy of a Structr application for more information.
Example
${append('info.txt', 'Hello, ', 'world!')}
${append('subdir/info.txt', 'Hello, ', 'world!')}
Note
- The
exchange/
directory itself may be a symbolic link - Underneath the
exchange/
the canonical path of a file has to be identical to the provided filepath in order to prevent directory traversal attacks- This means that symbolic links inside the
exchange/
directory are forbidden - Also path traversal is forbidden
- Example 1: Allowed ‘sub/dir/file.txt’
- Example 2: Forbidden ‘../../../../etc/passwd’
- Example 3: Forbidden ‘/etc/passwd’
- This means that symbolic links inside the