summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-04-17 01:46:23 +0000
committerColin Smith <colin@pfsense.org>2005-04-17 01:46:23 +0000
commit29c3c942d544522ebe55307ad922fb52186c01c6 (patch)
treec5df5df841b49fb9e7206701b3963fe711d466d3 /etc
parentb6229fd07e0bbd49327573fb395336dc879a5867 (diff)
downloadpfsense-29c3c942d544522ebe55307ad922fb52186c01c6.zip
pfsense-29c3c942d544522ebe55307ad922fb52186c01c6.tar.gz
Update reverse_strrchr().
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc9
1 files changed, 3 insertions, 6 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 9962510..3761092 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -660,12 +660,9 @@ function gather_altq_queue_stats($dont_return_root_queues) {
* reverse_strrchr($haystack, $needle): Return everything in $haystack up to the *last* instance of $needle.
* Useful for finding paths and stripping file extensions.
*/
-function reverse_strrchr($haystack, $needle) {
- $pos = strrpos($haystack, $needle);
- if($post === false) {
- return $haystack;
- }
- return substr($haystack, 0, $post + 1);
+function reverse_strrchr($haystack, $needle)
+{
+ return strrpos($haystack, $needle) ? substr($haystack, 0, strrpos($haystack, $needle) +1 ) : false;
}
/*
OpenPOWER on IntegriCloud