This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Problem with ä,ö,ü,ß..
#11

Hi kooler,

I'm not very familiar with IDNs so I don't know whether the following solution will help. I haven't tested it.

If you have PHP 5.3 (or above) and the intl PHP extension loaded, you might be able to make use of the idn_to_ascii function.

Open /comments/includes/functions/processor.php and add the part in red:

Quote:function cmtx_validate_email ($email) { //checks whether email address was valid

$email = idn_to_ascii($email);

if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
cmtx_error(CMTX_ERROR_MESSAGE_INVALID_EMAIL); //reject user for invalid email address
}

} //end of validate-email function

Have you completed the interview?
Reply
#12

It works well.

I have furthermore added the part in red:

Quote:function cmtx_validate_website ($website) { //checks whether website was valid

$website_valid = true; //initialise flag as true

$website = idn_to_ascii($website);

if (!filter_var($website, FILTER_VALIDATE_URL)) {
$website_valid = false; //set flag as false
}

if (cmtx_setting('validate_website_ping')) { //if website should be pinged

$headers = @get_headers($website);

if ($headers[0] == "HTTP/1.1 404 Not Found") {
$website_valid = false; //set flag as false
}

} //end of if-website-should-be-pinged

if (!$website_valid) { //if invalid website was entered
cmtx_error(CMTX_ERROR_MESSAGE_INVALID_WEBSITE); //reject user for invalid website address
}

} //end of validate-website function

And it works well, too.

Thank you once again.
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
23-Nov-2017, 08:09 PM
Last Post by Steven
20-Jul-2013, 01:22 PM
Last Post by Steven
19-Mar-2013, 02:37 PM
Last Post by Steven
02-Jul-2012, 08:19 PM
Last Post by geese10
16-Nov-2011, 12:02 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)