From 9dfd54c8bf0591a4ba41d701bb0dd5199ac8ce47 Mon Sep 17 00:00:00 2001 From: Ra Date: Sat, 12 Dec 2015 12:21:35 +0100 Subject: [PATCH] In some cases $cf['value'] may not be present. On some old themes $cf['value'] is not present and will throw eventually an uncontrolled exception. --- include/wpml-config.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/wpml-config.php b/include/wpml-config.php index 1aa2501..b33c266 100644 --- a/include/wpml-config.php +++ b/include/wpml-config.php @@ -248,7 +248,8 @@ public function copy_post_metas($metas, $sync) { if ('copy' == $cf['attributes']['action'] || (!$sync && 'translate' == $cf['attributes']['action'])) $metas[] = $cf['value']; else - $metas = array_diff($metas, array($cf['value'])); + if (isset($cf['value'])) + $metas = array_diff($metas, array($cf['value'])); } } return $metas;