Use isset so we don't trigger a warning. Also change to <?php

This commit is contained in:
Scott Baker 2014-02-01 13:33:30 -08:00
parent 69fbd76544
commit c1730c0d00

View File

@ -1,15 +1,13 @@
#!/usr/bin/env php #!/usr/bin/env php
<?PHP <?php
$dir = dirname(__FILE__); $dir = dirname(__FILE__);
require("$dir/../Parsedown.php"); require("$dir/../Parsedown.php");
////////////////////////////////////////////// //////////////////////////////////////////////
$file_mode = is_readable($argv[1]);
// From a file // From a file
if ($file_mode) { if (isset($argv[1]) && is_readable($argv[1])) {
$str = file_get_contents($argv[1]); $str = file_get_contents($argv[1]);
// From STDIN // From STDIN
} else { } else {