Removed deprecated e-modifier from preg_replace calls.
Details
- general note:
- if possible, repeat all tests with 5.3 and 5.6+ php versions
- after testing with 5.6+ php version additionally confirm, that no records were added to the System Log, because usage of "e" modifier, if not fixed, produces notice record in the System Log
- in Admin Console:
- go to Tools → Query Database section
- run SQL UPDATE inp_EmailTemplates SET l1_HtmlBody = CONCAT(l1_HtmlBody, '®') WHERE TemplateName = 'TOPIC.ADD' AND Type = 1; to add HTML representation of registered trade mark sign, to the end of particular e-mail template
- go to User Management → Users section
- create new user
- on Front-End:
- login with newly created user
- click on Forums top menu entry
- click on the "New Topic" link in the sidebar's "Action Box" section
- fill all required fields and in the Message Body field type before [B]bold[/B] after [CODE]Test [B]Co[/B]de[/CODE] before [B]bold[/B] [URL HREF=http://www.google.com]the link[/URL] after text
- uncheck "Disable BBCodes" checkbox
- submit form (click "Create" button)
- go to "My Topics" page
- click on the "Details" link of just created topic
- confirm that BBCodes outside of [CODE]...[/CODE] block were evaluated (means text is bold partially and link is clickable)
- confirm that BBCodes inside of [CODE]...[/CODE] block weren't evaluated (the BBCodes are displayed with [ replaced with < and ] replaced with >)
- in Admin Console:
- go to the Website & Content → Logs & Reports → Email Log section
- confirm that TOPIC.ADD Admin e-mail was sent
- View details of TOPIC.ADD Admin e-mail
- confirm, that "Text Version" value has copyright symbol at the end
Diff Detail
- Repository
- rINP In-Portal
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Also in test plan instead of asking to add © to PHP code ask to add it directly to email template body, that will be sent. This is how it works in real life.
core/kernel/utility/email_send.php | ||
---|---|---|
714 ↗ | (On Diff #817) | This doesn't look like something, that will work on PHP 5.3, because late static binding (the stuff that makes $this work in callbacks) was introduced only in PHP 5.4. Have you tested (debugged) this on PHP 5.3 as well and no notices were triggered? You can use approach like this: $that = $this; ... function ($matches) use ($that) { return $that->_safeCharEncode(... |
modules/in-bulletin/units/helpers/post_helper.php | ||
25–30 ↗ | (On Diff #817) | Remove. See below why. |
300 ↗ | (On Diff #817) | Instead of defining class property use same closure approach as in email_send.php file. |
301 ↗ | (On Diff #817) | This will work, but would trigger a notice on each use, because replaceCodeBBCode isn't a string. |
411 ↗ | (On Diff #817) | Please replace protected with public. All callbacks must have public visibility even if they're used only within same class. |
core/kernel/utility/email_send.php | ||
---|---|---|
714 ↗ | (On Diff #817) |
|
modules/in-bulletin/units/helpers/post_helper.php | ||
---|---|---|
410 ↗ | (On Diff #818) | Since the $matches argument is an array it must have array typehint (the array $matches instead of just $matches). |
core/kernel/utility/email_send.php | ||
---|---|---|
714 ↗ | (On Diff #817) | Maybe it's called differently. I've tested that on PHP 5.3 attempt to use $this in closures would fail: https://3v4l.org/snQZe |
modules/in-bulletin/units/helpers/post_helper.php | ||
---|---|---|
282 ↗ | (On Diff #819) |
Not everything was fixed. |
Also in test plan:
- specify, that PHP 5.6+ needs to be used
- confirm, that no records were added to the System Log