benedmunds / CodeIgniter-Ion-Auth

Simple and Lightweight Auth System for CodeIgniter
http://benedmunds.com/ion_auth/
MIT License
2.34k stars 1.14k forks source link

IonAuthModel messagesArray() shuldn't output formated HTML #1496

Closed wntechs closed 3 years ago

wntechs commented 3 years ago

Which branch are you using? 4

What commit hash are you on? b5ab91268177d58bd0c30dde3cd11c71f6db26a6

What CodeIgniter version are you using? v4

What PHP version are you using? PHP 7.2

Post your Ion Auth config below

Config goes here

Describe the bug The IonAuthModel has a function messagesArray() which is supposed to return the message array of string but it is outputing the message template as well in addition to returning array.

To Reproduce Steps to reproduce the behavior:

  1. Extend your controller with IonAuth\Controllers\Auth
  2. Call $this->ionAuth->messages() method in any of the function in your method which yeilds a success message.
  3. print the response from step 2.
  4. See error

Expected behavior The function should only return array of success message string and shouldn't output anything as there is already another method provided for output purpose.

benedmunds commented 3 years ago

Thanks for reporting this.

I just committed a fix here: 8c7cb28b739102da7d9f84b86e9af945058c7575

Please try it out when you can.