private function multipart_escape($value) {
    if (!$this->request_settings['multipart'] || strpos($value, '@') !== 0)
      return $value;

    // see if the parameter is a file.
    // we split on the semi-colon as it's the delimiter used on media uploads
    // for fields with semi-colons this will return the original string
    list($file) = explode(';', substr($value, 1), 2);
    if (file_exists($file))
      return $value;

    return " $value";
  }
private function multipart_escape($value) {
    if (!$this->request_settings['multipart'] || strpos($value, '@') !== 0)
      return $value;

    // see if the parameter is a file.
    // we split on the semi-colon as it's the delimiter used on media uploads
    // for fields with semi-colons this will return the original string
    list($file) = explode(';', substr($value, 1), 2);
    if (file_exists($file))
      return $value;

    return " $value";
  }
private function multipart_escape ( $ value ) { if ( ! $ this -> request_settings [ 'multipart' ] || strpos ( $ value , '@' ) !== 0 ) return $ value ; // see if the parameter is a file. // we split on the semi-colon as it's the delimiter used on media uploads // for fields with semi-colons this will return the original string list ( $ file ) = explode ( ';' , substr ( $ value , 1 ) , 2 ) ; if ( file_exists ( $ file ) ) return $ value ; return " $value" ; }
If the request uses multipart, and the parameter isn't a file path, prepend a space
otherwise return the original value. we chose a space here as twitter whitespace trims from
the beginning of the tweet. we don't use \0 here because it's the character for string
termination.

@param the parameter value
@return string the original or modified string, depending on the request and the input parameter
If the request uses multipart and the parameter isn t a file path prepend a space otherwise return the original value . we chose a space here as twitter whitespace trims from the beginning of the tweet . we don t use \ 0 here because it s the character for string termination .