View Issue Details

IDProjectCategoryView StatusLast Update
0015235phplist applicationSubscribe Processpublic12-08-09 09:34
Reporterlwc 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
Product Version2.11.2-RC1 
Target Version4.0.xFixed in Version 
Summary0015235: Accept more $_GET parameters in subscribelib2.php
DescriptionYou already accept $_REQUEST['email'] and $_REQUEST['emailconfirm'] so there's no reason not accept defaults via $_GET parameters for the other two fields:

1) Allow ?p=subscribe&list[x]=signup

function ListAvailableLists...

  if (isset($_POST['list'])) {
    $list = $_POST["list"];
// custom code - start
  } elseif (!isset($_POST["subscribe"]) && isset($_GET['list'])) {
    $list = $_GET["list"];
// custom code - end
  } else...

2) Allow ?p=subscribe&htmlemail=1

function ListAttributes...

    if (isset($_POST['htmlemail'])) {
      $htmlemail = $_POST["htmlemail"];
// custom code - start
    } elseif (!isset($_POST["subscribe"]) && isset($_GET['htmlemail'])) {
      $htmlemail = $_GET["htmlemail"];
// custom code - end
    }
Additional InformationNote that you should NOT under any cirumstances "just" use $_REQUEST for "list" and "htmlemail" because it would turn them into required fields!

That's why this request also fixes request 11011
TagsNo tags attached.

Relationships

related to 0011011 new Preselection of one, all or some lists per subscribe-page url 
related to 0015236 new Support for defining a default for "htmlemail" 

Activities

lwc

18-02-09 13:38

reporter   ~0050506

Please add relationship to 0011011

lwc

12-08-09 09:34

reporter   ~0050712

Here's a more complicated but much more friendly solution for 1):

1) Allow ?p=subscribe&list=x,y,z (or just list=x)

function ListAvailableLists...

  if (isset($_POST['list'])) {
    $list = $_POST["list"];
// custom code - start
  } elseif (!isset($_POST["subscribe"]) && isset($_GET['list'])) {
    $list_value = "signup";
    $list_values = explode(",", $_GET["list"]);
    if (function_exists(array_fill_keys)) // Only in PHP 5+
      $list = array_fill_keys($list_values, $list_value);
    else // For PHP 4, per phplist's current system requirements
      foreach($list_values as $key=>$value)
          $list[$value] = $list_value;
// custom code - end
  } else...