V
V
Vasya Surname2017-10-05 23:46:22
PHP
Vasya Surname, 2017-10-05 23:46:22

How to substitute http links if the user did not set it?

Users forget to copy the link completely
And it turns out in the code that the links work on the site, as internal how to substitute http links if the user inserted the link without it
<a href="youtube.com">youtube.com</a>
<a href="http://youtube.com">youtube.com</a>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vasya Surname, 2017-10-06
@bazilio2010

The medium editor has linkValidation: true which solves all problems

S
Sergey, 2017-10-05
@gangstarcj

No way. Learn how to link properly.
Face the problem that the desired internal link is replaced with an external one

D
driverx18, 2017-10-06
@driverx18

if(substr($url, 0,3) != “http”) {
$url = “ http://“ . $url;
}
Something like this, well, you can also check on https

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question