Shellbox
Library and server for containerized shell execution
Loading...
Searching...
No Matches
Shellbox\Multipart\MultipartUtils Class Reference

Static utility functions for the multipart reader. More...

Static Public Member Functions

static extractBoundary ( $contentType)
 Extract the boundary from a Content-Type string.
 
static decodeParameters ( $input)
 Decode semicolon-separated parameters into an associative array.
 
static decodeTokenOrQuotedString ( $input)
 Parse the "value" production from RFC 1341, which is either an unquoted "token" or a quoted string with peculiar backslash escaping.
 

Detailed Description

Static utility functions for the multipart reader.

Member Function Documentation

◆ decodeParameters()

static Shellbox\Multipart\MultipartUtils::decodeParameters ( $input)
static

Decode semicolon-separated parameters into an associative array.

The values may be quoted or unquoted. We try to follow the "parameter" production in RFC 1341.

Parameters
string$input
Returns
array
Exceptions
MultipartError

◆ decodeTokenOrQuotedString()

static Shellbox\Multipart\MultipartUtils::decodeTokenOrQuotedString ( $input)
static

Parse the "value" production from RFC 1341, which is either an unquoted "token" or a quoted string with peculiar backslash escaping.

Parameters
string$input
Returns
string
Exceptions
MultipartError

◆ extractBoundary()

static Shellbox\Multipart\MultipartUtils::extractBoundary ( $contentType)
static

Extract the boundary from a Content-Type string.

If the Content-Type is not multipart, returns false.

This can be used to get a boundary when constructing a MultipartReader from a request.

Parameters
string$contentType
Returns
bool|string

The documentation for this class was generated from the following file: