1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

entitify quotes and use utf8 (patch by Johannes)

This commit is contained in:
Hannes Magnusson
2007-06-04 16:57:57 +00:00
parent 62624d8f57
commit b41ebd4228
2 changed files with 14 additions and 14 deletions

10
cal.php
View File

@@ -30,13 +30,13 @@ if ($cy != 0 && !valid_year($cy)) {
if ($id) {
// Try to load event by ID and display header and info for that event
if ($event = load_event($id)) {
site_header("Event: " . stripslashes(htmlentities($event['sdesc'])));
site_header("Event: " . stripslashes(htmlentities($event['sdesc'], ENT_QUOTES, 'UTF-8')));
display_event($event, 0);
$begun = TRUE;
}
// Unable to find event, put this to the error messages' list
else {
$errors[] = "There is no event for specified id ('".htmlentities($id)."')";
$errors[] = "There is no event for specified id ('".htmlentities($id, ENT_QUOTES, 'UTF-8')."')";
}
}
@@ -68,14 +68,14 @@ elseif ($cy && $cm && $cd) {
// Wrong date specified
else {
$errors[] = "The specified date (".htmlentities("$cy/$cm/$cd").") was not valid.";
$errors[] = "The specified date (".htmlentities("$cy/$cm/$cd", ENT_QUOTES, 'UTF-8').") was not valid.";
unset($cm); unset($cd); unset($cy);
}
}
// Check if month and year is valid
if ($cm && $cy && !checkdate($cm,1,$cy)) {
$errors[] = "The specified year and month (".htmlentities("$cy, $cm").") are not valid.";
$errors[] = "The specified year and month (".htmlentities("$cy, $cm", ENT_QUOTES, 'UTF-8').") are not valid.";
unset($cm); unset($cy);
}
@@ -221,7 +221,7 @@ function display_events_for_day($day, $events)
($COUNTRY == $event['country'] ? "<strong>" : ""),
'<a class="cat' . $event['category'] . '" href="/cal.php',
"?id=$event[id]&amp;cm=$cm&amp;cy=$cy", '">',
stripslashes(htmlentities($event['sdesc'])),
stripslashes(htmlentities($event['sdesc'], ENT_QUOTES, 'UTF-8')),
'</a>',
($COUNTRY == $event['country'] ? "</strong>" : ""),
'</div>';

View File

@@ -167,8 +167,8 @@ if ($process) {
<th class="subr">Start Date</th>
<td>
<select name="smonth"><option></option><?php display_options($months, $_POST['smonth'])?></select>
<input type="text" name="sday" size="2" maxlength="2" value="<?php echo htmlentities($_POST['sday'])?>" />
<input type="text" name="syear" size="4" maxlength="4" value="<?php echo $_POST['syear'] ? htmlentities($_POST['syear']) : date("Y")?>" />
<input type="text" name="sday" size="2" maxlength="2" value="<?php echo htmlentities($_POST['sday'], ENT_QUOTES, 'UTF-8')?>" />
<input type="text" name="syear" size="4" maxlength="4" value="<?php echo $_POST['syear'] ? htmlentities($_POST['syear'], ENT_QUOTES, 'UTF-8') : date("Y")?>" />
<input type="radio" id="single" name="type" value="single"<?php if ($_POST['type'] == 'single' || !$_POST['type']) echo ' checked="checked"';?> />
<label for="single">One day (no end-date required)</label>
</td>
@@ -177,8 +177,8 @@ if ($process) {
<th class="subr">End Date</th>
<td>
<select name="emonth"><option></option><?php display_options($months, $_POST['emonth'])?></select>
<input type="text" name="eday" size="2" maxlength="2" value="<?php echo htmlentities($_POST['eday'])?>" />
<input type="text" name="eyear" size="4" maxlength="4" value="<?php echo $_POST['eyear'] ? htmlentities($_POST['eyear']) : date("Y")?>" />
<input type="text" name="eday" size="2" maxlength="2" value="<?php echo htmlentities($_POST['eday'], ENT_QUOTES, 'UTF-8')?>" />
<input type="text" name="eyear" size="4" maxlength="4" value="<?php echo $_POST['eyear'] ? htmlentities($_POST['eyear'], ENT_QUOTES, 'UTF-8') : date("Y")?>" />
<input type="radio" id="multi" name="type" value="multi"<?php if ($_POST['type'] == 'multi') echo ' checked="checked"';?> />
<label for="multi">Multi-day event</label>
</td>
@@ -194,11 +194,11 @@ if ($process) {
</tr>
<tr>
<th class="subr">Short Description</th>
<td><input type="text" name="sdesc" class="max" value="<?php echo htmlentities($_POST['sdesc'])?>" size="32" maxlength="32" /></td>
<td><input type="text" name="sdesc" class="max" value="<?php echo htmlentities($_POST['sdesc'], ENT_QUOTES, 'UTF-8')?>" size="32" maxlength="32" /></td>
</tr>
<tr>
<th class="subr">URL</th>
<td><input type="text" name="url" size="40" maxlength="128" class="max" value="<?php echo htmlentities($_POST['url'])?>" /></td>
<td><input type="text" name="url" size="40" maxlength="128" class="max" value="<?php echo htmlentities($_POST['url'], ENT_QUOTES, 'UTF-8')?>" /></td>
</tr>
<tr>
<th class="subr">Country</th>
@@ -223,13 +223,13 @@ if ($process) {
<tr>
<th class="subr">Email</th>
<td>
<input type="text" name="email" size="40" maxlength="128" class="max" value="<?php echo htmlentities($_POST['email'])?>" /><br />
<input type="text" name="email" size="40" maxlength="128" class="max" value="<?php echo htmlentities($_POST['email'], ENT_QUOTES, 'UTF-8')?>" /><br />
<small>This email address is only used to contact you about the listing, it will not displayed along with the listing.</small>
</td>
</tr>
<tr>
<th class="subr">Long Description</th>
<td><textarea name="ldesc" cols="60" rows="10" wrap="virtual" class="max"><?php echo htmlentities($_POST['ldesc']);?></textarea></td>
<td><textarea name="ldesc" cols="60" rows="10" wrap="virtual" class="max"><?php echo htmlentities($_POST['ldesc'], ENT_QUOTES, 'UTF-8');?></textarea></td>
</tr>
<tr>
<th colspan="2">
@@ -250,7 +250,7 @@ function display_options($options, $current)
foreach ($options as $k => $v) {
echo '<option value="', $k, '"',
($k == $current ? ' selected="selected"' : ''),
'>', htmlentities($v), "</option>\n";
'>', htmlentities($v, ENT_QUOTES, 'UTF-8'), "</option>\n";
}
}