Code Duplication    Length = 17-18 lines in 2 locations

kernel/mimetypes.php 2 locations

@@ 129-146 (lines=18) @@
126
		return $tplfile;
127
	}
128
129
	function get_byExt( $mime_ext, $asobject=true ) {
130
		$ret = array();
131
		$sql = 'SELECT * FROM ' . $this->db->prefix('mimetypes') . ' WHERE mime_ext = ' . $this->db->quoteString($mime_ext);
132
133
		$result = $this->db->query($sql);
134
		if (!$result) {
135
			return $ret;
136
		}
137
138
		while ( $myrow = $this->db->fetchArray($result) ) {
139
			if ( !$asobject ) {
140
				$ret[$myrow['mime_id']] = $myrow;
141
			} else {
142
				$ret[] = new xoopsmimetypes( $myrow );
143
			}
144
		}
145
		return $ret;
146
	}
147
148
	function get_mimetypes($limit=20, $start=0, $status=-1, $OtherCriteria=null, $sort='mime_ext', $order='ASC', $asobject=true) {
149
		$ret = array();
@@ 534-550 (lines=17) @@
531
		return $ret;
532
	}
533
534
	function get_byMimeModule( $mime_id, $mid, $asobject=true) {
535
		$ret = array();
536
		$sql = 'SELECT * FROM ' . $this->db->prefix('mimetypes_perms') . ' WHERE mperm_mime = ' . $mime_id . ' AND mperm_module = ' . $mid;
537
		$result = $this->db->query($sql);
538
		if (!$result) {
539
			return $ret;
540
		}
541
542
		while ( $myrow = $this->db->fetchArray($result) ) {
543
			if ( !$asobject ) {
544
				$ret[$myrow['mime_id']] = $myrow;
545
			} else {
546
				$ret[] = new xoopsmimetypes_perms( $myrow );
547
			}
548
		}
549
		return $ret;
550
	}
551
552
	function getCount($criteria = null, $notNullFields='') {
553
		$sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('mimetypes_perms') . ' p LEFT JOIN ' .