Project

General

Profile

« Previous | Next » 

Revision 362ddda1

Added by Jim Pingle almost 10 years ago

Encode ca descr in system_camanager.php

View differences:

usr/local/www/system_camanager.php
95 95
	$name = $a_ca[$id]['descr'];
96 96
	unset($a_ca[$id]);
97 97
	write_config();
98
	$savemsg = sprintf(gettext("Certificate Authority %s and its CRLs (if any) successfully deleted"), $name) . "<br />";
98
	$savemsg = sprintf(gettext("Certificate Authority %s and its CRLs (if any) successfully deleted"), htmlspecialchars($name)) . "<br />";
99 99
	pfSenseHeader("system_camanager.php");
100 100
	exit;
101 101
}
......
209 209
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
210 210
	if ($pconfig['method'] != "existing") {
211 211
		/* Make sure we do not have invalid characters in the fields for the certificate */
212
		if (preg_match("/[\?\>\<\&\/\\\"\']/", $_POST['descr'])) {
213
			array_push($input_errors, "The field 'Descriptive Name' contains invalid characters.");
214
		}
215

  
212 216
		for ($i = 0; $i < count($reqdfields); $i++) {
213 217
			if ($reqdfields[$i] == 'dn_email'){
214 218
				if (preg_match("/[\!\#\$\%\^\(\)\~\?\>\<\&\/\\\,\"\']/", $_POST["dn_email"]))
......
455 459
                                                                        if ($pconfig['caref'] == $ca['refid'])
456 460
                                                                                $selected = " selected=\"selected\"";
457 461
                                                                ?>
458
                                                                        <option value="<?=$ca['refid'];?>"<?=$selected;?>><?=$ca['descr'];?></option>
462
                                                                        <option value="<?=$ca['refid'];?>"<?=$selected;?>><?=htmlspecialchars($ca['descr']);?></option>
459 463
                                                                <?php endforeach; ?>
460 464
                                                                </select>
461 465
							</td>
......
614 618

  
615 619
							$issuer_ca = lookup_ca($ca['caref']);
616 620
							if ($issuer_ca)
617
								$issuer_name = $issuer_ca['descr'];
621
								$issuer_name = htmlspecialchars($issuer_ca['descr']);
618 622

  
619 623
							// TODO : Need gray certificate icon
620 624

  
......
654 658
								<tr>
655 659
									<td width="10%">&nbsp;</td>
656 660
									<td width="20%"><?=gettext("Valid From")?>:</td>
657
									<td width="70%"><?= $startdate ?></td>
661
									<td width="70%"><?= htmlspecialchars($startdate) ?></td>
658 662
								</tr>
659 663
								<tr>
660 664
									<td>&nbsp;</td>
661 665
									<td><?=gettext("Valid Until")?>:</td>
662
									<td><?= $enddate ?></td>
666
									<td><?= htmlspecialchars($enddate) ?></td>
663 667
								</tr>
664 668
							</table>
665 669
						</td>

Also available in: Unified diff