Skip to content

Commit 710c14f

Browse files
committed
gppa-populate-child-entries.php: Fixed an issue with missing cookie values.
1 parent 2c1ba68 commit 710c14f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gp-populate-anything/gppa-populate-child-entries.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ public function populate_parent_entry_id( $value, $field ) {
7070
// try to find cookie, if available.
7171
if ( ! $cookie ) {
7272
$cookie_name = 'gpnf_form_session_';
73-
$pattern = '/^' . preg_quote( $cookie_name, '/' ) . '[\w\W]*/';
74-
$matches = preg_grep($pattern, array_keys($_COOKIE));
73+
$pattern = '/^' . preg_quote( $cookie_name, '/' ) . '[\w\W]*/';
74+
$matches = preg_grep( $pattern, array_keys( $_COOKIE ) );
7575
if ( ! empty( $matches ) ) {
7676
foreach ( $matches as $matched_cookie ) {
7777
$cookie = json_decode(stripslashes( $_COOKIE[ $matched_cookie ] ), true);

0 commit comments

Comments
 (0)