Commit 7bebbf9f authored by Penny Leach's avatar Penny Leach
Browse files

[UPSTREAM] xmldb: added $CFG options for disabling comment checking and

next/prev checking
parent d2f3b198
......@@ -194,6 +194,10 @@ class XMLDBObject {
* have a consistent info in their previous/next fields
*/
function checkPreviousNextValues(&$arr) {
global $CFG;
if (!empty($CFG->xmldbdisablenextprevchecking)) {
return true;
}
$result = true;
/// Check that only one element has the previous not set
if ($arr) {
......@@ -271,7 +275,11 @@ class XMLDBObject {
* the previous/next rules
*/
function orderElements($arr) {
global $CFG;
$result = true;
if (!empty($CFG->disablenextprevchecking)) {
return $arr;
}
/// Create a new array
$newarr = array();
if (!empty($arr)) {
......
......@@ -330,6 +330,8 @@ class XMLDBStructure extends XMLDBObject {
*/
function arr2XMLDBStructure($xmlarr) {
global $CFG;
$result = true;
/// Debug the structure
......@@ -354,6 +356,8 @@ class XMLDBStructure extends XMLDBObject {
}
if (isset($xmlarr['XMLDB']['@']['COMMENT'])) {
$this->comment = trim($xmlarr['XMLDB']['@']['COMMENT']);
} else if (!empty($CFG->xmldbdisablecommentchecking)) {
$this->comment = '';
} else {
$this->errormsg = 'Missing COMMENT attribute';
xmldb_dbg($this->errormsg);
......
......@@ -432,6 +432,8 @@ class XMLDBTable extends XMLDBObject {
*/
function arr2XMLDBTable($xmlarr) {
global $CFG;
$result = true;
/// Debug the table
......@@ -449,6 +451,8 @@ class XMLDBTable extends XMLDBObject {
}
if (isset($xmlarr['@']['COMMENT'])) {
$this->comment = trim($xmlarr['@']['COMMENT']);
} else if (!empty($CFG->xmldbdisablecommentchecking)) {
$this->comment = '';
} else {
$this->errormsg = 'Missing COMMENT attribute';
xmldb_dbg($this->errormsg);
......
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