Mercurial > hg > lukkari
comparison index.php @ 120:807c7b90386d
Iconv can spew some errors, so suppress them.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 04 Jan 2014 06:04:19 +0200 |
parents | 78b4eb3a9719 |
children | a6af6538777a |
comparison
equal
deleted
inserted
replaced
119:78b4eb3a9719 | 120:807c7b90386d |
---|---|
159 // Not cached, try to fetch data | 159 // Not cached, try to fetch data |
160 $cacheDirty = TRUE; | 160 $cacheDirty = TRUE; |
161 $data = @file_get_contents($uri); | 161 $data = @file_get_contents($uri); |
162 if ($data !== FALSE) | 162 if ($data !== FALSE) |
163 { | 163 { |
164 $data = iconv("iso-8859-1", $pageCharset, $data); | 164 $data = @iconv("iso-8859-15", $pageCharset, $data); |
165 if (preg_match("#<td class=\"smallheadercell\"><strong>(.+?)\s+(\d+)\s*(op|ECTS\s+cr)\s*</strong></td>#", $data, $m)) | 165 if (preg_match("#<td class=\"smallheadercell\"><strong>(.+?)\s+(\d+)\s*(op|ECTS\s+cr)\s*</strong></td>#", $data, $m)) |
166 { | 166 { |
167 // Add data to cache | 167 // Add data to cache |
168 $cache[$id][$pageLang] = array("desc" => $m[1], "op" => intval($m[2])); | 168 $cache[$id][$pageLang] = array("desc" => $m[1], "op" => intval($m[2])); |
169 } | 169 } |