Skip to content
Permalink
Browse files

[plugin:update_entities] get DTD by func->http_request()

  • Loading branch information
nao-pon committed Sep 9, 2013
1 parent a3eff0d commit 3c3c548c54f973d8633b48a7711a20977767389b
Showing with 7 additions and 6 deletions.
  1. +7 −6 xoops_trust_path/modules/xpwiki/plugin/update_entities.inc.php
@@ -69,15 +69,16 @@ function plugin_update_entities_create($do = FALSE)
$items = array('php:html_translation_table');
$matches = array();
foreach ($files as $file) {
$source = file($this->cont['W3C_XHTML_DTD_LOCATION'] . $file);
// or die_message('cannot receive ' . W3C_XHTML_DTD_LOCATION . $file . '.');
if (! is_array($source)) {
$items[] = 'w3c:' . $file . ' COLOR(red):not found.';
$results = $this->func->http_request($this->cont['W3C_XHTML_DTD_LOCATION'] . $file,
'GET', '', array(), NULL, '', TRUE, 1,
10, // connect timeout
60); // request timeout
if (! $results['data'] || $results['rc'] != 200) {
$items[] = 'w3c:' . $file . ' COLOR(red):not found.' . $this->func->htmlspecialchars($results['data']);
continue;
}
$items[] = 'w3c:' . $file;
if (preg_match_all('/<!ENTITY\s+([A-Za-z0-9]+)/',
join('', $source), $matches, PREG_PATTERN_ORDER))
if (preg_match_all('/<!ENTITY\s+([A-Za-z0-9]+)/', $results['data'], $matches, PREG_PATTERN_ORDER))
{
$entities = array_merge($entities, $matches[1]);
}

0 comments on commit 3c3c548

Please sign in to comment.
You can’t perform that action at this time.