Subversion Repositories oidplus

Rev

Rev 1064 | Rev 1148 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1064 Rev 1130
Line 144... Line 144...
144
                if ($title[$oid] != '') $cont .= "description=".$title[$oid]."\r\n";
144
                if ($title[$oid] != '') $cont .= "description=".$title[$oid]."\r\n";
145
 
145
 
146
                if ($updated[$oid] != '') $cont .= "updatedate=".explode(' ',$updated[$oid])[0]."\r\n";
146
                if ($updated[$oid] != '') $cont .= "updatedate=".explode(' ',$updated[$oid])[0]."\r\n";
147
                if ($created[$oid] != '') $cont .= "createdate=".explode(' ',$created[$oid])[0]."\r\n";
147
                if ($created[$oid] != '') $cont .= "createdate=".explode(' ',$created[$oid])[0]."\r\n";
148
 
148
 
149
                $desc = handleDesc($description[$oid]);
149
                $desc = handleDesc_win($description[$oid]);
150
                if (trim($desc) != '') {
150
                if (trim($desc) != '') {
151
                        $cont .= "information=$dos_id.TXT\r\n";
151
                        $cont .= "information=$dos_id.TXT\r\n";
152
                        $zip->addFromString("DB//$dos_id.TXT", $desc);
152
                        $zip->addFromString("DB//$dos_id.TXT", $desc);
153
                }
153
                }
154
        }
154
        }
Line 190... Line 190...
190
 
190
 
191
OIDplus::invoke_shutdown();
191
OIDplus::invoke_shutdown();
192
 
192
 
193
# ---
193
# ---
194
 
194
 
-
 
195
/**
-
 
196
 * @param string $oid
-
 
197
 * @param array $asn1
-
 
198
 * @return void
-
 
199
 * @throws OIDplusException
-
 
200
 */
195
function fill_asn1($oid, &$asn1) {
201
function fill_asn1(string $oid, array &$asn1) {
196
        if (!isset($asn1[$oid])) $asn1[$oid] = array();
202
        if (!isset($asn1[$oid])) $asn1[$oid] = array();
197
        $res = OIDplus::db()->query("select * from ###asn1id where oid = 'oid:$oid'");
203
        $res = OIDplus::db()->query("select * from ###asn1id where oid = 'oid:$oid'");
198
        while ($row = $res->fetch_object()) {
204
        while ($row = $res->fetch_object()) {
199
                $asn1[$oid][] = $row->name;
205
                $asn1[$oid][] = $row->name;
200
        }
206
        }
Line 208... Line 214...
208
                $iri[$oid][] = $row->name;
214
                $iri[$oid][] = $row->name;
209
        }
215
        }
210
}
216
}
211
*/
217
*/
212
 
218
 
-
 
219
/**
-
 
220
 * @param string $desc
-
 
221
 * @return string
-
 
222
 */
213
function handleDesc($desc) {
223
function handleDesc_win(string $desc): string {
214
        $desc = preg_replace('/\<br(\s*)?\/?\>/i', "\n", $desc); // br2nl
224
        $desc = preg_replace('/\<br(\s*)?\/?\>/i', "\n", $desc); // br2nl
215
        $desc = strip_tags($desc);
225
        $desc = strip_tags($desc);
216
        $desc = str_replace('&nbsp;', ' ', $desc);
226
        $desc = str_replace('&nbsp;', ' ', $desc);
217
        $desc = html_entity_decode($desc);
227
        $desc = html_entity_decode($desc);
218
        $desc = str_replace("\r", "", $desc);
228
        $desc = str_replace("\r", "", $desc);
219
        $desc = str_replace("\n", "\r\n", $desc);
229
        $desc = str_replace("\n", "\r\n", $desc);
220
        $desc = trim($desc)."\r\n";
230
        return trim($desc)."\r\n";
221
        return $desc;
-
 
222
}
231
}