Commit 9577ec16 authored by Mike Hibler's avatar Mike Hibler

More PHP5 changes.

parent 53fc7653
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2007, 2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -35,12 +35,12 @@ function INITFORM($formfields, $projlist)
# this is to have another page for netbuild that does some magic and
# redirects the browser to this page.
#
if (isset($nsref) && $nsref != "" && ereg("^[0-9]+$", $nsref))
if (isset($nsref) && $nsref != "" && preg_match('/^[0-9]+$/', $nsref))
$defaults["nsref"] = $nsref;
else
unset($nsref);
if (isset($guid) && $guid != "" && ereg("^[0-9]+$", $guid))
if (isset($guid) && $guid != "" && preg_match('/^[0-9]+$/', $guid))
$defaults["guid"] = $guid;
else
unset($guid);
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -21,7 +21,7 @@ $optargs = OptionalPageArguments("guid", PAGEARG_INTEGER,
#
# Only known and logged in users.
#
if (isset($guid) && ereg("^[0-9]+$", $guid)) {
if (isset($guid) && preg_match('/^[0-9]+$/', $guid)) {
$uid = $guid;
}
else {
......@@ -38,7 +38,7 @@ if (!isset($nsdata)) {
USERERROR("Need to send NSFILE!", 1);
}
if (!isset($nsref) || !ereg("^[0-9]+$", $nsref)) {
if (!isset($nsref) || !preg_match('/^[0-9]+$/', $nsref)) {
USERERROR("Need to send valid NSREF!", 1);
}
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003, 2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
require("defs.php3");
......@@ -98,7 +98,7 @@ if ((!isset($cdkey) || !strcmp($cdkey, ""))) {
return;
}
if (!ereg("[0-9a-zA-Z]+", $cdkey)) {
if (!preg_match('/[0-9a-zA-Z]+/', $cdkey)) {
SPITSTATUS(CDROMSTATUS_INVALIDARGS);
return;
}
......@@ -157,14 +157,14 @@ if ((!isset($privkey) || !strcmp($privkey, "")) ||
return;
}
if (!ereg("[0-9a-zA-Z ]+", $privkey) ||
!ereg("[0-9\.]+", $IP)) {
if (!preg_match('/[0-9a-zA-Z ]+/', $privkey) ||
!preg_match('/[0-9\.]+/', $IP)) {
SPITSTATUS(CDROMSTATUS_INVALIDARGS);
return;
}
if (isset($wahostname) &&
!ereg("[-_0-9a-zA-Z\.]+", $wahostname)) {
!preg_match('/[-_0-9a-zA-Z\.]+/', $wahostname)) {
SPITSTATUS(CDROMSTATUS_INVALIDARGS);
return;
}
......@@ -183,7 +183,7 @@ if (isset($wahostname)) {
}
if (isset($roottag) &&
!ereg("[0-9a-zA-Z]+", $roottag)) {
!preg_match('/[0-9a-zA-Z]+/', $roottag)) {
SPITSTATUS(CDROMSTATUS_INVALIDARGS);
return;
}
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
# Lets emulate register_globals=off for a while.
......@@ -532,12 +532,12 @@ function VALIDUSERPATH($path, $uid="", $pid="", $gid="", $eid="")
# No ids specified, just make sure it starts with an appropriate prefix.
#
if (!$uid && !$pid && !$gid && !$eid) {
if (ereg("^$TBPROJ_DIR/.*", $path) ||
ereg("^$TBUSER_DIR/.*", $path) ||
ereg("^$TBGROUP_DIR/.*", $path)) {
if (preg_match("/^$TBPROJ_DIR\/.*/", $path) ||
preg_match("/^$TBUSER_DIR\/.*/", $path) ||
preg_match("/^$TBGROUP_DIR\/.*/", $path)) {
return 1;
}
if ($TBSCRATCH_DIR && ereg("^$TBSCRATCH_DIR/.*", $path)) {
if ($TBSCRATCH_DIR && preg_match("/^$TBSCRATCH_DIR\/.*/", $path)) {
return 1;
}
return 0;
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
......@@ -535,7 +535,7 @@ while (list ($header, $value) = each ($formfields)) {
continue;
}
if (!isset($value) || !strcmp($value, "") ||
!ereg("^[0-9\.bs]*$", "$value")) {
!preg_match('/^[0-9\.bs]*$/', "$value")) {
continue;
}
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
......@@ -31,7 +31,7 @@ if (! ($isadmin || OPSGUY())) {
#
# Check log type. Strictly letters, not too long.
#
if (! ereg("^[a-zA-Z]+$", $log_type) || strlen($log_type) > 32) {
if (!preg_match('/^[a-zA-Z]+$/', $log_type) || strlen($log_type) > 32) {
USERERROR("The log type you gave looks funky!", 1);
}
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003, 2005-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
......@@ -134,8 +134,8 @@ if (isset($nsdata) && strcmp($nsdata, "") != 0) {
header("Content-Type: text/plain");
echo "$nsdata";
} elseif (isset($nsref) && strcmp($nsref,"") != 0 &&
ereg("^[0-9]+$", $nsref)) {
if (isset($guid) && ereg("^[0-9]+$", $guid)) {
preg_match('/^[0-9]+$/', $nsref)) {
if (isset($guid) && preg_match('/^[0-9]+$/', $guid)) {
$nsfile = "/tmp/$guid-$nsref.nsfile";
$id = $guid;
} else {
......
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