PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
← All changes | src/controller/class-activity-log.php +5 -5 6.1.0 → 6.3.0 View file →
@@ -101,9 +101,9 @@
101 101 * @return bool True if the notification was successfully stored, false otherwise.
102 102 */
103 103 public function record_log( $notification ) {
104 104 $sanitized_notification = $this->sanitize_notification( $notification );
105 - if ( empty( $sanitized_notification ) ) {
105 + if ( array() === $sanitized_notification ) {
106 106 return false;
107 107 }
108 108
109 109 $notifications = $this->get_notifications();
@@ -183,10 +183,10 @@
183 183 * @param mixed $notification Notification data.
184 184 *
185 185 * @return array{id: string, timestamp: string|int, type: string, content: string, url: string}
186 186 */
187 - private function sanitize_notification( $notification ) {
188 - if ( empty( $notification['content'] ) ) {
187 + private function sanitize_notification( $notification ): array {
188 + if ( ! isset( $notification['content'] ) || '' === $notification['content'] ) {
189 189 return array();
190 190 }
191 191 // Sanitize and ensure all expected fields exist.
192 192 $sanitized = array();
@@ -209,9 +209,9 @@
209 209 * @return array Sanitized notification data.
210 210 */
211 211 private function sanitize_notification_for_ui( $notification ) {
212 212 $sanitized = $this->sanitize_notification( $notification );
213 - if ( empty( $sanitized['content'] ) ) {
213 + if ( ! isset( $sanitized['content'] ) || '' === $sanitized['content'] ) {
214 214 return array();
215 215 }
216 216
217 217 return $sanitized;
@@ -224,9 +224,9 @@
224 224 */
225 225 private function get_notifications_for_ui(): array {
226 226 $notifications = $this->get_notifications();
227 227
228 - if ( empty( $notifications ) ) {
228 + if ( array() === $notifications ) {
229 229 $this->record_log(
230 230 array(
231 231 'module' => 'defender',
232 232 'content' => esc_html__( 'Welcome to Defender', 'defender-security' ),