@@ -110,8 +110,12 @@ |
||
110 | 110 | // Normalise "empty" values into dashes so comparisons are done properly. |
111 | 111 | // This means there is no diference between an empty string and a null |
112 | 112 | // but "0" is considered to be non-empty. |
113 | - if(empty($from) && !strlen($from)) $from = '-'; |
|
114 | - if(empty($to) && !strlen($from)) $to = '-'; |
|
113 | + if(empty($from) && !strlen($from)) { |
|
114 | + $from = '-'; |
|
115 | + } |
|
116 | + if(empty($to) && !strlen($from)) { |
|
117 | + $to = '-'; |
|
118 | + } |
|
115 | 119 | |
116 | 120 | return $this->changes[$title] = array( |
117 | 121 | 'from' => $from, |
@@ -136,10 +136,10 @@ |
||
136 | 136 | */ |
137 | 137 | public function getChangesModificationNeeded() { |
138 | 138 | $filtered = []; |
139 | - foreach ($this->getChanges() as $change => $details) { |
|
140 | - if (array_key_exists('description', $details)) { |
|
139 | + foreach($this->getChanges() as $change => $details) { |
|
140 | + if(array_key_exists('description', $details)) { |
|
141 | 141 | $filtered[$change] = $details; |
142 | - } else if ( |
|
142 | + } else if( |
|
143 | 143 | (array_key_exists('from', $details) || array_key_exists('to', $details)) |
144 | 144 | && $details['from'] !== $details['to'] |
145 | 145 | ) { |