Author
|
zPlus <-->
2016-11-29 10:12:28
|
Committer
|
zPlus <-->
2016-11-29 10:12:28
|
Commit
|
508039b
(patch)
|
Tree
|
eb9df0a
|
Parent(s)
|
|
edit.php: Remove 'http://' prefix from empty links
commits diff:
ed534f6..508039b
1 file changed,
9 insertions,
4 deletions
—
download
Diffstat
Diff options
+9/-4
M edit.php
73
|
73
|
|
if (strlen ($new_post_data['title']) == 0)
|
74
|
74
|
|
$new_post_data['title'] = $post['title'];
|
75
|
75
|
|
|
76
|
|
- |
// Add "http://" if URL scheme is missing
|
77
|
|
- |
$link_components = parse_url ($new_post_data['link']);
|
78
|
|
- |
if (!isset ($link_components['scheme']))
|
79
|
|
- |
$new_post_data['link'] = 'http://' . $new_post_data['link'];
|
|
76
|
+ |
// If no link given, keep an empty string
|
|
77
|
+ |
if (strlen ($new_post_data['link']) > 0)
|
|
78
|
+ |
{
|
|
79
|
+ |
$link_components = parse_url ($new_post_data['link']);
|
|
80
|
+ |
|
|
81
|
+ |
// Make sure there's a "scheme"
|
|
82
|
+ |
if (!isset ($link_components['scheme']))
|
|
83
|
+ |
$new_post_data['link'] = 'http://' . $new_post_data['link'];
|
|
84
|
+ |
}
|
80
|
85
|
|
|
81
|
86
|
|
$db->edit_post (
|
82
|
87
|
|
$new_post_data['title'],
|