phplist

NOTE:: Before reporting an issue, make sure you are running the latest version, currently 3.3.1


View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015235phplist applicationSubscribe Processpublic18-02-09 13:3712-08-09 09:34
Reporterlwc 
PrioritynormalSeverityfeatureReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
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.
Attached Files

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

-  Notes
(0050506)
lwc (reporter)
18-02-09 13:38

Please add relationship to 0011011
(0050712)
lwc (reporter)
12-08-09 09:34

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...


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker