diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php index 4a7e2c3..d35a2b4 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -1342,7 +1342,9 @@ public function randomStringValidate($string) { } // Starting with a space means that length might not be what is expected. - if (preg_match('/^\s/', $string)) { + // Starting with an @ sign causes CURL to fail if used in conjunction with a + // file upload, see https://drupal.org/node/2174997. + if (preg_match('/^(\s|@)/', $string)) { return FALSE; } @@ -1351,12 +1353,6 @@ public function randomStringValidate($string) { return FALSE; } - // Ensure the fields do not begin with an @ sign as this causes CURL to fail - // if used in conjunction with a file upload. - if (preg_match('/^@/', $string)) { - return FALSE; - } - return TRUE; }