if(! function_exists('validate_email')) {
function validate_email($addr) {
+ if(get_config('system','disable_email_validation'))
+ return true;
+
if(! strpos($addr,'@'))
return false;
$h = substr($addr,strpos($addr,'@') + 1);
$s = htmlspecialchars_decode($s);
$matches = null;
- $c = preg_match_all('/\[img\](.*?)\[\/img\]/ism',$s,$matches,PREG_SET_ORDER);
+ $c = preg_match_all('/\[img.*?\](.*?)\[\/img\]/ism',$s,$matches,PREG_SET_ORDER);
if($c) {
require_once('include/Photo.php');
foreach($matches as $mtch) {
$scaled = $mtch[1];
$i = fetch_url($scaled);
+ $cache = get_config('system','itemcache');
+ if (($cache != '') and is_dir($cache)) {
+ $cachefile = $cache."/".hash("md5", $scaled);
+ file_put_contents($cachefile, $i);
+ }
+
// guess mimetype from headers or filename
$type = guess_image_type($mtch[1],true);
}
}
}
+
+ // replace the special char encoding
+
+ $s = htmlspecialchars($s,ENT_QUOTES,'UTF-8');
return $s;
}