fixed waypoint-description line-break display in cache listing

... and trimmed trailing cr/lf to avoid surprises on v3.0.5 update
This commit is contained in:
following
2013-03-16 23:32:07 +01:00
parent ed5a744c79
commit 834f25eec8
4 changed files with 4 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ function getWaypoints($cacheid)
$tmpline = mb_ereg_replace('{wp_type}', htmlspecialchars($waypoint['name'], ENT_COMPAT, 'UTF-8'), $tmpline);
$htmlcoordinate = $formatter->formatHtml($waypoint['coordinate'], '</td></tr><tr><td style="white-space:nowrap">');
$tmpline = mb_ereg_replace('{wp_coordinate}', $htmlcoordinate, $tmpline);
$tmpline = mb_ereg_replace('{wp_description}', htmlspecialchars($waypoint['description'], ENT_COMPAT, 'UTF-8'), $tmpline);
$tmpline = mb_ereg_replace('{wp_description}', htmlspecialchars(trim($waypoint['description']), ENT_COMPAT, 'UTF-8'), $tmpline);
$tmpline = mb_ereg_replace('{wp_show_description}', mb_ereg_replace('\r\n','<br />',htmlspecialchars($waypoint['description'], ENT_COMPAT, 'UTF-8')), $tmpline);
$tmpline = mb_ereg_replace('{cacheid}', htmlspecialchars($cacheid, ENT_COMPAT, 'UTF-8'), $tmpline);
$tmpline = mb_ereg_replace('{childid}', htmlspecialchars($waypoint['childid'], ENT_COMPAT, 'UTF-8'), $tmpline);

View File

@@ -348,7 +348,7 @@ function output_cachexml($sWaypoint)
echo 'imagewidth="38" imageheight="38" ';
echo 'latitude="' . xmlentities($waypoint['latitude']) . '" ';
echo 'longitude="' . xmlentities($waypoint['longitude']) . '" ';
echo 'description="' . xmlentities(mb_ereg_replace('\r\n','<br />',htmlentities($waypoint['description'],ENT_NOQUOTES,'UTF-8'))) . '" />\n';
echo 'description="' . xmlentities(mb_ereg_replace('\r\n','<br />',htmlentities(trim($waypoint['description']),ENT_NOQUOTES,'UTF-8'))) . '" />\n';
}
echo ' </cache>\n';

View File

@@ -332,7 +332,7 @@
<tr bgcolor="{cycle values="#ffffff,#eeeeee"}">
<td width="25%"><table cellspacing="0" cellpadding="0"><tr><td><img src="{$childWaypoint.image}" /></td><td>{$childWaypoint.name|escape}</td></tr></table></td>
<td width="18%">{$childWaypoint.coordinateHtml}</td>
<td>{$childWaypoint.description|escape}</td>
<td>{$childWaypoint.description|escape|replace:"\r\n":"<br />"}</td>
</tr>
{/foreach}
</table>

View File

@@ -30,6 +30,7 @@ function getChildWaypoints($cacheid)
for ($i = 0; $i < $count; $i++)
{
$waypoints[$i]['coordinateHtml'] = $formatter->formatHtml($waypoints[$i]['coordinate'], '<br />');
$waypoints[$i]['description'] = trim($waypoints[$i]['description']);
}
}