Skip to content

Commit 1716ffe

Browse files
authored
Merge pull request #75 from kosminen/master
Empty string bug fix
2 parents 12e3f4f + 2b3584a commit 1716ffe

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

classes/class-cpt-wplf-submission.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,10 @@ function metabox_submission() {
263263

264264
// Show a link if the field corresponds to a URL
265265
// assume values starting with '/' are root relative URLs and should be handled as links
266-
$value_is_url = $value[0] === '/' ? true : filter_var( $value, FILTER_VALIDATE_URL );
266+
$value_is_url = false;
267+
if ( strlen( $value ) > 0 ) {
268+
$value_is_url = $value[0] === '/' ? true : filter_var( $value, FILTER_VALIDATE_URL );
269+
}
267270
if ( $value_is_url ) {
268271
$link_text = __( 'Open Link', 'wp-libre-form' );
269272
$possible_link = '<a target="_blank" href="' . $value . '" style="float:right">' . $link_text . '</a>';

0 commit comments

Comments
 (0)