diff --git a/core/modules/simpletest/src/RandomGeneratorTrait.php b/core/modules/simpletest/src/RandomGeneratorTrait.php index 5a50439..ab86f69 100644 --- a/core/modules/simpletest/src/RandomGeneratorTrait.php +++ b/core/modules/simpletest/src/RandomGeneratorTrait.php @@ -71,16 +71,19 @@ public function randomStringValidate($string) { if (preg_match('/\s{2,}/', $string)) { return FALSE; } + // Starting with a space means that length might not be what is expected. // Starting with an @ sign causes CURL to fail if used in conjunction with a - // file upload, see https://drupal.org/node/2174997. + // file upload. See https://www.drupal.org/node/2174997. if (preg_match('/^(\s|@)/', $string)) { return FALSE; } + // Ending with a space means that length might not be what is expected. if (preg_match('/\s$/', $string)) { return FALSE; } + return TRUE; }