media Posted December 25, 2016 Share Posted December 25, 2016 I have a site using a directory engine and I have just realized that link starts with secure https cannot be registered... The Code is checking that is here, but I do not how to correct (Note: Vendor went out of business no help on that side) if (0 !== strpos($field_value, 'http://')) { $field_value = 'http://' . $field_value; } 1. Directory Listing - Like a search engine, people add their website with URL When they add URL with http://www.yahoo.com it is ok but when they add their url as https://www.yahoo.com it is giving error message Complete code elseif ($field_name == 'url') { if (0 !== strpos($field_value, 'http://')) { $field_value = 'http://' . $field_value; } if ($value['required'] && !esynValidator::isUrl($field_value)) { $error = true; $msg[] = $esynI18N['error_url']; } elseif (!$value['required'] && (empty($_POST['url']) || ('http://' == $_POST['url']))) { $listing['domain'] = ''; $listing['listing_header'] = '200'; } } How can I get both http and https work??? Thanks Link to comment Share on other sites More sharing options...
Ahmad E. Posted December 25, 2016 Share Posted December 25, 2016 If I understand the limitation correctly, something like this should this should work: if ( 0 !== strpos($field_value, 'http://') && 0 !== strpos($field_value, 'https://') ) { $field_value = 'http://' . $field_value; } Link to comment Share on other sites More sharing options...
media Posted December 26, 2016 Author Share Posted December 26, 2016 5 hours ago, Ahmad E. said: If I understand the limitation correctly, something like this should this should work: if ( 0 !== strpos($field_value, 'http://') && 0 !== strpos($field_value, 'https://') ) { $field_value = 'http://' . $field_value; } Thank you Ahmad... Thank you thank you thank you... It worked... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.