Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions includes/functions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function format_time($seconds)
// Given a string such as "comment_123" or "id_57", it returns the final, numeric id.
function split_id($str)
{
return match('/[_-]([0-9]+)$/', $str, 1);
return spf_match('/[_-]([0-9]+)$/', $str, 1);
}

// Creates a friendly URL slug from a string
Expand All @@ -68,7 +68,7 @@ function slugify($str)
// Computes the *full* URL of the current page (protocol, server, path, query parameters, etc)
function full_url()
{
$s = empty($_SERVER['HTTPS']) ? '' : ($_SERVER['HTTPS'] == 'on') ? 's' : '';
$s = empty($_SERVER['HTTPS']) ? '' : (($_SERVER['HTTPS'] == 'on') ? 's' : '');
$protocol = substr(strtolower($_SERVER['SERVER_PROTOCOL']), 0, strpos(strtolower($_SERVER['SERVER_PROTOCOL']), '/')) . $s;
$port = ($_SERVER['SERVER_PORT'] == '80') ? '' : (":".$_SERVER['SERVER_PORT']);
return $protocol . "://" . $_SERVER['HTTP_HOST'] . $port . $_SERVER['REQUEST_URI'];
Expand Down Expand Up @@ -476,7 +476,7 @@ function browser_info()
}

// Quick wrapper for preg_match
function match($regex, $str, $i = 0)
function spf_match($regex, $str, $i = 0)
{
if(preg_match($regex, $str, $match) == 1)
return $match[$i];
Expand Down