#2535302: Selecting too many files with JS off causes WSOD with data loss stops adding @ at the beginning of file uploads in WebTestBase because we just use PHP5.5's curl_create_file(). This means we can enable the curl option CURLOPT_SAFE_UPLOAD to standardise the behaviour across PHP versions. Also we can remove the comment:

   *   Note that when a form contains file upload fields, other
   *   fields cannot start with the '@' character.

And the check that random strings don't begin with an @ sign.

See https://secure.php.net/manual/en/function.curl-setopt.php

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott’s picture

Issue summary: View changes
alexpott’s picture

Status: Active » Needs review
FileSize
2.63 KB

Here's a patch.

mbaynton’s picture

Status: Needs review » Reviewed & tested by the community

Applied/tested/reviewed. Can't you get away with a regex as simple as '/^\s|\s$/'? Looks like the method is called nearly 200 times in current tests so probably runs pretty frequently, and ditching the capturing subgroups would theoretically perform better. But, that's a total nitpick, we can move on...

alexpott’s picture

@mbaynton you're right.

alexpott’s picture

Adding @mbaynton to the credit list.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

  • catch committed c8526e2 on 8.0.x
    Issue #2538260 by alexpott, mbaynton: Set CURLOPT_SAFE_UPLOAD to TRUE in...

Status: Fixed » Closed (fixed)

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