diff options
author | Mario <mario@mariovavti.com> | 2021-11-09 09:10:19 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-11-09 09:10:19 +0000 |
commit | fe7ecede700fe04631d23f36473e697ce2b364dc (patch) | |
tree | e713fc39dba500a25cb2acf8561e286fb8b41ff0 /vendor/jbroadway/urlify/scripts/filter.php | |
parent | 42de18d96d201d74e5df3ed1b8f6132cb00357b6 (diff) | |
parent | 089708ab9f90309a0c27ae633cf8f2604fce1170 (diff) | |
download | volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.tar.gz volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.tar.bz2 volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.zip |
Merge branch '6.4RC'6.4
Diffstat (limited to 'vendor/jbroadway/urlify/scripts/filter.php')
-rw-r--r-- | vendor/jbroadway/urlify/scripts/filter.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/jbroadway/urlify/scripts/filter.php b/vendor/jbroadway/urlify/scripts/filter.php new file mode 100644 index 000000000..d20c31594 --- /dev/null +++ b/vendor/jbroadway/urlify/scripts/filter.php @@ -0,0 +1,25 @@ +<?php + +// +// Filter the provided argument or stdin if the argument was not present +// + +require_once \dirname(__DIR__) . '/vendor/autoload.php'; +require_once \dirname(__DIR__) . '/URLify.php'; + +// Print usage and exit if arguments are invalid +if ($argc < 1 || $argc > 2) { + die('Usage (argument): php ' . \basename(__FILE__) . " \"<text to filter>\"\nUsage (pipe): <Arbitrary command> | php " . \basename(__FILE__) . "\n"); +} + +// Process the provided argument +$piped = false; +if ($argc === 2) { + $s = $argv[1]; +// Or read from stdin if the argument wasn't present +} else { + $piped = true; + $s = \file_get_contents('php://stdin'); +} + +echo URLify::filter($s) . ($piped ? "\n" : ''); |