From: scyrma Date: Thu, 24 Apr 2008 06:40:26 +0000 (+0000) Subject: MDL-3381 - Prevent the un-necessary calls to ctype_alpha. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c659559fd6e406e71d1867fc7c76306cb4b8e361;p=moodle.git MDL-3381 - Prevent the un-necessary calls to ctype_alpha. --- diff --git a/course/lib.php b/course/lib.php index f40e9d969c..909de26771 100644 --- a/course/lib.php +++ b/course/lib.php @@ -117,7 +117,7 @@ function build_mnet_logs_array($hostid, $course, $user=0, $date=0, $order="l.tim if ($modaction) { $firstletter = substr($modaction, 0, 1); - if (ctype_alpha($firstletter)) { + if (preg_match('/[[:alpha:]]/', $firstletter)) { $where .= " AND\n lower(l.action) LIKE '%" . strtolower($modaction) . "%'"; } else if ($firstletter == '-') { $where .= " AND\n lower(l.action) NOT LIKE '%" . strtolower(substr($modaction, 1)) . "%'"; @@ -180,7 +180,7 @@ function build_logs_array($course, $user=0, $date=0, $order="l.time ASC", $limit if ($modaction) { $firstletter = substr($modaction, 0, 1); - if (ctype_alpha($firstletter)) { + if (preg_match('/[[:alpha:]]/', $firstletter)) { $joins[] = "lower(l.action) LIKE '%" . strtolower($modaction) . "%'"; } else if ($firstletter == '-') { $joins[] = "lower(l.action) NOT LIKE '%" . strtolower(substr($modaction, 1)) . "%'";