Language: PHP
Label: safe
CWE: CWE-94 \u2014 Improper Control of Generation of Code ('Code Injection')
The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.

Code:
	public function testCustomerDirOptionsAddMalformedInvalid()
	{
		global $admin_userdata;

		// get customer
		$json_result = Customers::getLocal($admin_userdata, array(
			'loginname' => 'test1'
		))->get();
		$customer_userdata = json_decode($json_result, true)['data'];

		$data = [
			'path' => '/testmalformed',
			'error404path' => '"'.PHP_EOL.'IncludeOptional /something/else/'.PHP_EOL.'#'
		];
		$this->expectExceptionMessage("The value given as ErrorDocument does not seem to be a valid file, URL or string.");
		DirOptions::getLocal($customer_userdata, $data)->add();

		$data = [
			'path' => '/testmalformed',
			'error404path' => '"something"oh no a quote within the string"'
		];
		$this->expectExceptionMessage("The value given as ErrorDocument does not seem to be a valid file, URL or string.");
		DirOptions::getLocal($customer_userdata, $data)->add();
	}