Jump to content

Fatal error: Call to undefined function filter_var


strago

Recommended Posts

$valid_url = filter_var($url, FILTER_VALIDATE_URL);
if ($valid_url !== false && $valid_url !== null && preg_match('!^https?://!', $valid_url)) {
$url = filter_var($url, FILTER_SANITIZE_URL);


$permalink = filter_var($permalink, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED);
if ($permalink !== false && $permalink !== null && preg_match('!^https?://!', $permalink)) {
	$permalink = filter_var($permalink, FILTER_SANITIZE_URL);

 

I got php 5.1.6. filter_var requires php 5.2.0. Is there a way to change this code so it uses something else and works with php 5.1.6?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.