MINOR Fixing ereg functions with preg in SideReport and Widget

This commit is contained in:
Sean Harvey 2012-04-10 22:16:17 +12:00
parent 4524d1c594
commit d914ee0f2c
2 changed files with 3 additions and 3 deletions

View File

@ -86,7 +86,7 @@ class SideReportView extends ViewableData {
$classClause = "";
if(isset($info['title'])) {
$cssClass = ereg_replace('[^A-Za-z0-9]+','',$info['title']);
$cssClass = preg_replace('/[^A-Za-z0-9]+/', '', $info['title']);
$classClause = "class=\"$cssClass\"";
}

View File

@ -94,8 +94,8 @@ class Widget extends DataObject {
$name = $field->Name();
$field->setValue($this->getField($name));
$renderedField = $field->FieldHolder();
$renderedField = ereg_replace("name=\"([A-Za-z0-9\-_]+)\"", "name=\"Widget[" . $this->ID . "][\\1]\"", $renderedField);
$renderedField = ereg_replace("id=\"([A-Za-z0-9\-_]+)\"", "id=\"Widget[" . $this->ID . "][\\1]\"", $renderedField);
$renderedField = preg_replace("/name=\"([A-Za-z0-9\-_]+)\"/", "name=\"Widget[" . $this->ID . "][\\1]\"", $renderedField);
$renderedField = preg_replace("/id=\"([A-Za-z0-9\-_]+)\"/", "id=\"Widget[" . $this->ID . "][\\1]\"", $renderedField);
$output .= $renderedField;
}
return $output;