diff --git a/inc/plugins/pluginlibrary.php b/inc/plugins/pluginlibrary.php index 72be8d2..19b6dfd 100644 --- a/inc/plugins/pluginlibrary.php +++ b/inc/plugins/pluginlibrary.php @@ -902,7 +902,7 @@ function _edit($text, &$edits, $ins='/**/', $del='/*/*') $result[] = substr($text, $pos, $start-$pos); // insert before - $result[] = $this->_comment($ins, $edit['before']); + $result[] = $this->_comment($ins, isset($edit['before']) ? $edit['before'] : ''); // original matched text $match = substr($text, $start, $stop-$start); @@ -910,8 +910,8 @@ function _edit($text, &$edits, $ins='/**/', $del='/*/*') $dirty = 0; - if($edit['replace'] - || is_string($edit['replace']) || is_array($edit['replace'])) + if(isset($edit['replace']) + || isset($edit['replace']) && (is_string($edit['replace']) || is_array($edit['replace']))) { // insert match (commented out) $result[] = $this->_comment($del, $match); @@ -930,7 +930,7 @@ function _edit($text, &$edits, $ins='/**/', $del='/*/*') } // insert after - $result[] = $this->_comment($ins, $edit['after']); + $result[] = $this->_comment($ins, isset($edit['after']) ? $edit['after'] : ''); if($dirty && !strlen($result[count($result)-1])) {