Commit 83072f5b authored by Mike Hibler's avatar Mike Hibler

Fix my misuse of preg_split (gotta have a delimiter).

parent e9cb4a3f
......@@ -64,9 +64,9 @@ while ($row = mysql_fetch_array($query_result)) {
}
# Have to convert the date/time to RFC822 format
list($date, $hours) = preg_split(' ', $timestamp);
list($year,$month,$day) = preg_split('-',$date);
list($hour,$min,$sec) = preg_split(':',$hours);
list($date, $hours) = preg_split('/ /', $timestamp);
list($year,$month,$day) = preg_split('/-/',$date);
list($hour,$min,$sec) = preg_split('/:/',$hours);
$rfc822date = date("r",mktime($hour, $min, $sec, $month, $day, $year));
if ($first) {
......
......@@ -61,7 +61,7 @@ else {
$body_str .= "Update last power time for:<br>";
$body_str .= "<form action='powertime.php3' method=get><br><table>";
$body_str .= "<tr><th>Update?</th><th>Node ID</th><th>Last Power</th></tr>";
foreach (preg_split(",", $node_id) as $ni) {
foreach (preg_split("/,/", $node_id) as $ni) {
if (!TBvalid_node_id($ni)) {
USERERROR("Invalid node ID: $ni", 1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment