PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.0
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.0
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
← All changes | back/Controllers/EntitySelectController.php +23 -6 10.2.2 → 11.1.0 View file →
@@ -40,8 +40,12 @@
40 40 if (empty($entity) || (empty($offset) && 0 !== $offset) || empty($perCalls)) {
41 41 return ['error' => acym_translation('ACYM_MISSING_PARAMETERS')];
42 42 }
43 43
44 + if (!in_array($entity, ['list', 'user'])) {
45 + return ['error' => acym_translation('ACYM_UNAUTHORIZED_ACCESS')];
46 + }
47 +
44 48 $entityParams = [
45 49 'offset' => $offset,
46 50 'elementsPerPage' => $perCalls,
47 51 'entitySelect' => true,
@@ -48,10 +52,17 @@
48 52 ];
49 53 if ($entity === 'list') {
50 54 $entityParams['status'] = 'active';
51 55 }
52 - if (!empty($join)) $entityParams['join'] = $join;
53 - if (!empty($columnsToDisplay)) $entityParams['columns'] = $columnsToDisplay;
56 + if (!empty($join)) {
57 + $entityParams['join'] = $join;
58 + }
59 + if (!empty($columnsToDisplay)) {
60 + foreach ($columnsToDisplay as $column) {
61 + acym_secureDBColumn($column);
62 + }
63 + $entityParams['columns'] = $columnsToDisplay;
64 + }
54 65
55 66 if ('list' === $entity) {
56 67 $entityParams['columns'][] = 'description';
57 68 }
@@ -60,9 +71,9 @@
60 71 $entityParams['creator_id'] = acym_currentUserId();
61 72 }
62 73
63 74 $namespaceClass = 'AcyMailing\\Classes\\'.ucfirst($entity).'Class';
64 - $entityClass = new $namespaceClass;
75 + $entityClass = new $namespaceClass();
65 76
66 77 $availableEntity = $entityClass->getMatchingElements($entityParams);
67 78
68 79 $this->formatEntites($availableEntity, $entity);
@@ -75,15 +86,21 @@
75 86 if ($entity === 'list') {
76 87 foreach ($availableEntity['elements'] as $key => $element) {
77 88 $availableEntity['elements'][$key]->color = '<i style="color: '.$element->color.'" class="acym_subscription acymicon-circle">';
78 89 if (!empty($element->description)) {
79 - $availableEntity['elements'][$key]->name = $element->name.acym_info($element->description);
90 + ob_start();
91 + acym_info(['textShownInTooltip' => $element->description]);
92 + $tooltip = ob_get_clean();
93 + $availableEntity['elements'][$key]->name = $element->name.$tooltip;
80 94 }
81 95 }
82 96 } elseif ($entity === 'user') {
83 97 foreach ($availableEntity['elements'] as $key => $element) {
84 - $availableEntity['elements'][$key]->email = $element->email.'<span class="acym__hover__user_info" data-id="'.$availableEntity['elements'][$key]->id.'">
85 - '.acym_info('<i class="acymicon-circle-o-notch acymicon-spin"></i>').'
98 + ob_start();
99 + acym_info(['textShownInTooltip' => '<i class="acymicon-circle-o-notch acymicon-spin"></i>']);
100 + $tooltip = ob_get_clean();
101 + $availableEntity['elements'][$key]->email = $element->email.'<span class="acym__hover__user_info" data-id="'.esc_attr($availableEntity['elements'][$key]->id).'">
102 + '.$tooltip.'
86 103 </span>';
87 104 }
88 105 }
89 106 }