Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
function sanitize_filename($str) {
// Allow only alphanumeric characters, hyphen, and dot in file names
// Spaces will be changed to dashes, special chars will be suppressed, & the rest will be replaced with underscores
$special_chars = array ('#', '$', '%', '^', '&', '*', '!', '~', '"', '\'', '=', '?', '/', '[', ']', '(', ')', '|', '<', '>', ';', ':', '\\', ', ');
$str = str_replace($special_chars, '', $str);
$str = str_replace(' ', '-', $str);
return preg_replace("/[^a-zA-Z0-9\-\.]/", "_", $str);
}
function sanitize_filename($str) {
// Allow only alphanumeric characters, hyphen, and dot in file names
// Spaces will be changed to dashes, special chars will be suppressed, & the rest will be replaced with underscores
$special_chars = array ('#', '$', '%', '^', '&', '*', '!', '~', '"', '\'', '=', '?', '/', '[', ']', '(', ')', '|', '<', '>', ';', ':', '\\', ', ');
$str = str_replace($special_chars, '', $str);
$str = str_replace(' ', '-', $str);
$str = preg_replace("/[^a-zA-Z0-9\-\.]/", "_", $str);
if (intval($config['truncate']) > 0 && isset($str{intval($config['truncate'])})) {
$str = substr($str, 0, intval($config['truncate']));
}
return $str;
}
Posted By: andrewjs18getting this error:Sorry, I should have checked my work. I missed an equals (=) sign on the 6th line from the bottom. I fixed my post above, so you can re-copy it and it should work for you.
Parse error: syntax error, unexpected T_STRING in /home/uglycars/public_html/uglycars/gallery/plog-includes/plog-functions.php on line 1388
Posted By: sidtheduckPosted By: andrewjs18getting this error:Sorry, I should have checked my work. I missed an equals (=) sign on the 6th line from the bottom. I fixed my post above, so you can re-copy it and it should work for you.
Parse error: syntax error, unexpected T_STRING in /home/uglycars/public_html/uglycars/gallery/plog-includes/plog-functions.php on line 1388
function sanitize_filename($str) {
global $config;
// Allow only alphanumeric characters, hyphen, and dot in file names
// Spaces will be changed to dashes, special chars will be suppressed, & the rest will be replaced with underscores
$special_chars = array ('#', '$', '%', '^', '&', '*', '!', '~', '"', '\'', '=', '?', '/', '[', ']', '(', ')', '|', '<', '>', ';', ':', '\\', ', ');
$str = str_replace($special_chars, '', $str);
$str = str_replace(' ', '-', $str);
$str = preg_replace("/[^a-zA-Z0-9\-\.]/", "_", $str);
if (intval($config['truncate']) > 0 && isset($str{intval($config['truncate'])})) {
$str = substr($str, 0, intval($config['truncate']));
}
return $str;
}
1 to 18 of 18