tschoffelen / php-pkpass

đź’ł PHP class for creating passes for Wallet on iOS.
https://includable.com
MIT License
916 stars 186 forks source link

backFields value newline support #96

Closed GuntisTreulands closed 5 years ago

GuntisTreulands commented 5 years ago

Expected Behavior

Based on Passbook documentation and this: https://stackoverflow.com/questions/14333919/passbook-pass-not-enter-newline-using-r-n It's expected to be able to add newlines, to better format backFields values.

This can be also seen to be true in this passbook example: https://r.pass.is/DC66BgbTQAUP/d

Actual Behavior

However, when I try to create my own passbook, it does not parse newlines, and just leave them.

Organisation.pkpass.zip

Steps to Reproduce the Problem

I am simply providing this in the $data

'backFields' => [ [ 'key' => 'terms', 'label' => 'Terms', 'value' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries,\n\n\n but also the leap into electronic typesetting, remaining essentially unchanged. \n\n\nIt was popularised in the 1960s with the release of Letraset sheets containing Lorem \n\n\nIpsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.' ] ]

tschoffelen commented 5 years ago

To use newlines in PHP like that you need to use double quotes instead of single quotes! Doesn’t have anything to do with this library specifically, just the way PHP works.

GuntisTreulands commented 5 years ago

Thank you, that indeed solved the problem!

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.