Skip to content

Commit

Permalink
Merge pull request #16 from following5/4356-wpgc-input
Browse files Browse the repository at this point in the history
#4356 abgeschnittene GC-Wegpunkte durch Leerzeicheneingabe
  • Loading branch information
metrax committed Jul 23, 2012
2 parents 5208c23 + cfcd281 commit c65e88f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions htdocs/editcache.php
Expand Up @@ -224,8 +224,9 @@ function getWaypoints($cacheid)
}

$log_pw = isset($_POST['log_pw']) ? mb_substr($_POST['log_pw'], 0, 20) : $cache_record['logpw'];
$wp_gc = isset($_POST['wp_gc']) ? $_POST['wp_gc'] : $cache_record['wp_gc'];
$wp_nc = isset($_POST['wp_nc']) ? $_POST['wp_nc'] : $cache_record['wp_nc'];
// fix #4356: gc waypoints are frequently copy&pasted with leading spaces
$wp_gc = isset($_POST['wp_gc']) ? trim($_POST['wp_gc']) : $cache_record['wp_gc'];
$wp_nc = isset($_POST['wp_nc']) ? trim($_POST['wp_nc']) : $cache_record['wp_nc'];

// name
$name_not_ok = false;
Expand Down
3 changes: 2 additions & 1 deletion htdocs/lang/de/ocstyle/editcache.tpl.php
Expand Up @@ -233,7 +233,8 @@ function toggleAttr(id)

<tr>
<td>{t}Waypoints (optional):{/t}</td>
<td>geocaching.com: <input type="text" name="wp_gc" value="{wp_gc}" maxlength="7" class="input50">
<!-- allow wp_gc copy&paste with leading spaces; will be trimmed later -->
<td>geocaching.com: <input type="text" name="wp_gc" value="{wp_gc}" maxlength="12" class="input50">
navicache.com: <input type="text" name="wp_nc" value="{wp_nc}" maxlength="6" class="input50">
</td>
</tr>
Expand Down
3 changes: 2 additions & 1 deletion htdocs/lang/de/ocstyle/newcache.tpl.php
Expand Up @@ -230,7 +230,8 @@ function toggleAttr(id)

<tr>
<td>{t}Waypoints:{/t}</td>
<td>geocaching.com: <input type="text" name="wp_gc" value="{wp_gc}" maxlength="7" class="input50">
<!-- allow wp_gc copy&paste with leading spaces; will be trimmed later -->
<td>geocaching.com: <input type="text" name="wp_gc" value="{wp_gc}" maxlength="12" class="input50">
navicache.com: <input type="text" name="wp_nc" value="{wp_nc}" maxlength="6" class="input50">
</td>
</tr>
Expand Down
5 changes: 3 additions & 2 deletions htdocs/newcache.php
Expand Up @@ -282,10 +282,11 @@
tpl_set_var('log_pw', htmlspecialchars($log_pw, ENT_COMPAT, 'UTF-8'));

// gc- and nc-waypoints
$wp_gc = isset($_POST['wp_gc']) ? $_POST['wp_gc'] : '';
// fix #4356: gc waypoints are frequently copy&pasted with leading spaces
$wp_gc = isset($_POST['wp_gc']) ? trim($_POST['wp_gc']) : '';
tpl_set_var('wp_gc', htmlspecialchars($wp_gc, ENT_COMPAT, 'UTF-8'));

$wp_nc = isset($_POST['wp_nc']) ? $_POST['wp_nc'] : '';
$wp_nc = isset($_POST['wp_nc']) ? trim($_POST['wp_nc']) : '';
tpl_set_var('wp_nc', htmlspecialchars($wp_nc, ENT_COMPAT, 'UTF-8'));

//difficulty
Expand Down

0 comments on commit c65e88f

Please sign in to comment.