cvs: phpweb / cal.php submit-event.php
| From: | Hannes Magnusson | Date: | Mon, 04 Jun 2007 16:57:57 +0000 |
| Subject: | cvs: phpweb / cal.php submit-event.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-35604@lists.php.net to get a copy of this message | ||
bjori Mon Jun 4 16:57:57 2007 UTC
Modified files:
/phpweb submit-event.php cal.php
Log:
entitify quotes and use utf8 (patch by Johannes)
http://cvs.php.net/viewvc.cgi/phpweb/submit-event.php?r1=1.35&r2=1.36&diff_format=u
Index: phpweb/submit-event.php
diff -u phpweb/submit-event.php:1.35 phpweb/submit-event.php:1.36
--- phpweb/submit-event.php:1.35 Sun Feb 11 14:37:44 2007
+++ phpweb/submit-event.php Mon Jun 4 16:57:57 2007
@@ -1,5 +1,5 @@
<?php
-// $Id: submit-event.php,v 1.35 2007/02/11 14:37:44 bjori Exp $
+// $Id: submit-event.php,v 1.36 2007/06/04 16:57:57 bjori Exp $
$_SERVER['BASE_PAGE'] = 'submit-event.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/posttohost.inc';
@@ -167,8 +167,8 @@
<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 @@
<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 @@
</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 @@
<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 @@
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";
}
}
http://cvs.php.net/viewvc.cgi/phpweb/cal.php?r1=1.47&r2=1.48&diff_format=u
Index: phpweb/cal.php
diff -u phpweb/cal.php:1.47 phpweb/cal.php:1.48
--- phpweb/cal.php:1.47 Wed Dec 31 13:04:27 2003
+++ phpweb/cal.php Mon Jun 4 16:57:57 2007
@@ -1,5 +1,5 @@
<?php
-// $Id: cal.php,v 1.47 2003/12/31 13:04:27 goba Exp $
+// $Id: cal.php,v 1.48 2007/06/04 16:57:57 bjori Exp $
$_SERVER['BASE_PAGE'] = 'cal.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
@@ -30,13 +30,13 @@
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 @@
// 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 @@
($COUNTRY == $event['country'] ? "<strong>" :
""),
'<a class="cat' . $event['category'] . '"
href="/cal.php',
"?id=$event[id]&cm=$cm&cy=$cy", '">',
- stripslashes(htmlentities($event['sdesc'])),
+ stripslashes(htmlentities($event['sdesc'], ENT_QUOTES,
'UTF-8')),
'</a>',
($COUNTRY == $event['country'] ? "</strong>" :
""),
'</div>';