From 016a1caddefbe94e709ceea258cd363d35d7dddb Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 2 Dec 2016 11:05:20 +0100 Subject: [PATCH] allow to preset variables via get parameters --- addressbook/inc/class.addressbook_contactform.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addressbook/inc/class.addressbook_contactform.inc.php b/addressbook/inc/class.addressbook_contactform.inc.php index dadcc422bb..55cec5be4a 100644 --- a/addressbook/inc/class.addressbook_contactform.inc.php +++ b/addressbook/inc/class.addressbook_contactform.inc.php @@ -60,6 +60,11 @@ class addressbook_contactform */ function display_var(array &$content=null,$addressbook=null,$fields=null,$msg=null,$email=null,$tpl_name=null,$subject=null,$copytoreceiver=false,$sel_options=array()) { + // allow to preset variables via get parameters + if ($_SERVER['REQUEST_METHOD'] == 'GET') + { + $content = array_merge($_GET, (array)$content); + } #error_log( "

addressbook_contactform::display(".print_r($content,true).",$addressbook,".print_r($fields,true).",$msg,$tpl_name)

\n"); if (empty($tpl_name) && !empty($content['tpl_form_name'])) $tpl_name =$content['tpl_form_name']; $tpl = new etemplate($tpl_name ? $tpl_name : 'addressbook.contactform');