PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
← All changes | templates/pdf/voucher.php +14 -3 3.0.11 → 3.0.16 View file →
@@ -1,8 +1,19 @@
1 1 <?php
2 2
3 3 $companyName = (string) ($company_name ?? '');
4 4 $companyAddress = (string) ($company_address ?? '');
5 +// Settings keep the business address in separate fields (street, city, state,
6 +// postcode, country); documents only ever printed the street, so everything after
7 +// it was missing and the address looked cut off at its last line. Prefer the
8 +// composed lines, falling back to the raw street for any caller not passing them.
9 +$companyAddressLines = (isset($company_address_lines) && is_array($company_address_lines))
10 + ? array_values(array_filter(array_map('strval', $company_address_lines), static function ($line) {
11 + return trim($line) !== '';
12 + }))
13 + : array_values(array_filter(preg_split('/\R/', $companyAddress) ?: [], static function ($line) {
14 + return trim($line) !== '';
15 + }));
5 16 $companyEmail = (string) ($company_email ?? '');
6 17 $companyPhone = (string) ($company_phone ?? '');
7 18
8 19 $customerName = (string) ($customer_name ?? '');
@@ -138,11 +149,11 @@
138 149 </td>
139 150 <td style="width: 30%;">
140 151 <h3><?php esc_html_e('Company', 'yatra'); ?></h3>
141 152 <div><?php echo htmlspecialchars($companyName, ENT_QUOTES, 'UTF-8'); ?></div>
142 - <?php if ($companyAddress !== ''): ?>
143 - <div class="muted"><?php echo htmlspecialchars($companyAddress, ENT_QUOTES, 'UTF-8'); ?></div>
144 - <?php endif; ?>
153 + <?php foreach ($companyAddressLines as $companyAddressLine): ?>
154 + <div class="muted"><?php echo htmlspecialchars($companyAddressLine, ENT_QUOTES, 'UTF-8'); ?></div>
155 + <?php endforeach; ?>
145 156 <?php if ($companyEmail !== ''): ?>
146 157 <div class="muted"><?php echo htmlspecialchars($companyEmail, ENT_QUOTES, 'UTF-8'); ?></div>
147 158 <?php endif; ?>
148 159 <?php if ($companyPhone !== ''): ?>