--TEST-- Bug #64931 (phar_add_file is too restrictive on filename) --SKIPIF-- --INI-- phar.readonly=0 --FILE-- addFile(__DIR__."/src/.pharignore", ".pharignore"); try { $phar->addFile(__DIR__."/src/.pharignore", ".phar/gotcha"); } catch (Exception $e) { echo "CAUGHT: ". $e->getMessage() ."\n"; } try { $phar->addFromString(".phar", "gotcha"); } catch (Exception $e) { echo "CAUGHT: ". $e->getMessage() ."\n"; } try { $phar->addFromString(".phar//", "gotcha"); } catch (Exception $e) { echo "CAUGHT: ". $e->getMessage() ."\n"; } try { $phar->addFromString(".phar\\", "gotcha"); } catch (Exception $e) { echo "CAUGHT: ". $e->getMessage() ."\n"; } try { $phar->addFromString(".phar\0", "gotcha"); } catch (Exception $e) { echo "CAUGHT: ". $e->getMessage() ."\n"; } ?> ===DONE=== --CLEAN-- --EXPECT-- Test CAUGHT: Cannot create any files in magic ".phar" directory CAUGHT: Cannot create any files in magic ".phar" directory CAUGHT: Cannot create any files in magic ".phar" directory CAUGHT: Cannot create any files in magic ".phar" directory CAUGHT: Cannot create any files in magic ".phar" directory ===DONE===