@@ -799,13 +801,13 @@ function SetUrl(url, width, height, alt) {
-
+
' . "\n";
} else {
@@ -982,9 +986,9 @@ function SetUrl(url, width, height, alt) {
-
+
-
+
';
}
@@ -992,9 +996,9 @@ function SetUrl(url, width, height, alt) {
if ($i === 0) {
$templateVariablesOutput .= '
-
' . $row['category'] . '
+
' . $modx->htmlspecialchars($row['category']) . '
-
+
';
} else {
@@ -1002,11 +1006,11 @@ function SetUrl(url, width, height, alt) {
-
+
-
' . $row['category'] . '
+
' . $modx->htmlspecialchars($row['category']) . '
-
+
';
}
@@ -1014,18 +1018,18 @@ function SetUrl(url, width, height, alt) {
if ($i === 0) {
$templateVariablesOutput .= '
-
' . $row['category'] . '
+
' . $modx->htmlspecialchars($row['category']) . '
';
} else {
$templateVariablesOutput .= '
-
+
-
' . $row['category'] . '
+
' . $modx->htmlspecialchars($row['category']) . '
-
+
';
}
}
@@ -1072,13 +1076,13 @@ function SetUrl(url, width, height, alt) {
$tvPBV = $row['value'];
}
- $tvDescription = (!empty($row['description'])) ? ' ' : '';
+ $tvDescription = (!empty($row['description'])) ? ' ' : '';
$tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? ' ' : '';
- $tvName = $modx->hasPermission('edit_template') ? '[*' . $row['name'] . '*] ' : '';
+ $tvName = $modx->hasPermission('edit_template') ? '[*' . $modx->htmlspecialchars($row['name']) . '*] ' : '';
$templateVariablesTmp .= '
- ' . $row['caption'] . $tvName . ' ' . $tvDescription . $tvInherited . '
+ ' . $modx->htmlspecialchars($row['caption']) . $tvName . ' ' . $tvDescription . $tvInherited . '
' . renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray) . '
';
@@ -1462,7 +1466,7 @@ function SetUrl(url, width, height, alt) {
} else {
++$permissions_no;
}
- $permissions[] = "\t\t" . '' . $inputHTML . '' . $row['name'] . ' ';
+ $permissions[] = "\t\t" . '' . $inputHTML . '' . $modx->htmlspecialchars($row['name']) . ' ';
}
// if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public
if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) {
@@ -1544,6 +1548,7 @@ function makePublic(b) {
storeCurTemplate();
manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) {
if(is_array($richtexteditorIds)) {
foreach($richtexteditorIds as $editor => $elements) {
diff --git a/manager/actions/mutate_htmlsnippet.dynamic.php b/manager/actions/mutate_htmlsnippet.dynamic.php
index ff367b4d2b..a6850487d1 100755
--- a/manager/actions/mutate_htmlsnippet.dynamic.php
+++ b/manager/actions/mutate_htmlsnippet.dynamic.php
@@ -25,7 +25,7 @@
// check to see the snippet editor isn't locked
if ($lockedEl = $modx->elementIsLocked(3, $id)) {
- $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['chunk']));
+ $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $modx->htmlspecialchars($lockedEl['username']), $_lang['chunk']));
}
// end check for lock
@@ -47,7 +47,7 @@
$content['name'] = $_REQUEST['itemname'];
} else {
$_SESSION['itemname'] = $_lang["new_htmlsnippet"];
- $content['category'] = (int)$_REQUEST['catid'];
+ if (!empty($content['category'])) $content['category'] = (int)$_REQUEST['catid'];
}
if ($modx->manager->hasFormValues()) {
@@ -57,7 +57,7 @@
if (isset($_POST['which_editor'])) {
$which_editor = $_POST['which_editor'];
} else {
- $which_editor = $content['editor_name'] != 'none' ? $content['editor_name'] : 'none';
+ $which_editor = isset($content['editor_name']) ? $content['editor_name'] : 'none';
}
$content = array_merge($content, $_POST);
@@ -97,7 +97,7 @@ function changeRTE()
}, duplicate: function() {
if (confirm('= $_lang['confirm_duplicate_record'] ?>') === true) {
documentDirty = false;
- document.location.href = "index.php?id== $_REQUEST['id'] ?>&a=97";
+ document.location.href = "index.php?id== !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : '' ?>&a=97";
}
}, delete: function() {
if (confirm('= $_lang['confirm_delete_htmlsnippet'] ?>') === true) {
@@ -132,11 +132,11 @@ function changeRTE()
?>
-
+
- = ($content['name'] ? $content['name'] . '(' . $content['id'] . ') ' : $_lang['new_htmlsnippet']) ?>
+ = isset($content['name']) ? $modx->htmlspecialchars($content['name']) . '(' . $content['id'] . ') ' : $_lang['new_htmlsnippet'] ?>
= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -158,10 +158,10 @@ function changeRTE()
= $_lang['htmlsnippet_name'] ?>
@@ -224,7 +228,7 @@ function changeRTE()
-
+
diff --git a/manager/actions/mutate_menuindex_sort.dynamic.php b/manager/actions/mutate_menuindex_sort.dynamic.php
index 9787bf4487..b372a1623e 100755
--- a/manager/actions/mutate_menuindex_sort.dynamic.php
+++ b/manager/actions/mutate_menuindex_sort.dynamic.php
@@ -62,7 +62,7 @@
$classes .= ($row['published']) ? ' publishedNode ' : ' unpublishedNode ';
$classes = ($row['deleted']) ? ' deletedNode ' : $classes;
$icon = $row['isfolder'] ? ' ' : ' ';
- $ressourcelist .= '' . $icon . $row['pagetitle'] . ' (' . $row['id'] . ') ';
+ $ressourcelist .= '' . $icon . $modx->htmlspecialchars($row['pagetitle']) . ' (' . $row['id'] . ') ';
}
$ressourcelist .= '';
} else {
@@ -149,7 +149,7 @@ function resetSortOrder()
- = ($pagetitle ? $pagetitle . '(' . $id . ') ' : $_lang['sort_menuindex']) ?>
+ = ($pagetitle ? $modx->htmlspecialchars($pagetitle) . '(' . $id . ') ' : $_lang['sort_menuindex']) ?>
= $_style['actionbuttons']['dynamic']['save'] ?>
diff --git a/manager/actions/mutate_module.dynamic.php b/manager/actions/mutate_module.dynamic.php
index 457fa6c91f..97e9817faa 100755
--- a/manager/actions/mutate_module.dynamic.php
+++ b/manager/actions/mutate_module.dynamic.php
@@ -1,733 +1,736 @@
-INCLUDE_ORDERING_ERROR Please use the EVO Content Manager instead of accessing this file directly.");
-}
-switch($modx->manager->action) {
- case 107:
- if(!$modx->hasPermission('new_module')) {
- $modx->webAlertAndQuit($_lang["error_no_privileges"]);
- }
- break;
- case 108:
- if(!$modx->hasPermission('edit_module')) {
- $modx->webAlertAndQuit($_lang["error_no_privileges"]);
- }
- break;
- default:
- $modx->webAlertAndQuit($_lang["error_no_privileges"]);
-}
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
-// Get table names (alphabetical)
-$tbl_membergroup_names = $modx->getFullTableName('membergroup_names');
-$tbl_site_content = $modx->getFullTableName('site_content');
-$tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets');
-$tbl_site_module_access = $modx->getFullTableName('site_module_access');
-$tbl_site_module_depobj = $modx->getFullTableName('site_module_depobj');
-$tbl_site_modules = $modx->getFullTableName('site_modules');
-$tbl_site_plugins = $modx->getFullTableName('site_plugins');
-$tbl_site_snippets = $modx->getFullTableName('site_snippets');
-$tbl_site_templates = $modx->getFullTableName('site_templates');
-$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
-/**
- * create globally unique identifiers (guid)
- *
- * @return string
- */
-function createGUID() {
- srand((double) microtime() * 1000000);
- $r = rand();
- $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1);
- $m = md5($u);
- return $m;
-}
-
-// check to see the module editor isn't locked
-if($lockedEl = $modx->elementIsLocked(6, $id)) {
- $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
-}
-// end check for lock
-
-// Lock snippet for other users to edit
-$modx->lockElement(6, $id);
-
-if(isset($_GET['id'])) {
- $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
- $content = $modx->db->getRow($rs);
- if(!$content) {
- $modx->webAlertAndQuit("Module not found for id '{$id}'.");
- }
- $content['properties'] = str_replace("&", "&", $content['properties']);
- $_SESSION['itemname'] = $content['name'];
- if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
- $modx->webAlertAndQuit($_lang["error_no_privileges"]);
- }
-} else {
- $_SESSION['itemname'] = $_lang["new_module"];
- $content['wrap'] = '1';
-}
-if($modx->manager->hasFormValues()) {
- $modx->manager->loadFormValues();
-}
-
-$content = array_merge($content, $_POST);
-
-// Add lock-element JS-Script
-$lockElementId = $id;
-$lockElementType = 6;
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
-?>
-
-
-
@@ -790,7 +790,7 @@ function SetUrl(url, width, height, alt) {
db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
while($row = $modx->db->getRow($rs)) {
- echo " " . $row['name'] . " ";
+ echo " " . $modx->htmlspecialchars($row['name']) . " ";
}
}
?>
diff --git a/manager/actions/mutate_web_user.dynamic.php b/manager/actions/mutate_web_user.dynamic.php
index 94ec4560c0..39e9cc7f5e 100755
--- a/manager/actions/mutate_web_user.dynamic.php
+++ b/manager/actions/mutate_web_user.dynamic.php
@@ -1,560 +1,564 @@
-INCLUDE_ORDERING_ERROR Please use the EVO Content Manager instead of accessing this file directly.");
-}
-
-switch($modx->manager->action) {
- case 88:
- if(!$modx->hasPermission('edit_web_user')) {
- $modx->webAlertAndQuit($_lang["error_no_privileges"]);
- }
- break;
- case 87:
- if(!$modx->hasPermission('new_web_user')) {
- $modx->webAlertAndQuit($_lang["error_no_privileges"]);
- }
- break;
- default:
- $modx->webAlertAndQuit($_lang["error_no_privileges"]);
-}
-
-$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
-
-
-// check to see the snippet editor isn't locked
-$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
-
-if($username = $modx->db->getValue($rs)) {
- $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user"));
-}
-// end check for lock
-
-if($modx->manager->action == '88') {
- // get user attributes
- $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'");
- $userdata = $modx->db->getRow($rs);
- if(!$userdata) {
- $modx->webAlertAndQuit("No user returned!");
- }
-
- // get user settings
- $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'");
- $usersettings = array();
- while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
- extract($usersettings, EXTR_OVERWRITE);
-
- if (!isset($usersettings['login_home'])) {
- $usersettings['login_home'] = '';
- }
-
- if (!isset($usersettings['allowed_ip'])) {
- $usersettings['allowed_ip'] = '';
- }
-
- if (!isset($usersettings['allowed_days'])) {
- $usersettings['allowed_days'] = '';
- }
-
- // get user name
- $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'");
- $usernamedata = $modx->db->getRow($rs);
- if(!$usernamedata) {
- $modx->webAlertAndQuit("No user returned while getting username!");
- }
- $_SESSION['itemname'] = $usernamedata['username'];
-} else {
- $userdata = array();
- $usersettings = array();
- $usernamedata = array();
- $_SESSION['itemname'] = $_lang["new_web_user"];
-}
-
-// avoid doubling htmlspecialchars (already encoded in DB)
-foreach($userdata as $key => $val) {
- $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
-}
-if (!isset($userdata['failedlogins'])) {
- $userdata['failedlogins'] = 0;
-}
-$usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
-
-// restore saved form
-$formRestored = false;
-if($modx->manager->hasFormValues()) {
- $modx->manager->loadFormValues();
- // restore post values
- $userdata = array_merge($userdata, $_POST);
- $userdata['dob'] = $modx->toTimeStamp($userdata['dob']);
- $usernamedata['username'] = $userdata['newusername'];
- $usernamedata['oldusername'] = $_POST['oldusername'];
- $usersettings = array_merge($usersettings, $userdata);
- $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : "";
- extract($usersettings, EXTR_OVERWRITE);
-}
-
-// include the country list language file
-$_country_lang = array();
-if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
- include_once "lang/country/" . $manager_language . "_country.inc.php";
-} else {
- include_once "lang/country/english_country.inc.php";
-}
-asort($_country_lang);
-
-$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block';
-?>
-
-
-
- invokeEvent("OnWUsrFormPrerender", array("id" => $user));
- if(is_array($evtOut)) {
- echo implode("", $evtOut);
- }
- ?>
-
-
-
- " />
-
-
- = ($usernamedata['username'] ? $usernamedata['username'] . '(' . $usernamedata['id'] . ') ' : $_lang['web_user_title']) ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- manager->action == '88') { // only do this bit if the user is being edited
- $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'");
- $groupsarray = $modx->db->getColumn('webgroup', $rs);
- }
- // retain selected user groups between post
- if(!empty($_POST['user_groups']) && is_array($_POST['user_groups'])) {
- foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
- }
- ?>
-
-
-
-
- db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name');
- while($row = $modx->db->getRow($rs)) {
- echo '
' . $row['name'] . '';
- }
- }
- ?>
-
- invokeEvent("OnWUsrFormRender", array(
- "id" => $user
- ));
- if(is_array($evtOut)) {
- echo implode("", $evtOut);
- }
- ?>
-
-
-
-
+INCLUDE_ORDERING_ERROR Please use the EVO Content Manager instead of accessing this file directly.");
+}
+
+switch($modx->manager->action) {
+ case 88:
+ if(!$modx->hasPermission('edit_web_user')) {
+ $modx->webAlertAndQuit($_lang["error_no_privileges"]);
+ }
+ break;
+ case 87:
+ if(!$modx->hasPermission('new_web_user')) {
+ $modx->webAlertAndQuit($_lang["error_no_privileges"]);
+ }
+ break;
+ default:
+ $modx->webAlertAndQuit($_lang["error_no_privileges"]);
+}
+
+$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
+
+
+// check to see the snippet editor isn't locked
+$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
+
+if($username = $modx->db->getValue($rs)) {
+ $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user"));
+}
+// end check for lock
+
+if($modx->manager->action == '88') {
+ // get user attributes
+ $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'");
+ $userdata = $modx->db->getRow($rs);
+ if(!$userdata) {
+ $modx->webAlertAndQuit("No user returned!");
+ }
+
+ // get user settings
+ $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'");
+ $usersettings = array();
+ while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
+ extract($usersettings, EXTR_OVERWRITE);
+
+ if (!isset($usersettings['login_home'])) {
+ $usersettings['login_home'] = '';
+ }
+
+ if (!isset($usersettings['allowed_ip'])) {
+ $usersettings['allowed_ip'] = '';
+ }
+
+ if (!isset($usersettings['allowed_days'])) {
+ $usersettings['allowed_days'] = '';
+ }
+
+ // get user name
+ $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'");
+ $usernamedata = $modx->db->getRow($rs);
+ if(!$usernamedata) {
+ $modx->webAlertAndQuit("No user returned while getting username!");
+ }
+ $_SESSION['itemname'] = $usernamedata['username'];
+} else {
+ $userdata = array();
+ $usersettings = array();
+ $usernamedata = array();
+ $_SESSION['itemname'] = $_lang["new_web_user"];
+}
+
+// avoid doubling htmlspecialchars (already encoded in DB)
+foreach($userdata as $key => $val) {
+ $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
+}
+if (!isset($userdata['failedlogins'])) {
+ $userdata['failedlogins'] = 0;
+}
+$usernamedata['username'] = html_entity_decode($usernamedata['username'] ?? '', ENT_NOQUOTES, $modx->config['modx_charset']);
+
+// restore saved form
+$formRestored = false;
+if($modx->manager->hasFormValues()) {
+ $modx->manager->loadFormValues();
+ // restore post values
+ foreach ($_POST as $key => $value) {
+ if (is_scalar($key) && is_scalar($value)) {
+ $userdata[$key] = $value;
+ }
+ }
+ $userdata['dob'] = $modx->toTimeStamp($userdata['dob'] ?? '');
+ $usernamedata['username'] = $userdata['newusername'] ?? '';
+ $usernamedata['oldusername'] = isset($_POST['oldusername']) && is_scalar($_POST['oldusername']) ? $_POST['oldusername'] : '';
+ $usersettings = array_merge($usersettings, $userdata);
+ $usersettings['allowed_days'] = isset($_POST['allowed_days']) && is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : "";
+ extract($usersettings, EXTR_OVERWRITE);
+}
+
+// include the country list language file
+$_country_lang = array();
+if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
+ include_once "lang/country/" . $manager_language . "_country.inc.php";
+} else {
+ include_once "lang/country/english_country.inc.php";
+}
+asort($_country_lang);
+
+$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block';
+?>
+
+
+
+ invokeEvent("OnWUsrFormPrerender", array("id" => $user));
+ if(is_array($evtOut)) {
+ echo implode("", $evtOut);
+ }
+ ?>
+
+
+
+ " />
+
+
+ = ($usernamedata['username'] ? $modx->htmlspecialchars($usernamedata['username']) . (isset($usernamedata['id']) ? '(' . $usernamedata['id'] . ') ' : '') : $_lang['web_user_title']) ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ manager->action == '88') { // only do this bit if the user is being edited
+ $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'");
+ $groupsarray = $modx->db->getColumn('webgroup', $rs);
+ }
+ // retain selected user groups between post
+ if(!empty($_POST['user_groups']) && is_array($_POST['user_groups'])) {
+ foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
+ }
+ ?>
+
+
+
+
+ db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name');
+ while($row = $modx->db->getRow($rs)) {
+ echo '
' . $modx->htmlspecialchars($row['name']) . '';
+ }
+ }
+ ?>
+
+ invokeEvent("OnWUsrFormRender", array(
+ "id" => $user
+ ));
+ if(is_array($evtOut)) {
+ echo implode("", $evtOut);
+ }
+ ?>
+
+
+
+
diff --git a/manager/actions/resource_selector.static.php b/manager/actions/resource_selector.static.php
index 41a2c19bb7..a14bf47842 100755
--- a/manager/actions/resource_selector.static.php
+++ b/manager/actions/resource_selector.static.php
@@ -187,7 +187,7 @@ function setCheckbox(chk)
$grd->itemClass = "tableItem";
$grd->altItemClass = "tableAltItem";
$grd->columns = $_lang["name"] . " ," . $_lang["description"];
- $grd->colTypes = "template: [+value+]";
+ $grd->colTypes = "template: [+e.value+]||template:[+e.value+]";
$grd->colWidths = "45%";
$grd->fields = "name,description";
if (isset($_REQUEST['listmode']) && $_REQUEST['listmode'] == '1') {
diff --git a/manager/actions/resources/functions.inc.php b/manager/actions/resources/functions.inc.php
index 8255a85aa4..89005304fa 100755
--- a/manager/actions/resources/functions.inc.php
+++ b/manager/actions/resources/functions.inc.php
@@ -1,267 +1,267 @@
-INCLUDE_ORDERING_ERROR Please use the EVO Content Manager instead of accessing this file directly.");
-}
-
-$tpl = array(
- 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'),
- 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
- 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
- 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
- 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl')
-);
-
-/**
- * @param string $tpl
- * @param array $ph
- * @return string
- */
-function parsePh($tpl, $ph) {
- $modx = evolutionCMS(); global $_lang;
- $tpl = $modx->parseText($tpl, $_lang, '[%', '%]');
- return $modx->parseText($tpl, $ph);
-}
-
-/**
- * @param string|int $cssId
- * @return string
- */
-function renderViewSwitchButtons($cssId) {
- $modx = evolutionCMS(); global $_lang, $tpl;
-
- return parsePh($tpl['viewForm'], array(
- 'cssId' => $cssId
- ));
-}
-
-/**
- * @param string $resourceTable
- * @param mgrResources $resources
- * @return string
- */
-function createResourceList($resourceTable, $resources) {
- $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir, $tpl;
-
- $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false;
-
- if( ! is_array($items) || empty($items)) {
- return $_lang['no_results'];
- }
-
- // Prepare elements- and categories-list
- $elements = array();
- $categories = array();
- foreach($items as $row) {
- $catid = $row['catid'] ? $row['catid'] : 0;
- $categories[$catid] = array('name' => stripslashes($row['category']));
- $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources);
- }
-
- // Now render categories / panel-collapse
- $panelGroup = '';
- foreach($elements as $catid => $elList) {
- // Add panel-heading / category-collapse to output
- $panelGroup .= parsePh($tpl['panelHeading'], array(
- 'tab' => $resourceTable,
- 'category' => $categories[$catid]['name'],
- 'categoryid' => $catid != '' ? ' (' . $catid . ') ' : '',
- 'catid' => $catid,
- ));
-
- // Prepare content for panel-collapse
- $panelCollapse = '';
- foreach($elList as $el) {
- $panelCollapse .= parsePh($tpl['elementsRow'], $el);
- }
-
- // Add panel-collapse with elements to output
- $panelGroup .= parsePh($tpl['panelCollapse'], array(
- 'tab' => $resourceTable,
- 'catid' => $catid,
- 'wrapper' => $panelCollapse,
- ));
- }
-
- return parsePh($tpl['panelGroup'], array(
- 'resourceTable' => $resourceTable,
- 'wrapper' => $panelGroup
- ));
-}
-
-/**
- * @param mgrResources $resources
- * @return string
- */
-function createCombinedView($resources) {
- $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir;
-
- $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false;
- $types = isset($resources->types) ? $resources->types : false;
- $categories = isset($resources->categories) ? $resources->categories : false;
-
- if(!$itemsPerCategory) {
- return $_lang['no_results'];
- }
-
- $tpl = array(
- 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
- 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
- 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
- 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'),
- );
-
- // Easily loop through $itemsPerCategory-Array
- $panelGroup = '';
- foreach($categories as $catid => $category) {
- // Prepare collapse content / elements-list
- $panelCollapse = '';
- foreach($itemsPerCategory[$catid] as $el) {
- $resourceTable = $el['type'];
- $ph = prepareElementRowPh($el, $resourceTable, $resources);
- $panelCollapse .= parsePh($tpl['elementsRow'], $ph);
- }
-
- // Add panel-heading / button
- $panelGroup .= parsePh($tpl['panelHeading'], array(
- 'tab' => 'categories_list',
- 'category' => $categories[$catid],
- 'categoryid' => $catid != '' ? ' (' . $catid . ') ' : '',
- 'catid' => $catid,
- ));
-
- // Add panel
- $panelGroup .= parsePh($tpl['panelCollapse'], array(
- 'tab' => 'categories_list',
- 'catid' => $catid,
- 'wrapper' => $panelCollapse,
- ));
- }
-
- return parsePh($tpl['panelGroup'], array(
- 'resourceTable' => 'categories_list',
- 'wrapper' => $panelGroup
- ));
-}
-
-/**
- * @param array $row
- * @param string $resourceTable
- * @param mgrResources $resources
- * @return array
- */
-function prepareElementRowPh($row, $resourceTable, $resources) {
- $modx = evolutionCMS(); global $modx_textdir, $_style, $_lang;
-
- $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false;
-
- $_lang["confirm_delete"] = $_lang["delete"];
- $lockElementType = '';
-
- switch($resourceTable){
- case 'site_templates':
- $class = $row['selectable'] ? '' : 'disabledPlugin';
- $lockElementType = 1;
- $_lang["confirm_delete"] = $_lang["confirm_delete_template"];
- break;
- case 'site_tmplvars':
- $class = $row['reltpl'] ? '' : 'disabledPlugin';
- $lockElementType = 2;
- $_lang["confirm_delete"] = $_lang["confirm_delete_tmplvars"];
- break;
- case 'site_htmlsnippets':
- $class = $row['disabled'] ? 'disabledPlugin' : '';
- $lockElementType = 3;
- $_lang["confirm_delete"] = $_lang["confirm_delete_htmlsnippet"];
- break;
- case 'site_snippets':
- $class = $row['disabled'] ? 'disabledPlugin' : '';
- $lockElementType = 4;
- $_lang["confirm_delete"] = $_lang["confirm_delete_snippet"];
- break;
- case 'site_plugins':
- $class = $row['disabled'] ? 'disabledPlugin' : '';
- $lockElementType = 5;
- $_lang["confirm_delete"] = $_lang["confirm_delete_plugin"];
- break;
- case 'site_modules':
- $class = $row['disabled'] ? '' : 'disabledPlugin';
- $_lang["confirm_delete"] = $_lang["confirm_delete_module"];
- break;
- default:
- return array();
- }
-
- // Prepare displaying user-locks
- $lockedByUser = '';
- $rowLock = $lockElementType ? $modx->elementIsLocked($lockElementType, $row['id'], true) : null;
- if($rowLock && $modx->hasPermission('display_locks')) {
- if($rowLock['sid'] == $modx->sid) {
- $title = $modx->parseText($_lang["lock_element_editing"], array(
- 'element_type' => $_lang["lock_element_type_" . $lockElementType],
- 'lasthit_df' => $rowLock['lasthit_df']
- ));
- $lockedByUser = '' . $_style['tree_preview_resource'] . ' ';
- } else {
- $title = $modx->parseText($_lang["lock_element_locked_by"], array(
- 'element_type' => $_lang["lock_element_type_" . $lockElementType],
- 'username' => $rowLock['username'],
- 'lasthit_df' => $rowLock['lasthit_df']
- ));
- if($modx->hasPermission('remove_locks')) {
- $lockedByUser = ' ';
- } else {
- $lockedByUser = ' ';
- }
- }
- }
- if($lockedByUser) {
- $lockedByUser = '' . $lockedByUser . '
';
- }
-
- // Caption
- if($resourceTable == 'site_tmplvars') {
- $caption = !empty($row['description']) ? ' ' . $row['caption'] . ' (' . $row['description'] . ') ' : ' ' . $row['caption'];
- } else {
- $caption = !empty($row['description']) ? ' ' . $row['description'] : '';
- }
-
- // Special marks
- $tplInfo = array();
- if($row['locked']) {
- $tplInfo[] = $_lang['locked'];
- }
- if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
- $tplInfo[] = $_lang['defaulttemplate_title'];
- }
- $marks = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ') ' : '';
-
- /* row buttons */
- $buttons = '';
- if($modx->hasPermission($types['actions']['edit'][1])) {
- $buttons .= ' ';
- }
- if($modx->hasPermission($types['actions']['duplicate'][1])) {
- $buttons .= ' ';
- }
- if($modx->hasPermission($types['actions']['remove'][1])) {
- $buttons .= ' ';
- }
- $buttons = $buttons ? '' : '';
-
- $catid = $row['catid'] ? $row['catid'] : 0;
-
- // Placeholders for elements-row
- return array(
- 'class' => $class ? ' class="' . $class . '"' : '',
- 'lockedByUser' => $lockedByUser,
- 'name' => $row['name'],
- 'caption' => $caption,
- 'buttons' => $buttons,
- 'marks' => $marks,
- 'id' => $row['id'],
- 'resourceTable' => $resourceTable,
- 'actionEdit' => $types['actions']['edit'][0],
- 'catid' => $catid,
- 'textdir' => $modx_textdir ? '' : '',
- );
-}
+INCLUDE_ORDERING_ERROR Please use the EVO Content Manager instead of accessing this file directly.");
+}
+
+$tpl = array(
+ 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'),
+ 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
+ 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
+ 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
+ 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl')
+);
+
+/**
+ * @param string $tpl
+ * @param array $ph
+ * @return string
+ */
+function parsePh($tpl, $ph) {
+ $modx = evolutionCMS(); global $_lang;
+ $tpl = $modx->parseText($tpl, $_lang, '[%', '%]');
+ return $modx->parseText($tpl, $ph);
+}
+
+/**
+ * @param string|int $cssId
+ * @return string
+ */
+function renderViewSwitchButtons($cssId) {
+ $modx = evolutionCMS(); global $_lang, $tpl;
+
+ return parsePh($tpl['viewForm'], array(
+ 'cssId' => $cssId
+ ));
+}
+
+/**
+ * @param string $resourceTable
+ * @param mgrResources $resources
+ * @return string
+ */
+function createResourceList($resourceTable, $resources) {
+ $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir, $tpl;
+
+ $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false;
+
+ if( ! is_array($items) || empty($items)) {
+ return $_lang['no_results'];
+ }
+
+ // Prepare elements- and categories-list
+ $elements = array();
+ $categories = array();
+ foreach($items as $row) {
+ $catid = $row['catid'] ? $row['catid'] : 0;
+ $categories[$catid] = array('name' => stripslashes($row['category']));
+ $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources);
+ }
+
+ // Now render categories / panel-collapse
+ $panelGroup = '';
+ foreach($elements as $catid => $elList) {
+ // Add panel-heading / category-collapse to output
+ $panelGroup .= parsePh($tpl['panelHeading'], array(
+ 'tab' => $resourceTable,
+ 'category' => $categories[$catid]['name'],
+ 'categoryid' => $catid != '' ? ' (' . $catid . ') ' : '',
+ 'catid' => $catid,
+ ));
+
+ // Prepare content for panel-collapse
+ $panelCollapse = '';
+ foreach($elList as $el) {
+ $panelCollapse .= parsePh($tpl['elementsRow'], $el);
+ }
+
+ // Add panel-collapse with elements to output
+ $panelGroup .= parsePh($tpl['panelCollapse'], array(
+ 'tab' => $resourceTable,
+ 'catid' => $catid,
+ 'wrapper' => $panelCollapse,
+ ));
+ }
+
+ return parsePh($tpl['panelGroup'], array(
+ 'resourceTable' => $resourceTable,
+ 'wrapper' => $panelGroup
+ ));
+}
+
+/**
+ * @param mgrResources $resources
+ * @return string
+ */
+function createCombinedView($resources) {
+ $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir;
+
+ $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false;
+ $types = isset($resources->types) ? $resources->types : false;
+ $categories = isset($resources->categories) ? $resources->categories : false;
+
+ if(!$itemsPerCategory) {
+ return $_lang['no_results'];
+ }
+
+ $tpl = array(
+ 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
+ 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
+ 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
+ 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'),
+ );
+
+ // Easily loop through $itemsPerCategory-Array
+ $panelGroup = '';
+ foreach($categories as $catid => $category) {
+ // Prepare collapse content / elements-list
+ $panelCollapse = '';
+ foreach($itemsPerCategory[$catid] as $el) {
+ $resourceTable = $el['type'];
+ $ph = prepareElementRowPh($el, $resourceTable, $resources);
+ $panelCollapse .= parsePh($tpl['elementsRow'], $ph);
+ }
+
+ // Add panel-heading / button
+ $panelGroup .= parsePh($tpl['panelHeading'], array(
+ 'tab' => 'categories_list',
+ 'category' => $categories[$catid],
+ 'categoryid' => $catid != '' ? ' (' . $catid . ') ' : '',
+ 'catid' => $catid,
+ ));
+
+ // Add panel
+ $panelGroup .= parsePh($tpl['panelCollapse'], array(
+ 'tab' => 'categories_list',
+ 'catid' => $catid,
+ 'wrapper' => $panelCollapse,
+ ));
+ }
+
+ return parsePh($tpl['panelGroup'], array(
+ 'resourceTable' => 'categories_list',
+ 'wrapper' => $panelGroup
+ ));
+}
+
+/**
+ * @param array $row
+ * @param string $resourceTable
+ * @param mgrResources $resources
+ * @return array
+ */
+function prepareElementRowPh($row, $resourceTable, $resources) {
+ $modx = evolutionCMS(); global $modx_textdir, $_style, $_lang;
+
+ $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false;
+
+ $_lang["confirm_delete"] = $_lang["delete"];
+ $lockElementType = '';
+
+ switch($resourceTable){
+ case 'site_templates':
+ $class = $row['selectable'] ? '' : 'disabledPlugin';
+ $lockElementType = 1;
+ $_lang["confirm_delete"] = $_lang["confirm_delete_template"];
+ break;
+ case 'site_tmplvars':
+ $class = $row['reltpl'] ? '' : 'disabledPlugin';
+ $lockElementType = 2;
+ $_lang["confirm_delete"] = $_lang["confirm_delete_tmplvars"];
+ break;
+ case 'site_htmlsnippets':
+ $class = $row['disabled'] ? 'disabledPlugin' : '';
+ $lockElementType = 3;
+ $_lang["confirm_delete"] = $_lang["confirm_delete_htmlsnippet"];
+ break;
+ case 'site_snippets':
+ $class = $row['disabled'] ? 'disabledPlugin' : '';
+ $lockElementType = 4;
+ $_lang["confirm_delete"] = $_lang["confirm_delete_snippet"];
+ break;
+ case 'site_plugins':
+ $class = $row['disabled'] ? 'disabledPlugin' : '';
+ $lockElementType = 5;
+ $_lang["confirm_delete"] = $_lang["confirm_delete_plugin"];
+ break;
+ case 'site_modules':
+ $class = $row['disabled'] ? '' : 'disabledPlugin';
+ $_lang["confirm_delete"] = $_lang["confirm_delete_module"];
+ break;
+ default:
+ return array();
+ }
+
+ // Prepare displaying user-locks
+ $lockedByUser = '';
+ $rowLock = $lockElementType ? $modx->elementIsLocked($lockElementType, $row['id'], true) : null;
+ if($rowLock && $modx->hasPermission('display_locks')) {
+ if($rowLock['sid'] == $modx->sid) {
+ $title = $modx->parseText($_lang["lock_element_editing"], array(
+ 'element_type' => $_lang["lock_element_type_" . $lockElementType],
+ 'lasthit_df' => $rowLock['lasthit_df']
+ ));
+ $lockedByUser = '' . $_style['tree_preview_resource'] . ' ';
+ } else {
+ $title = $modx->parseText($_lang["lock_element_locked_by"], array(
+ 'element_type' => $_lang["lock_element_type_" . $lockElementType],
+ 'username' => $modx->htmlspecialchars($rowLock['username']),
+ 'lasthit_df' => $rowLock['lasthit_df']
+ ));
+ if($modx->hasPermission('remove_locks')) {
+ $lockedByUser = ' ';
+ } else {
+ $lockedByUser = ' ';
+ }
+ }
+ }
+ if($lockedByUser) {
+ $lockedByUser = '' . $lockedByUser . '
';
+ }
+
+ // Caption
+ if($resourceTable == 'site_tmplvars') {
+ $caption = !empty($row['description']) ? ' ' . $row['caption'] . ' (' . $row['description'] . ') ' : ' ' . $row['caption'];
+ } else {
+ $caption = !empty($row['description']) ? ' ' . $row['description'] : '';
+ }
+
+ // Special marks
+ $tplInfo = array();
+ if($row['locked']) {
+ $tplInfo[] = $_lang['locked'];
+ }
+ if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
+ $tplInfo[] = $_lang['defaulttemplate_title'];
+ }
+ $marks = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ') ' : '';
+
+ /* row buttons */
+ $buttons = '';
+ if($modx->hasPermission($types['actions']['edit'][1])) {
+ $buttons .= ' ';
+ }
+ if($modx->hasPermission($types['actions']['duplicate'][1])) {
+ $buttons .= ' ';
+ }
+ if($modx->hasPermission($types['actions']['remove'][1])) {
+ $buttons .= ' ';
+ }
+ $buttons = $buttons ? '' : '';
+
+ $catid = $row['catid'] ? $row['catid'] : 0;
+
+ // Placeholders for elements-row
+ return array(
+ 'class' => $class ? ' class="' . $class . '"' : '',
+ 'lockedByUser' => $lockedByUser,
+ 'name' => $row['name'],
+ 'caption' => $caption,
+ 'buttons' => $buttons,
+ 'marks' => $marks,
+ 'id' => $row['id'],
+ 'resourceTable' => $resourceTable,
+ 'actionEdit' => $types['actions']['edit'][0],
+ 'catid' => $catid,
+ 'textdir' => $modx_textdir ? '' : '',
+ );
+}
diff --git a/manager/actions/resources/mgrResources.class.php b/manager/actions/resources/mgrResources.class.php
index 2b34adb3c3..6e32056103 100755
--- a/manager/actions/resources/mgrResources.class.php
+++ b/manager/actions/resources/mgrResources.class.php
@@ -1,165 +1,200 @@
INCLUDE_ORDERING_ERROR Please use the EVO Content Manager instead of accessing this file directly.");
}
-class mgrResources {
+class mgrResources
+{
/**
* @var array
*/
- public $types = array();
+ public $types = [];
/**
* @var array
*/
- public $items = array();
+ public $items = [];
/**
* @var array
*/
- public $categories = array();
+ public $categories = [];
/**
* @var array
*/
- public $itemsPerCategory = array();
+ public $itemsPerCategory = [];
/**
* mgrResources constructor.
*/
- public function __construct() {
- $this->setTypes();
- $this->queryItemsFromDB();
- $this->prepareCategoryArrays();
- }
+ public function __construct()
+ {
+ $this->setTypes();
+ $this->queryItemsFromDB();
+ $this->prepareCategoryArrays();
+ }
/**
* @return void
*/
- public function setTypes() {
- global $_lang;
- $this->types['site_templates'] = array(
- 'title'=>$_lang["manage_templates"],
- 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ),
- 'permissions'=>array('new_template','edit_template'),
- 'name'=>'templatename'
- );
- $this->types['site_tmplvars'] = array(
- 'title'=>$_lang["tmplvars"],
- 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')),
- 'permissions'=>array('new_template','edit_template'),
- );
- $this->types['site_htmlsnippets'] = array(
- 'title'=>$_lang["manage_htmlsnippets"],
- 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')),
- 'permissions'=>array('new_chunk','edit_chunk'),
- );
- $this->types['site_snippets'] = array(
- 'title'=>$_lang["manage_snippets"],
- 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')),
- 'permissions'=>array('new_snippet','edit_snippet'),
- );
- $this->types['site_plugins'] = array(
- 'title'=>$_lang["manage_plugins"],
- 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')),
- 'permissions'=>array('new_plugin','edit_plugin'),
- );
- $this->types['site_modules'] = array(
- 'title'=>$_lang["manage_modules"],
- 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')),
- 'permissions'=>array('new_module','edit_module'),
- );
- }
+ public function setTypes()
+ {
+ global $_lang;
+ $this->types['site_templates'] = [
+ 'title' => $_lang["manage_templates"],
+ 'actions' => [
+ 'edit' => [16, 'edit_template'], 'duplicate' => [96, 'new_template'],
+ 'remove' => [21, 'delete_template']
+ ],
+ 'permissions' => ['new_template', 'edit_template'],
+ 'name' => 'templatename'
+ ];
+ $this->types['site_tmplvars'] = [
+ 'title' => $_lang["tmplvars"],
+ 'actions' => [
+ 'edit' => [301, 'edit_template'], 'duplicate' => [304, 'edit_template'],
+ 'remove' => [303, 'edit_template']
+ ],
+ 'permissions' => ['new_template', 'edit_template'],
+ ];
+ $this->types['site_htmlsnippets'] = [
+ 'title' => $_lang["manage_htmlsnippets"],
+ 'actions' => [
+ 'edit' => [78, 'edit_chunk'], 'duplicate' => [97, 'new_chunk'], 'remove' => [80, 'delete_chunk']
+ ],
+ 'permissions' => ['new_chunk', 'edit_chunk'],
+ ];
+ $this->types['site_snippets'] = [
+ 'title' => $_lang["manage_snippets"],
+ 'actions' => [
+ 'edit' => [22, 'edit_snippet'], 'duplicate' => [98, 'new_snippet'], 'remove' => [25, 'delete_snippet']
+ ],
+ 'permissions' => ['new_snippet', 'edit_snippet'],
+ ];
+ $this->types['site_plugins'] = [
+ 'title' => $_lang["manage_plugins"],
+ 'actions' => [
+ 'edit' => [102, 'edit_plugin'], 'duplicate' => [105, 'new_plugin'], 'remove' => [104, 'delete_plugin']
+ ],
+ 'permissions' => ['new_plugin', 'edit_plugin'],
+ ];
+ $this->types['site_modules'] = [
+ 'title' => $_lang["manage_modules"],
+ 'actions' => [
+ 'edit' => [108, 'edit_module'], 'duplicate' => [111, 'new_module'], 'remove' => [110, 'delete_module']
+ ],
+ 'permissions' => ['new_module', 'edit_module'],
+ ];
+ }
/**
* @return void
*/
- public function queryItemsFromDB() {
- foreach($this->types as $resourceTable=>$type) {
- if($this->hasAnyPermissions($type['permissions'])) {
- $nameField = isset($type['name']) ? $type['name'] : 'name';
- $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField);
- }
- }
- }
+ public function queryItemsFromDB()
+ {
+ foreach ($this->types as $resourceTable => $type) {
+ if ($this->hasAnyPermissions($type['permissions'])) {
+ $nameField = isset($type['name']) ? $type['name'] : 'name';
+ $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField);
+ }
+ }
+ }
/**
- * @param array $permissions
+ * @param array $permissions
* @return bool
*/
- public function hasAnyPermissions($permissions) {
- $modx = evolutionCMS();
+ public function hasAnyPermissions($permissions)
+ {
+ $modx = evolutionCMS();
- foreach($permissions as $p)
- if($modx->hasPermission($p)) return true;
+ foreach ($permissions as $p) {
+ if ($modx->hasPermission($p)) {
+ return true;
+ }
+ }
- return false;
- }
+ return false;
+ }
/**
- * @param string $resourceTable
- * @param string $nameField
+ * @param string $resourceTable
+ * @param string $nameField
* @return array|bool
*/
- public function queryResources($resourceTable, $nameField = 'name') {
- $modx = evolutionCMS(); global $_lang;
+ public function queryResources($resourceTable, $nameField = 'name')
+ {
+ $modx = evolutionCMS();
+ global $_lang;
- $allowed = array(
+ $allowed = [
'site_htmlsnippets',
'site_snippets',
'site_plugins',
'site_modules'
- );
- $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : '';
-
- $tvsql = '';
- $tvjoin = '';
- if ($resourceTable === 'site_tmplvars') {
- $tvsql = 'site_tmplvars.caption, ';
- $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates'));
- $sttfield = 'IF(stt.templateid,1,0) AS reltpl,';
- }
- else $sttfield = '';
-
- $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : "";
-
- $rs = $modx->db->select(
- "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid",
- $modx->getFullTableName($resourceTable) . " AS {$resourceTable}
+ ];
+ $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : '';
+
+ $tvsql = '';
+ $tvjoin = '';
+ if ($resourceTable === 'site_tmplvars') {
+ $tvsql = 'site_tmplvars.caption, ';
+ $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl',
+ $modx->getFullTableName('site_tmplvar_templates'));
+ $sttfield = 'IF(stt.templateid,1,0) AS reltpl,';
+ } else {
+ $sttfield = '';
+ }
+
+ $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : "";
+
+ $rs = $modx->db->select(
+ "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid",
+ $modx->getFullTableName($resourceTable) . " AS {$resourceTable}
LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}",
- "",
- "category,name"
- );
- $limit = $modx->db->getRecordCount($rs);
-
- if($limit < 1) return false;
-
- $result = array();
- while ($row = $modx->db->getRow($rs)) {
- $result[] = $row;
- }
- return $result;
- }
+ "",
+ "category,name"
+ );
+ $limit = $modx->db->getRecordCount($rs);
+
+ if ($limit < 1) {
+ return false;
+ }
+
+ $result = [];
+ while ($row = $modx->db->getRow($rs)) {
+ foreach ($row as &$item) {
+ $item = str_replace(['<strong>', '</strong>'], ['', ' '], htmlspecialchars($item));
+ }
+ $result[] = $row;
+ }
+ return $result;
+ }
/**
* @return void
*/
- public function prepareCategoryArrays() {
- foreach($this->items as $type=>$items) {
- foreach((array)$items as $item) {
- $catid = $item['catid'] ? $item['catid'] : 0;
- $this->categories[$catid] = $item['category'];
-
- $item['type'] = $type;
- $this->itemsPerCategory[$catid][] = $item;
- }
- }
-
- // Sort categories by name
- natcasesort($this->categories);
-
- // Now sort by name
- foreach($this->itemsPerCategory as $catid=>$items) {
- usort($this->itemsPerCategory[$catid], function ($a, $b) {
- return strcasecmp($a['name'], $b['name']);
- });
- }
- }
+ public function prepareCategoryArrays()
+ {
+ foreach ($this->items as $type => $items) {
+ foreach ((array) $items as $item) {
+ if (empty($item['catid'])) {
+ continue;
+ }
+ $catid = $item['catid'] ? $item['catid'] : 0;
+ $this->categories[$catid] = $item['category'];
+
+ $item['type'] = $type;
+ $this->itemsPerCategory[$catid][] = $item;
+ }
+ }
+
+ // Sort categories by name
+ natcasesort($this->categories);
+
+ // Now sort by name
+ foreach ($this->itemsPerCategory as $catid => $items) {
+ usort($this->itemsPerCategory[$catid], function ($a, $b) {
+ return strcasecmp($a['name'], $b['name']);
+ });
+ }
+ }
}
diff --git a/manager/actions/role_management.static.php b/manager/actions/role_management.static.php
index bd6adb1dce..0095073a5e 100755
--- a/manager/actions/role_management.static.php
+++ b/manager/actions/role_management.static.php
@@ -48,8 +48,8 @@
} else {
?>
- = $row['name'] ?>
- = $row['description'] ?>
+ = $modx->htmlspecialchars($row['name']) ?>
+ = $modx->htmlspecialchars($row['description']) ?>
db->escape(trim($_REQUEST['searchfields']));
$search_alias = $modx->db->escape(trim($_REQUEST['searchfields']));
$templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int)$_REQUEST['templateid'] : '';
- $searchcontent = $modx->db->escape($_REQUEST['content']);
+ $searchcontent = $modx->db->escape($_REQUEST['content'] ?? '');
$fields = 'DISTINCT sc.id, contenttype, pagetitle, longtitle, description, introtext, menutitle, deleted, published, isfolder, type';
@@ -327,9 +327,9 @@
//templates
if ($modx->hasPermission('edit_template')) {
$rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'),
- "`id` like '%" . $searchfields . "%'
- OR `templatename` like '%" . $searchfields . "%'
- OR `description` like '%" . $searchfields . "%'
+ "`id` like '%" . $searchfields . "%'
+ OR `templatename` like '%" . $searchfields . "%'
+ OR `description` like '%" . $searchfields . "%'
OR `content` like '%" . $searchfields . "%'");
$templatecounts = $modx->db->getRecordCount($rs);
if ($templatecounts > 0) {
@@ -344,13 +344,13 @@
//tvs
if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
$rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'),
- "`id` like '%" . $searchfields . "%'
- OR `name` like '%" . $searchfields . "%'
- OR `description` like '%" . $searchfields . "%'
- OR `type` like '%" . $searchfields . "%'
- OR `elements` like '%" . $searchfields . "%'
- OR `display` like '%" . $searchfields . "%'
- OR `display_params` like '%" . $searchfields . "%'
+ "`id` like '%" . $searchfields . "%'
+ OR `name` like '%" . $searchfields . "%'
+ OR `description` like '%" . $searchfields . "%'
+ OR `type` like '%" . $searchfields . "%'
+ OR `elements` like '%" . $searchfields . "%'
+ OR `display` like '%" . $searchfields . "%'
+ OR `display_params` like '%" . $searchfields . "%'
OR `default_text` like '%" . $searchfields . "%'");
$tvscounts = $modx->db->getRecordCount($rs);
if ($tvscounts > 0) {
@@ -365,9 +365,9 @@
//Chunks
if ($modx->hasPermission('edit_chunk')) {
$rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'),
- "`id` like '%" . $searchfields . "%'
- OR `name` like '%" . $searchfields . "%'
- OR `description` like '%" . $searchfields . "%'
+ "`id` like '%" . $searchfields . "%'
+ OR `name` like '%" . $searchfields . "%'
+ OR `description` like '%" . $searchfields . "%'
OR `snippet` like '%" . $searchfields . "%'");
$chunkscounts = $modx->db->getRecordCount($rs);
if ($chunkscounts > 0) {
@@ -383,11 +383,11 @@
//Snippets
if ($modx->hasPermission('edit_snippet')) {
$rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'),
- "`id` like '%" . $searchfields . "%'
- OR `name` like '%" . $searchfields . "%'
- OR `description` like '%" . $searchfields . "%'
- OR `snippet` like '%" . $searchfields . "%'
- OR `properties` like '%" . $searchfields . "%'
+ "`id` like '%" . $searchfields . "%'
+ OR `name` like '%" . $searchfields . "%'
+ OR `description` like '%" . $searchfields . "%'
+ OR `snippet` like '%" . $searchfields . "%'
+ OR `properties` like '%" . $searchfields . "%'
OR `moduleguid` like '%" . $searchfields . "%'");
$snippetscounts = $modx->db->getRecordCount($rs);
if ($snippetscounts > 0) {
@@ -403,11 +403,11 @@
//plugins
if ($modx->hasPermission('edit_plugin')) {
$rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'),
- "`id` like '%" . $searchfields . "%'
- OR `name` like '%" . $searchfields . "%'
- OR `description` like '%" . $searchfields . "%'
- OR `plugincode` like '%" . $searchfields . "%'
- OR `properties` like '%" . $searchfields . "%'
+ "`id` like '%" . $searchfields . "%'
+ OR `name` like '%" . $searchfields . "%'
+ OR `description` like '%" . $searchfields . "%'
+ OR `plugincode` like '%" . $searchfields . "%'
+ OR `properties` like '%" . $searchfields . "%'
OR `moduleguid` like '%" . $searchfields . "%'");
$pluginscounts = $modx->db->getRecordCount($rs);
if ($pluginscounts > 0) {
@@ -423,12 +423,12 @@
//modules
if ($modx->hasPermission('edit_module')) {
$rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'),
- "`id` like '%" . $searchfields . "%'
- OR `name` like '%" . $searchfields . "%'
- OR `description` like '%" . $searchfields . "%'
- OR `modulecode` like '%" . $searchfields . "%'
- OR `properties` like '%" . $searchfields . "%'
- OR `guid` like '%" . $searchfields . "%'
+ "`id` like '%" . $searchfields . "%'
+ OR `name` like '%" . $searchfields . "%'
+ OR `description` like '%" . $searchfields . "%'
+ OR `modulecode` like '%" . $searchfields . "%'
+ OR `properties` like '%" . $searchfields . "%'
+ OR `guid` like '%" . $searchfields . "%'
OR `resourcefile` like '%" . $searchfields . "%'");
$modulescounts = $modx->db->getRecordCount($rs);
if ($modulescounts > 0) {
diff --git a/manager/actions/user_management.static.php b/manager/actions/user_management.static.php
index 4538038d8d..ac4e60ae64 100755
--- a/manager/actions/user_management.static.php
+++ b/manager/actions/user_management.static.php
@@ -130,8 +130,8 @@ function menuAction(a) {
if(!empty($sqlQuery)) {
$where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
}
- $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu
- INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id
+ $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu
+ INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id
LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC');
include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
@@ -156,11 +156,11 @@ function menuAction(a) {
$grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center";
$grd->colTypes = implode('||', array(
'template: ',
- 'template:[+value+] ',
- 'template:[+fullname+]',
- 'template:[+role+]',
+ 'template:[+e.value+] ',
+ 'template:[+e.fullname+]',
+ 'template:[+e.role+]',
'template:[+email+]',
- 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M',
+ 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' H:i',
'template:[+logincount+]',
'template:[+blocked+]'
));
diff --git a/manager/actions/web_access_permissions.dynamic.php b/manager/actions/web_access_permissions.dynamic.php
index dd4fba48a5..61d83b3db9 100755
--- a/manager/actions/web_access_permissions.dynamic.php
+++ b/manager/actions/web_access_permissions.dynamic.php
@@ -13,7 +13,7 @@
} else {
$docgroupselector = '' . "\n";
while($row = $modx->db->getRow($rs)) {
- $docgroupselector .= "\t" . '' . $row['name'] . " \n";
+ $docgroupselector .= "\t" . '' . $modx->htmlspecialchars($row['name']) . " \n";
}
$docgroupselector .= " \n";
}
@@ -24,7 +24,7 @@
} else {
$usrgroupselector = '' . "\n";
while($row = $modx->db->getRow($rs)) {
- $usrgroupselector .= "\t" . '' . $row['name'] . " \n";
+ $usrgroupselector .= "\t" . '' . $modx->htmlspecialchars($row['name']) . " \n";
}
$usrgroupselector .= " \n";
}
diff --git a/manager/actions/web_user_management.static.php b/manager/actions/web_user_management.static.php
index 4565c8a247..70819c2af1 100755
--- a/manager/actions/web_user_management.static.php
+++ b/manager/actions/web_user_management.static.php
@@ -8,7 +8,7 @@
// initialize page view state - the $_PAGE object
$modx->manager->initPageViewState();
-
+$sqlQuery = '';
// get and save search string
if(isset($_REQUEST['op']) && $_REQUEST['op'] == 'reset') {
$query = '';
@@ -90,7 +90,7 @@ function menuAction(a) {
-
+
@@ -124,7 +124,7 @@ function menuAction(a) {
db->select("wu.id, wu.username, wua.fullname, wua.email, wua.thislogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu
+ $ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, wua.thislogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu
INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username');
include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
$grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
@@ -137,8 +137,8 @@ function menuAction(a) {
$grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"];
$grd->colWidths = "1%,,,,1%,1%,1%";
$grd->colAligns = "center,,,,right' nowrap='nowrap,right,center";
- $grd->colTypes = "template:
||template:
[+value+] ||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') .
- " %H:%M";
+ $grd->colTypes = "template:
||template:
[+value+] ||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') .
+ " H:i";
if($listmode == '1') {
$grd->pageSize = 0;
}
diff --git a/manager/actions/welcome.static.php b/manager/actions/welcome.static.php
index add71b8581..5818c1c38d 100755
--- a/manager/actions/welcome.static.php
+++ b/manager/actions/welcome.static.php
@@ -1,13 +1,13 @@
INCLUDE_ORDERING_ERROR
Please use the EVO Content Manager instead of accessing this file directly.');
+ die('
INCLUDE_ORDERING_ERROR Please use the EVO Content Manager instead of accessing this file directly.');
}
unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
- // seems to be a new install - send the user to the configuration page
- exit('');
+ // seems to be a new install - send the user to the configuration page
+ exit('');
}
// set placeholders
@@ -17,92 +17,92 @@
// setup message info
if($modx->hasPermission('messages')) {
- include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
- $_SESSION['nrtotalmessages'] = $nrtotalmessages;
- $_SESSION['nrnewmessages'] = $nrnewmessages;
+ include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
+ $_SESSION['nrtotalmessages'] = $nrtotalmessages;
+ $_SESSION['nrnewmessages'] = $nrnewmessages;
- $msg = array();
- $msg[] = sprintf('
', $_style['icons_mail_large']);
- $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (
' . $_SESSION['nrnewmessages'] . ' )' : '';
- $msg[] = sprintf('
[%%inbox%%] %s ', $nrnewmessages);
- $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '
' . $_SESSION['nrnewmessages'] . ' ' : '0';
- $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
- $msg[] = sprintf('', $welcome_messages);
- $ph['MessageInfo'] = implode("\n", $msg);
+ $msg = array();
+ $msg[] = sprintf('
', $_style['icons_mail_large']);
+ $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (
' . $_SESSION['nrnewmessages'] . ' )' : '';
+ $msg[] = sprintf('
[%%inbox%%] %s ', $nrnewmessages);
+ $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '
' . $_SESSION['nrnewmessages'] . ' ' : '0';
+ $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
+ $msg[] = sprintf('', $welcome_messages);
+ $ph['MessageInfo'] = implode("\n", $msg);
}
// setup icons
if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
- $icon = '
[%user_management_title%]';
- $ph['SecurityIcon'] = wrapIcon($icon, 75);
+ $icon = '
[%user_management_title%]';
+ $ph['SecurityIcon'] = wrapIcon($icon, 75);
}
if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
- $icon = '
[%web_user_management_title%]';
- $ph['WebUserIcon'] = wrapIcon($icon, 99);
+ $icon = '
[%web_user_management_title%]';
+ $ph['WebUserIcon'] = wrapIcon($icon, 99);
}
if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
- $icon = '
[%modules%]';
- $ph['ModulesIcon'] = wrapIcon($icon, 106);
+ $icon = '
[%modules%]';
+ $ph['ModulesIcon'] = wrapIcon($icon, 106);
}
if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
- $icon = '
[%elements%]';
- $ph['ResourcesIcon'] = wrapIcon($icon, 76);
+ $icon = '
[%elements%]';
+ $ph['ResourcesIcon'] = wrapIcon($icon, 76);
}
if($modx->hasPermission('bk_manager')) {
- $icon = '
[%backup%]';
- $ph['BackupIcon'] = wrapIcon($icon, 93);
+ $icon = '
[%backup%]';
+ $ph['BackupIcon'] = wrapIcon($icon, 93);
}
if($modx->hasPermission('help')) {
- $icon = '
[%help%]';
- $ph['HelpIcon'] = wrapIcon($icon, 9);
+ $icon = '
[%help%]';
+ $ph['HelpIcon'] = wrapIcon($icon, 9);
}
if($modx->hasPermission('new_document')) {
- $icon = '
[%add_resource%]';
- $ph['ResourceIcon'] = wrapIcon($icon, 4);
- $icon = '
[%add_weblink%]';
- $ph['WeblinkIcon'] = wrapIcon($icon, 72);
+ $icon = '
[%add_resource%]';
+ $ph['ResourceIcon'] = wrapIcon($icon, 4);
+ $icon = '
[%add_weblink%]';
+ $ph['WeblinkIcon'] = wrapIcon($icon, 72);
}
if($modx->hasPermission('assets_images')) {
- $icon = '
[%images_management%]';
- $ph['ImagesIcon'] = wrapIcon($icon, 72);
+ $icon = '
[%images_management%]';
+ $ph['ImagesIcon'] = wrapIcon($icon, 72);
}
if($modx->hasPermission('assets_files')) {
- $icon = '
[%files_management%]';
- $ph['FilesIcon'] = wrapIcon($icon, 72);
+ $icon = '
[%files_management%]';
+ $ph['FilesIcon'] = wrapIcon($icon, 72);
}
if($modx->hasPermission('change_password')) {
- $icon = '
[%change_password%]';
- $ph['PasswordIcon'] = wrapIcon($icon, 28);
+ $icon = '
[%change_password%]';
+ $ph['PasswordIcon'] = wrapIcon($icon, 28);
}
$icon = '
[%logout%]';
$ph['LogoutIcon'] = wrapIcon($icon, 8);
// do some config checks
if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
- include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
- if($config_check_results != $_lang['configcheck_ok']) {
- $ph['config_check_results'] = $config_check_results;
- $ph['config_display'] = 'block';
- } else {
- $ph['config_display'] = 'none';
- }
+ include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
+ if($config_check_results != $_lang['configcheck_ok']) {
+ $ph['config_check_results'] = $config_check_results;
+ $ph['config_display'] = 'block';
+ } else {
+ $ph['config_display'] = 'none';
+ }
} else {
- $ph['config_display'] = 'none';
+ $ph['config_display'] = 'none';
}
// Check logout-reminder
if(isset($_SESSION['show_logout_reminder'])) {
- switch($_SESSION['show_logout_reminder']['type']) {
- case 'logout_reminder':
- $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
- $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
- break;
- }
- $ph['show_logout_reminder'] = 'block';
- unset($_SESSION['show_logout_reminder']);
+ switch($_SESSION['show_logout_reminder']['type']) {
+ case 'logout_reminder':
+ $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
+ $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
+ break;
+ }
+ $ph['show_logout_reminder'] = 'block';
+ unset($_SESSION['show_logout_reminder']);
} else {
- $ph['show_logout_reminder'] = 'none';
+ $ph['show_logout_reminder'] = 'none';
}
// Check multiple sessions
@@ -111,13 +111,13 @@
//$count = $modx->db->getValue($rs);
/*
if($count > 1) {
- $ph['multiple_sessions_msg'] = $modx->parseText($_lang['multiple_sessions_msg'], array(
- 'username' => $_SESSION['mgrShortname'],
- 'total' => $count
- ));
- $ph['show_multiple_sessions'] = 'block';
+ $ph['multiple_sessions_msg'] = $modx->parseText($_lang['multiple_sessions_msg'], array(
+ 'username' => $_SESSION['mgrShortname'],
+ 'total' => $count
+ ));
+ $ph['show_multiple_sessions'] = 'block';
} else {
- $ph['show_multiple_sessions'] = 'none';
+ $ph['show_multiple_sessions'] = 'none';
}*/
$ph['show_multiple_sessions'] = 'none';
@@ -125,36 +125,36 @@
$tpl = '
-
- [%yourinfo_username%]
- [+username+]
-
-
- [%yourinfo_role%]
- [+role+]
-
-
- [%yourinfo_previous_login%]
- [+lastlogin+]
-
-
- [%yourinfo_total_logins%]
- [+logincount+]
-
-
- [%inbox%]
- [+msginfo+]
-
+
+ [%yourinfo_username%]
+ [+username+]
+
+
+ [%yourinfo_role%]
+ [+role+]
+
+
+ [%yourinfo_previous_login%]
+ [+lastlogin+]
+
+
+ [%yourinfo_total_logins%]
+ [+logincount+]
+
+
+ [%inbox%]
+ [+msginfo+]
+
';
$nrnewmessages = '
' . $_SESSION['nrnewmessages'] . ' ';
$ph['UserInfo'] = $modx->parseText($tpl, array(
- 'username' => $modx->getLoginUserName(),
- 'role' => $_SESSION['mgrPermissions']['name'],
- 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time),
- 'logincount' => $_SESSION['mgrLogincount'] + 1,
- 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages)
+ 'username' => $modx->getLoginUserName(),
+ 'role' => $_SESSION['mgrPermissions']['name'],
+ 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time),
+ 'logincount' => $_SESSION['mgrLogincount'] + 1,
+ 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages)
));
$from = array();
@@ -163,59 +163,59 @@
$rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
if($modx->db->getRecordCount($rs) < 1) {
- $html = '
[%no_active_users_found%]
';
+ $html = '
[%no_active_users_found%]
';
} else {
- include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
- $now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
- $ph['now'] = strftime('%H:%M:%S', $now);
- $timetocheck = ($now - (60 * 20)); //+$server_offset_time;
- $html = '
-
- [%onlineusers_message%]
- [+now+] ):
-
-
-
-
-
- [%onlineusers_user%]
- ID
- [%onlineusers_ipaddress%]
- [%onlineusers_lasthit%]
- [%onlineusers_action%]
-
-
- ';
-
- $userList = array();
- $userCount = array();
- // Create userlist with session-count first before output
- while($activeusers = $modx->db->getRow($rs)) {
- $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
-
- $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
- $webicon = $activeusers['internalKey'] < 0 ? ' ' : '';
- $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip'];
- $currentaction = getAction($activeusers['action'], $activeusers['id']);
- $userList[] = array(
- $idle,
- '',
- $activeusers['username'],
- $webicon,
- abs($activeusers['internalKey']),
- $ip,
- strftime($modx->toDateFormat(0,'formatOnly').' %H:%M:%S', $activeusers['lasthit'] + $server_offset_time),
- $currentaction
- );
- }
- foreach($userList as $params) {
- $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
- $html .= "\n\t\t" . vsprintf('%s %s%s %s %s %s ', $params);
- }
-
- $html .= '
-
-
+ include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
+ $now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
+ $ph['now'] = date('H:i:s', $now);
+ $timetocheck = ($now - (60 * 20)); //+$server_offset_time;
+ $html = '
+
+ [%onlineusers_message%]
+ [+now+] ):
+
+
+
+
+
+ [%onlineusers_user%]
+ ID
+ [%onlineusers_ipaddress%]
+ [%onlineusers_lasthit%]
+ [%onlineusers_action%]
+
+
+ ';
+
+ $userList = array();
+ $userCount = array();
+ // Create userlist with session-count first before output
+ while($activeusers = $modx->db->getRow($rs)) {
+ $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
+
+ $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
+ $webicon = $activeusers['internalKey'] < 0 ? ' ' : '';
+ $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip'];
+ $currentaction = getAction($activeusers['action'], $activeusers['id']);
+ $userList[] = array(
+ $idle,
+ '',
+ $activeusers['username'],
+ $webicon,
+ abs($activeusers['internalKey']),
+ $ip,
+ date($modx->toDateFormat(0,'formatOnly').' H:i:s', $activeusers['lasthit'] + $server_offset_time),
+ $currentaction
+ );
+ }
+ foreach($userList as $params) {
+ $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
+ $html .= "\n\t\t" . vsprintf('%s %s%s %s %s %s ', $params);
+ }
+
+ $html .= '
+
+
';
}
@@ -254,135 +254,135 @@
// invoke event OnManagerWelcomePrerender
$evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
if(is_array($evtOut)) {
- $output = implode('', $evtOut);
- $ph['OnManagerWelcomePrerender'] = $output;
+ $output = implode('', $evtOut);
+ $ph['OnManagerWelcomePrerender'] = $output;
}
$buttons = '';
if($modx->hasPermission('new_document')) {
- $buttons .='
-
-
- [%add_resource%]
-
-
-
-
-
- [%add_weblink%]
-
- ';
+ $buttons .='
+
+
+ [%add_resource%]
+
+
+
+
+
+ [%add_weblink%]
+
+ ';
}
if($modx->hasPermission('assets_images')) {
- $buttons .='
-
-
- [%images_management%]
-
- ';
+ $buttons .='
+
+
+ [%images_management%]
+
+ ';
}
if($modx->hasPermission('assets_files')) {
- $buttons .='
-
-
- [%files_management%]
-
- ';
+ $buttons .='
+
+
+ [%files_management%]
+
+ ';
}
if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) {
- $buttons .='
-
-
- [%elements%]
-
- ';
+ $buttons .='
+
+
+ [%elements%]
+
+ ';
}
if($modx->hasPermission('bk_manager')) {
- $buttons .='
-
-
- [%backup%]
-
- ';
+ $buttons .='
+
+
+ [%backup%]
+
+ ';
}
if($modx->hasPermission('change_password')) {
- $buttons .='
-
-
- [%change_password%]
-
- ';
+ $buttons .='
+
+
+ [%change_password%]
+
+ ';
}
$buttons .='
-
-
- [%logout%]
-
- ';
+
+
+ [%logout%]
+
+ ';
$messages = '';
if($modx->hasPermission('messages')) {
- $messages = '
- [%inbox%]
- [[#getMessageCount]]
- ';
+ $messages = '
+ [%inbox%]
+ [[#getMessageCount]]
+ ';
}
$widgets['welcome'] = array(
- 'menuindex' => '10',
- 'id' => 'welcome',
- 'cols' => 'col-lg-6',
- 'icon' => 'fa-home',
- 'title' => '[%welcome_title%]',
- 'body' => '
-
- '.$buttons.'
-
-
-
-
- [%yourinfo_username%]
- [[#getLoginUserName]]
-
-
- [%yourinfo_role%]
- [[$_SESSION[\'mgrPermissions\'][\'name\'] ]]
-
-
- [%yourinfo_previous_login%]
- [[$_SESSION[\'mgrLastlogin\']:math(\'%s+[(server_offset_time)]\'):dateFormat]]
-
-
- [%yourinfo_total_logins%]
- [[$_SESSION[\'mgrLogincount\']:math(\'%s+1\')]]
-
- '.$messages.'
-
-
- ',
- 'hide'=>'0'
+ 'menuindex' => '10',
+ 'id' => 'welcome',
+ 'cols' => 'col-lg-6',
+ 'icon' => 'fa-home',
+ 'title' => '[%welcome_title%]',
+ 'body' => '
+
+ '.$buttons.'
+
+
+
+
+ [%yourinfo_username%]
+ [[#getLoginUserName]]
+
+
+ [%yourinfo_role%]
+ [[$_SESSION[\'mgrPermissions\'][\'name\'] ]]
+
+
+ [%yourinfo_previous_login%]
+ [[$_SESSION[\'mgrLastlogin\']:math(\'%s+[(server_offset_time)]\'):dateFormat]]
+
+
+ [%yourinfo_total_logins%]
+ [[$_SESSION[\'mgrLogincount\']:math(\'%s+1\')]]
+
+ '.$messages.'
+
+
+ ',
+ 'hide'=>'0'
);
$widgets['onlineinfo'] = array(
- 'menuindex' => '20',
- 'id' => 'onlineinfo',
- 'cols' => 'col-lg-6',
- 'icon' => 'fa-user',
- 'title' => '[%onlineusers_title%]',
- 'body' => '
[+OnlineInfo+]
',
- 'hide'=>'0'
+ 'menuindex' => '20',
+ 'id' => 'onlineinfo',
+ 'cols' => 'col-lg-6',
+ 'icon' => 'fa-user',
+ 'title' => '[%onlineusers_title%]',
+ 'body' => '
[+OnlineInfo+]
',
+ 'hide'=>'0'
);
$widgets['recentinfo'] = array(
- 'menuindex' => '30',
- 'id' => 'modxrecent_widget',
- 'cols' => 'col-sm-12',
- 'icon' => 'fa-pencil-square-o',
- 'title' => '[%activity_title%]',
- 'body' => '
[+RecentInfo+]
',
- 'hide'=>'0'
+ 'menuindex' => '30',
+ 'id' => 'modxrecent_widget',
+ 'cols' => 'col-sm-12',
+ 'icon' => 'fa-pencil-square-o',
+ 'title' => '[%activity_title%]',
+ 'body' => '
[+RecentInfo+]
',
+ 'hide'=>'0'
);
if ($modx->config['rss_url_news']) {
$widgets['news'] = array(
@@ -410,7 +410,7 @@
// invoke OnManagerWelcomeHome event
$sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
if(is_array($sitewidgets)) {
- $newwidgets = array();
+ $newwidgets = array();
foreach($sitewidgets as $widget){
$newwidgets = array_merge($newwidgets, unserialize($widget));
}
@@ -418,49 +418,37 @@
}
usort($widgets, function ($a, $b) {
- return $a['menuindex'] - $b['menuindex'];
+ return $a['menuindex'] - $b['menuindex'];
});
$tpl = getTplWidget();
$output = '';
foreach($widgets as $widget) {
- if ($widget['hide'] != '1'){
- $output .= $modx->parseText($tpl, $widget);
- }
+ if (!isset($widget['hide']) || $widget['hide'] != '1'){
+ $output .= $modx->parseText($tpl, $widget);
+ }
}
$ph['widgets'] = $output;
// load template
-if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
- $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
-}
-
-$target = $modx->config['manager_welcome_tpl'];
+$target = $modx->getConfig('manager_welcome_tpl');
$target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
$target = $modx->mergeSettingsContent($target);
if(substr($target, 0, 1) === '@') {
- if(substr($target, 0, 6) === '@CHUNK') {
- $content = $modx->getChunk(trim(substr($target, 7)));
- } elseif(substr($target, 0, 5) === '@FILE') {
- $content = file_get_contents(trim(substr($target, 6)));
- } else {
- $content = '';
- }
+ if(substr($target, 0, 6) === '@CHUNK') {
+ $content = $modx->getChunk(trim(substr($target, 7)));
+ } elseif(substr($target, 0, 5) === '@FILE') {
+ $content = file_get_contents(trim(substr($target, 6)));
+ } else {
+ $content = '';
+ }
} else {
- $chunk = $modx->getChunk($target);
- if($chunk !== false && !empty($chunk)) {
- $content = $chunk;
- } elseif(is_file(MODX_BASE_PATH . $target)) {
- $content = file_get_contents(MODX_BASE_PATH . $target);
- } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
- $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
- } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
- {
- $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
- } else {
- $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
- }
+ if(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
+ $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
+ } else {
+ $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
+ }
}
// merge placeholders
@@ -468,8 +456,8 @@
$content = $modx->mergeSettingsContent($content);
$content = $modx->parseText($content, $ph);
if(strpos($content, '[+') !== false) {
- $modx->toPlaceholders($ph);
- $content = $modx->mergePlaceholderContent($content);
+ $modx->toPlaceholders($ph);
+ $content = $modx->mergePlaceholderContent($content);
}
$content = $modx->parseDocumentSource($content);
$content = $modx->parseText($content, $_lang, '[%', '%]');
@@ -477,187 +465,187 @@
$content = $modx->cleanUpMODXTags($content); //cleanup
if($js = $modx->getRegisteredClientScripts()) {
- $content .= $js;
+ $content .= $js;
}
echo $content;
//
-//
+//
//
//
function getTplWidget() { // recent document info
- return '
-
+ return '
+
';
}
function getRecentInfo() { // recent document info
- $modx = evolutionCMS();
-
- $modx->addSnippet('recentInfoList', 'getRecentInfoList');
-
- $html = '
-
-
-
-
- [%id%]
- [%resource_title%]
- [%page_data_edited%]
- [%user%]
- [%mgrlog_action%]
-
-
-
- [[#recentInfoList]]
-
-
-
+ $modx = evolutionCMS();
+
+ $modx->addSnippet('recentInfoList', 'getRecentInfoList');
+
+ $html = '
+
+
+
+
+ [%id%]
+ [%resource_title%]
+ [%page_data_edited%]
+ [%user%]
+ [%mgrlog_action%]
+
+
+
+ [[#recentInfoList]]
+
+
+
';
- return $html;
+ return $html;
}
function getRecentInfoList() {
- $modx = evolutionCMS();
-
- $rs = $modx->db->select('id, pagetitle, editedon, editedby, deleted, published', '[+prefix+]site_content', '', 'editedon DESC', 10);
-
- if($modx->db->getRecordCount($rs) < 1) {
- return '
[%no_activity_message%] ';
- }
-
- $tpl = getRecentInfoRowTpl();
-
- $btntpl['edit'] = '
';
- $btntpl['preview_btn'] = '
';
-
- $output = array();
- while($ph = $modx->db->getRow($rs)) {
- $docid = $ph['id'];
- $_ = $modx->getUserInfo($ph['editedby']);
- $ph['username'] = $_['username'];
-
- if($ph['deleted'] == 1) {
- $ph['status'] = 'deleted text-danger';
- } elseif($ph['published'] == 0) {
- $ph['status'] = 'unpublished font-italic text-muted';
- } else {
- $ph['status'] = 'published';
- }
-
- if($modx->hasPermission('edit_document')) {
- $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']);
- } else {
- $ph['edit_btn'] = '';
- }
-
- $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : '';
- $ph['preview_btn'] = str_replace(array(
- '[+id+]',
- '[+preview_disabled+]'
- ), array(
- $docid,
- $preview_disabled
- ), $btntpl['preview_btn']);
-
- if($modx->hasPermission('delete_document')) {
- if($ph['deleted'] == 0) {
- $delete_btn = '
';
- } else {
- $delete_btn = '
';
- }
- $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn);
- } else {
- $ph['delete_btn'] = '';
- }
-
- if($ph['deleted'] == 1 && $ph['published'] == 0) {
- $publish_btn = '
';
- } elseif($ph['deleted'] == 1 && $ph['published'] == 1) {
- $publish_btn = '
';
- } elseif($ph['deleted'] == 0 && $ph['published'] == 0) {
- $publish_btn = '
';
- } else {
- $publish_btn = '
';
- }
- $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn);
-
- $ph['info_btn'] = str_replace('[+id+]', $docid, '
');
+ $modx = evolutionCMS();
+
+ $rs = $modx->db->select('id, pagetitle, editedon, editedby, deleted, published', '[+prefix+]site_content', '', 'editedon DESC', 10);
+
+ if($modx->db->getRecordCount($rs) < 1) {
+ return '
[%no_activity_message%] ';
+ }
+
+ $tpl = getRecentInfoRowTpl();
+
+ $btntpl['edit'] = '
';
+ $btntpl['preview_btn'] = '
';
+
+ $output = array();
+ while($ph = $modx->db->getRow($rs)) {
+ $docid = $ph['id'];
+ $_ = $modx->getUserInfo($ph['editedby']);
+ $ph['username'] = $_['username'] ?? '';
+
+ if($ph['deleted'] == 1) {
+ $ph['status'] = 'deleted text-danger';
+ } elseif($ph['published'] == 0) {
+ $ph['status'] = 'unpublished font-italic text-muted';
+ } else {
+ $ph['status'] = 'published';
+ }
+
+ if($modx->hasPermission('edit_document')) {
+ $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']);
+ } else {
+ $ph['edit_btn'] = '';
+ }
+
+ $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : '';
+ $ph['preview_btn'] = str_replace(array(
+ '[+id+]',
+ '[+preview_disabled+]'
+ ), array(
+ $docid,
+ $preview_disabled
+ ), $btntpl['preview_btn']);
+
+ if($modx->hasPermission('delete_document')) {
+ if($ph['deleted'] == 0) {
+ $delete_btn = '
';
+ } else {
+ $delete_btn = '
';
+ }
+ $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn);
+ } else {
+ $ph['delete_btn'] = '';
+ }
+
+ if($ph['deleted'] == 1 && $ph['published'] == 0) {
+ $publish_btn = '
';
+ } elseif($ph['deleted'] == 1 && $ph['published'] == 1) {
+ $publish_btn = '
';
+ } elseif($ph['deleted'] == 0 && $ph['published'] == 0) {
+ $publish_btn = '
';
+ } else {
+ $publish_btn = '
';
+ }
+ $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn);
+
+ $ph['info_btn'] = str_replace('[+id+]', $docid, '
');
$ph['longtitle'] = !isset($ph['longtitle']) || $ph['longtitle'] == '' ? '(
[%not_set%] )' : html_escape($ph['longtitle']);
$ph['description'] = !isset($ph['description']) || $ph['description'] == '' ? '(
[%not_set%] )' : html_escape($ph['description']);
$ph['introtext'] = !isset($ph['introtext']) || $ph['introtext'] == '' ? '(
[%not_set%] )' : html_escape($ph['introtext']);
$ph['alias'] = !isset($ph['alias']) || $ph['alias'] == '' ? '(
[%not_set%] )' : html_escape($ph['alias']);
- $output[] = $modx->parseText($tpl, $ph);
- }
- return implode("\n", $output);
+ $output[] = $modx->parseText($tpl, $ph);
+ }
+ return implode("\n", $output);
}
function getRecentInfoRowTpl() {
- $modx = EvolutionCMS();
- $tpl = '
-
- [+id+]
- [+pagetitle:htmlentities+]
- [+editedon:math("%s+[(server_offset_time)]"):dateFormat=`'.$modx->toDateFormat(0,'formatOnly').' %H:%M:%S`+]
- [+username:htmlentities+]
- [+edit_btn+][+preview_btn+][+delete_btn+][+publish_btn+][+info_btn+]
-
-
-
-
-
- [%long_title%] : [+longtitle+]
- [%description%] : [+description+]
- [%resource_summary%] : [+introtext+]
- [%type%] : [+type:is(reference):then([%weblink%]):else([%resource%])+]
- [%resource_alias%] : [+alias+]
- [%page_data_cacheable%] : [+cacheable:is(1):then([%yes%]):else([%no%])+]
- [%resource_opt_show_menu%] : [+hidemenu:is(0):then([%yes%]):else([%no%])+]
- [%page_data_template%] : [+template:templatename:htmlentities+]
-
-
-
- ';
- return $tpl;
+ $modx = EvolutionCMS();
+ $tpl = '
+
+ [+id+]
+ [+pagetitle:htmlentities+]
+ [+editedon:math("%s+[(server_offset_time)]"):dateFormat=`'.$modx->toDateFormat(0,'formatOnly').' H:i:s`+]
+ [+username:htmlentities+]
+ [+edit_btn+][+preview_btn+][+delete_btn+][+publish_btn+][+info_btn+]
+
+
+
+
+
+ [%long_title%] : [+longtitle+]
+ [%description%] : [+description+]
+ [%resource_summary%] : [+introtext+]
+ [%type%] : [+type:is(reference):then([%weblink%]):else([%resource%])+]
+ [%resource_alias%] : [+alias+]
+ [%page_data_cacheable%] : [+cacheable:is(1):then([%yes%]):else([%no%])+]
+ [%resource_opt_show_menu%] : [+hidemenu:is(0):then([%yes%]):else([%no%])+]
+ [%page_data_template%] : [+template:templatename:htmlentities+]
+
+
+
+ ';
+ return $tpl;
}
// setup icons
function wrapIcon($i, $action) {
- return sprintf('
%s ', $action, $i);
+ return sprintf('
%s ', $action, $i);
}
function getStartUpScript() {
- $script = '
+ $script = '
';
- return $script;
+ return $script;
}
diff --git a/manager/frames/1.php b/manager/frames/1.php
index 8ee2d350b3..9537348d48 100755
--- a/manager/frames/1.php
+++ b/manager/frames/1.php
@@ -1,658 +1,679 @@
-INCLUDE_ORDERING_ERROR
Please use the EVO Content Manager instead of accessing this file directly.");
-}
-header("X-XSS-Protection: 0");
-
-$_SESSION['browser'] = (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 1') !== false) ? 'legacy_IE' : 'modern';
-
-// invoke OnManagerPreFrameLoader
-$modx->invokeEvent('OnManagerPreFrameLoader', array('action' => $action));
-
-$mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en';
-
-if (!isset($modx->config['manager_menu_height'])) {
- $modx->config['manager_menu_height'] = 2.2; // rem
-}
-
-if (!isset($modx->config['manager_tree_width'])) {
- $modx->config['manager_tree_width'] = 20; // rem
-}
-
-if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) {
- $initMainframeAction = $_SESSION['onLoginForwardToAction'];
- unset($_SESSION['onLoginForwardToAction']);
-} else {
- $initMainframeAction = 2; // welcome.static
-}
-
-if (!isset($_SESSION['tree_show_only_folders'])) {
- $_SESSION['tree_show_only_folders'] = 0;
-}
-
-$body_class = '';
-$menu_height = $modx->config['manager_menu_height'];
-$tree_width = $modx->config['manager_tree_width'];
-$tree_min_width = 0;
-
-if (isset($_COOKIE['MODX_widthSideBar'])) {
- $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar'];
-} else {
- $MODX_widthSideBar = $tree_width;
-}
-
-if (!$MODX_widthSideBar) {
- $body_class .= 'sidebar-closed';
-}
-
-$theme_mode = isset($_COOKIE['MODX_themeMode']) ? $_COOKIE['MODX_themeMode'] : '';
-$theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
-if (!empty($theme_modes[$theme_mode])) {
- $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
-} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
- $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
-}
-
-$navbar_position = $modx->config['manager_menu_position'];
-if ($navbar_position == 'left') {
- $body_class .= ' navbar-left navbar-left-icon-and-text';
-}
-
-if (isset($modx->pluginCache['ElementsInTree'])) {
- $body_class .= ' ElementsInTree';
-}
-
-$unlockTranslations = array(
- 'msg' => $_lang["unlock_element_id_warning"],
- 'type1' => $_lang["lock_element_type_1"],
- 'type2' => $_lang["lock_element_type_2"],
- 'type3' => $_lang["lock_element_type_3"],
- 'type4' => $_lang["lock_element_type_4"],
- 'type5' => $_lang["lock_element_type_5"],
- 'type6' => $_lang["lock_element_type_6"],
- 'type7' => $_lang["lock_element_type_7"],
- 'type8' => $_lang["lock_element_type_8"]
-);
-
-foreach ($unlockTranslations as $key => $value) {
- $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value);
-}
-
-$user = $modx->getUserInfo($modx->getLoginUserID());
-if (isset($user['which_browser']) && $user['which_browser'] == 'default') {
- $user['which_browser'] = $modx->config['which_browser'];
-}
-
-$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime;
-
-if ($modx->config['manager_theme'] == 'default') {
- if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
- require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
- $minifier = new Formatter\CSSMinify();
- $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
- $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css');
- $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css');
- $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css');
- $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css');
- $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css');
- $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css');
- $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css');
- $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css');
- $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css');
- $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css');
- $css = $minifier->minify();
- file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css);
- }
- if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
- $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
- }
-}
-
-$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin')));
-
-?>
-
->
-
-
= $site_name ?> (EVO CMS Manager)
-
-
-
-
-
- config['show_picker'] != "0") { ?>
-
-
-
-
-
-
-
-
-
- config['show_picker'] != "0") { ?>
-
-
-
-
- invokeEvent('OnManagerTopPrerender', $_REQUEST);
- if (is_array($evtOut)) {
- echo implode("\n", $evtOut);
- }
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- config['show_fullscreen_btn'] != "0") { ?>
-
- ">
-
-
-
-
-
-
-
-
-
-
-
-
-
- config['global_tabs']): ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- manager->saveLastUserSetting($param, $_REQUEST[$param]);
- $_SESSION[$param] = $_REQUEST[$param];
- } else if (!isset($_SESSION[$param])) {
- $_SESSION[$param] = $modx->manager->getLastUserSetting($param);
- }
- }
- ?>
-
-
-
- = $_lang["sort_tree"] ?>
-
- >= $_lang['folder'] ?>
- >= $_lang['pagetitle'] ?>
- >= $_lang['long_title'] ?>
- >= $_lang['id'] ?>
- >= $_lang['resource_opt_menu_index'] ?>
- >= $_lang['createdon'] ?>
- >= $_lang['editedon'] ?>
- >= $_lang['page_data_publishdate'] ?>
- >= $_lang['page_data_alias'] ?>
-
-
-
-
- >= $_lang['sort_desc'] ?>
- >= $_lang['sort_asc'] ?>
-
-
-
- = $_lang["setting_resource_tree_node_name"] ?>
-
- >= trim($_lang['default'], ':') ?>
- >= $_lang['pagetitle'] ?>
- >= $_lang['long_title'] ?>
- >= $_lang['resource_opt_menu_title'] ?>
- >= $_lang['alias'] ?>
- >= $_lang['createdon'] ?>
- >= $_lang['editedon'] ?>
- >= $_lang['page_data_publishdate'] ?>
-
-
-
-
- /> = $_lang['view_child_resources_in_container'] ?>
-
-
-
-
-
-
-
-
- ', $action, $action);
- echo sprintf('
%s
', $img, $text);
- }
- }
-
- ?>
-
-
- config['show_fullscreen_btn'] != "0") { ?>
-
-
- invokeEvent('OnManagerFrameLoader', array('action' => $action));
- ?>
-
-
-config['show_picker'] != "0") {
- include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
-} ?>
-
-
+INCLUDE_ORDERING_ERROR
Please use the EVO Content Manager instead of accessing this file directly.");
+}
+header("X-XSS-Protection: 0");
+
+$_SESSION['browser'] = (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 1') !== false) ? 'legacy_IE' : 'modern';
+
+// invoke OnManagerPreFrameLoader
+$modx->invokeEvent('OnManagerPreFrameLoader', array('action' => $action));
+
+$mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en';
+
+if (!isset($modx->config['manager_menu_height'])) {
+ $modx->config['manager_menu_height'] = 2.2; // rem
+}
+
+if (!isset($modx->config['manager_tree_width'])) {
+ $modx->config['manager_tree_width'] = 20; // rem
+}
+
+if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) {
+ $initMainframeAction = $_SESSION['onLoginForwardToAction'];
+ unset($_SESSION['onLoginForwardToAction']);
+} else {
+ $initMainframeAction = 2; // welcome.static
+}
+
+if (!isset($_SESSION['tree_show_only_folders'])) {
+ $_SESSION['tree_show_only_folders'] = 0;
+}
+
+$body_class = '';
+$menu_height = $modx->config['manager_menu_height'];
+$tree_width = $modx->config['manager_tree_width'];
+$tree_min_width = 0;
+
+if (isset($_COOKIE['MODX_widthSideBar'])) {
+ $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar'];
+} else {
+ $MODX_widthSideBar = $tree_width;
+}
+
+if (!$MODX_widthSideBar) {
+ $body_class .= 'sidebar-closed';
+}
+
+$theme_mode = isset($_COOKIE['MODX_themeMode']) ? $_COOKIE['MODX_themeMode'] : '';
+$theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
+if (!empty($theme_modes[$theme_mode])) {
+ $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
+} elseif (!empty($theme_modes[$modx->config['manager_theme_mode'] ?? 3])) {
+ $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode'] ?? 3];
+}
+
+$navbar_position = $modx->config['manager_menu_position'] ?? 'top';
+if ($navbar_position == 'left') {
+ $body_class .= ' navbar-left navbar-left-icon-and-text';
+}
+
+if (isset($modx->pluginCache['ElementsInTree'])) {
+ $body_class .= ' ElementsInTree';
+}
+
+$unlockTranslations = array(
+ 'msg' => $_lang["unlock_element_id_warning"],
+ 'type1' => $_lang["lock_element_type_1"],
+ 'type2' => $_lang["lock_element_type_2"],
+ 'type3' => $_lang["lock_element_type_3"],
+ 'type4' => $_lang["lock_element_type_4"],
+ 'type5' => $_lang["lock_element_type_5"],
+ 'type6' => $_lang["lock_element_type_6"],
+ 'type7' => $_lang["lock_element_type_7"],
+ 'type8' => $_lang["lock_element_type_8"]
+);
+
+foreach ($unlockTranslations as $key => $value) {
+ $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value);
+}
+
+$user = $modx->getUserInfo($modx->getLoginUserID());
+if (isset($user['which_browser']) && $user['which_browser'] == 'default') {
+ $user['which_browser'] = $modx->config['which_browser'];
+}
+
+$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime;
+
+if ($modx->config['manager_theme'] == 'default') {
+ if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
+ require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
+ $minifier = new Formatter\CSSMinify();
+ $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
+ $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css');
+ $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css');
+ $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css');
+ $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css');
+ $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css');
+ $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css');
+ $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css');
+ $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css');
+ $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css');
+ $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css');
+ $css = $minifier->minify();
+ file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css);
+ }
+ if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
+ $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
+ }
+}
+
+$modx->config['global_tabs'] = (int) (isset($modx->config['global_tabs']) && $modx->config['global_tabs'] && ($user['role'] == 1
+ || $modx->hasPermission('edit_template')
+ || $modx->hasPermission('edit_chunk')
+ || $modx->hasPermission('edit_snippet')
+ || $modx->hasPermission('edit_plugin')
+ || $modx->hasPermission('edit_document')
+ )
+);
+$which_browser = $which_browser ?? 'mcpuk';
+?>
+
+>
+
+
= $site_name ?> (EVO CMS Manager)
+
+
+
+
+
+ config['show_picker'] != "0") { ?>
+
+
+
+
+
+
+
+
+
+ config['show_picker'] != "0") { ?>
+
+
+
+
+ invokeEvent('OnManagerTopPrerender', $_REQUEST);
+ if (is_array($evtOut)) {
+ echo implode("\n", $evtOut);
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ config['show_fullscreen_btn'] != "0") { ?>
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+ config['global_tabs']): ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ manager->saveLastUserSetting($param, $_REQUEST[$param]);
+ $_SESSION[$param] = $_REQUEST[$param];
+ } else if (!isset($_SESSION[$param])) {
+ $_SESSION[$param] = $modx->manager->getLastUserSetting($param);
+ }
+ }
+ ?>
+
+
+
+ = $_lang["sort_tree"] ?>
+
+ >= $_lang['folder'] ?>
+ >= $_lang['pagetitle'] ?>
+ >= $_lang['long_title'] ?>
+ >= $_lang['id'] ?>
+ >= $_lang['resource_opt_menu_index'] ?>
+ >= $_lang['createdon'] ?>
+ >= $_lang['editedon'] ?>
+ >= $_lang['page_data_publishdate'] ?>
+ >= $_lang['page_data_alias'] ?>
+
+
+
+
+ >= $_lang['sort_desc'] ?>
+ >= $_lang['sort_asc'] ?>
+
+
+
+ = $_lang["setting_resource_tree_node_name"] ?>
+
+ >= trim($_lang['default'], ':') ?>
+ >= $_lang['pagetitle'] ?>
+ >= $_lang['long_title'] ?>
+ >= $_lang['resource_opt_menu_title'] ?>
+ >= $_lang['alias'] ?>
+ >= $_lang['createdon'] ?>
+ >= $_lang['editedon'] ?>
+ >= $_lang['page_data_publishdate'] ?>
+
+
+
+
+ /> = $_lang['view_child_resources_in_container'] ?>
+
+
+
+
+
+
+
+
+ ', $action, $action);
+ echo sprintf('
%s
', $img, $text);
+ }
+ }
+
+ ?>
+
+
+ config['show_fullscreen_btn'] != "0") { ?>
+
+
+ invokeEvent('OnManagerFrameLoader', array('action' => $action));
+ ?>
+
+
+config['show_picker'] != "0") {
+ include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
+} ?>
+
+
diff --git a/manager/frames/mainmenu.php b/manager/frames/mainmenu.php
index cd73ebd9a2..e6044769c4 100755
--- a/manager/frames/mainmenu.php
+++ b/manager/frames/mainmenu.php
@@ -238,9 +238,9 @@
$sitemenu['module' . $row['id']] = array(
'module' . $row['id'],
'modules',
- ($row['icon'] != '' ? '
' : '
') . $row['name'],
+ ($row['icon'] != '' ? '
' : '
') . $modx->htmlspecialchars($row['name']),
'index.php?a=112&id=' . $row['id'],
- $row['name'],
+ $modx->htmlspecialchars($row['name']),
'',
'',
'main',
diff --git a/manager/includes/accesscontrol.inc.php b/manager/includes/accesscontrol.inc.php
index 7de125cb48..8b7de3d917 100755
--- a/manager/includes/accesscontrol.inc.php
+++ b/manager/includes/accesscontrol.inc.php
@@ -97,11 +97,11 @@
} else {
$modx->setPlaceholder('login_bg', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/images/login/default/login-background.jpg');
}
-
+
// set form position css class
- $modx->setPlaceholder('login_form_position_class', 'loginbox-' . $modx->config['login_form_position']);
-
- switch ($modx->config['manager_theme_mode']) {
+ $modx->setPlaceholder('login_form_position_class', 'loginbox-' . ($modx->config['login_form_position'] ?? 'left'));
+
+ switch ($modx->config['manager_theme_mode'] ?? 3) {
case '1':
$modx->setPlaceholder('manager_theme_style', 'lightness');
break;
@@ -116,7 +116,7 @@
break;
}
// set form style css class
- $modx->setPlaceholder('login_form_style_class', 'loginbox-' . $modx->config['login_form_style']);
+ $modx->setPlaceholder('login_form_style_class', 'loginbox-' . ($modx->config['login_form_style'] ?? 'dark'));
// andrazk 20070416 - notify user of install/update
if (isset($_GET['installGoingOn'])) {
diff --git a/manager/includes/config_check.inc.php b/manager/includes/config_check.inc.php
index 1ac749d6d7..7cf7205ad3 100755
--- a/manager/includes/config_check.inc.php
+++ b/manager/includes/config_check.inc.php
@@ -162,6 +162,7 @@ function checkSiteCache() {
if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3';
$config_check_results = "
".$_lang['configcheck_notok']." ";
+$_SESSION['mgrConfigCheck'] = false;
for ($i=0;$i
hasPermission('settings')) {
$warnings[$i][2] .= '';
}
- if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
+ if(!isset($_SESSION["mgrConfigCheck"]) || !$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
break;
case $_lang['configcheck_lang_difference'] :
$warnings[$i][1] = $_lang['configcheck_lang_difference_msg'];
diff --git a/manager/includes/controls/datagrid.class.php b/manager/includes/controls/datagrid.class.php
index e6f6c8e34b..60e2f9e5ab 100755
--- a/manager/includes/controls/datagrid.class.php
+++ b/manager/includes/controls/datagrid.class.php
@@ -279,9 +279,9 @@ public function formatColumnValue($row, $value, $type, &$align) {
$value = strtotime($value);
}
if(!$type_format) {
- $type_format = "%A %d, %B %Y";
+ $type_format = "l d, F Y";
}
- $value = strftime($type_format, $value);
+ $value = date($type_format, $value);
break;
case "boolean":
@@ -298,11 +298,12 @@ public function formatColumnValue($row, $value, $type, &$align) {
case "template":
// replace [+value+] first
- $value = str_replace("[+value+]", $value, $type_format);
+ $value = str_replace(["[+value+]", "[+e.value+]"], [$value, htmlspecialchars($value)], $type_format);
+
// replace other [+fields+]
if(strpos($value, "[+") !== false) {
foreach($row as $k => $v) {
- $value = str_replace("[+$k+]", $v, $value);
+ $value = str_replace(["[+$k+]", "[+e.$k+]"], [$v, htmlspecialchars($v)], $value);
}
}
break;
diff --git a/manager/includes/default_config.php b/manager/includes/default_config.php
index 9afd6e9718..7e398a7b0a 100755
--- a/manager/includes/default_config.php
+++ b/manager/includes/default_config.php
@@ -83,7 +83,7 @@
$c['session_timeout'] = 15;
$c['site_unavailable_message'] = $_lang['siteunavailable_message_default'];
$c['allow_eval'] = 'with_scan';
-$c['safe_functions_at_eval'] = 'time,date,strtotime,strftime';
+$c['safe_functions_at_eval'] = 'time,date,strtotime';
$c['use_udperms'] = '1';
$c['email_sender_method'] = 1;
$c['email_method'] = 'mail';
@@ -113,4 +113,3 @@
$c['manager_menu_position'] = 'top';
$c['tinymce4_skin'] = 'lightgray';
$c['chunk_processor'] = '';
-$c['enable_mootools'] = 1;
diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php
index 5435b75224..187c8ac62f 100755
--- a/manager/includes/document.parser.class.inc.php
+++ b/manager/includes/document.parser.class.inc.php
@@ -132,7 +132,6 @@ class DocumentParser
public $snippetsTime = [];
public $chunkCache;
public $snippetCache;
- public $contentTypes;
public $dumpSQL = false;
public $queryCode;
public $virtualDir;
@@ -149,7 +148,6 @@ class DocumentParser
public $pluginCache = [];
public $aliasListing;
public $lockedElements = null;
- public $tmpCache = [];
private $version = [];
public $extensions = [];
public $cacheKey = null;
@@ -309,7 +307,7 @@ public function loadExtension($extname, $reload = true)
*/
public function getMicroTime()
{
- list ($usec, $sec) = explode(' ', microtime());
+ [$usec, $sec] = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}
@@ -342,7 +340,7 @@ public function sendRedirect($url, $count_attempts = false, $type = 'REDIRECT_HE
}
$url .= sprintf(
'%serr=%s',
- strpos($url, '?') > 0 ? '?' : '&',
+ strpos($url, '?') !==false ? '&' : '?',
($currentNumberOfRedirects + 1)
);
}
@@ -428,13 +426,16 @@ public function sendUnauthorizedPage($noEvent = false)
$this->invokeEvent('OnPageUnauthorized');
}
if ($this->config['unauthorized_page']) {
- $unauthorizedPage = $this->config['unauthorized_page'];
- } elseif ($this->config['error_page']) {
- $unauthorizedPage = $this->config['error_page'];
- } else {
- $unauthorizedPage = $this->config['site_start'];
+ $this->sendForward($this->config['unauthorized_page'], 'HTTP/1.1 401 Unauthorized');
+ exit();
+ }
+
+ if ($this->config['error_page']) {
+ $this->sendForward($this->config['error_page'], 'HTTP/1.1 401 Unauthorized');
+ exit();
}
- $this->sendForward($unauthorizedPage, 'HTTP/1.1 401 Unauthorized');
+
+ $this->sendForward($this->config['site_start'], 'HTTP/1.1 401 Unauthorized');
exit();
}
@@ -503,12 +504,17 @@ public function getSettings()
$this->config['friendly_url_suffix'] = '';
}
+ if (!isset($this->config['which_browser'])) {
+ $this->config['which_browser'] = 'mcpuk';
+ }
+
if (!isset($this->config['enable_at_syntax'])) {
$this->config['enable_at_syntax'] = 1;
} // @TODO: This line is temporary, should be remove in next version
// now merge user settings into evo-configuration
$this->getUserSettings();
+ $this->invokeEvent('OnLoadSettings', ['config' => &$this->config]);
}
private function recoverySiteCache()
@@ -979,8 +985,8 @@ public function outputContent($noEvent = false)
{
$this->documentOutput = $this->documentContent;
- if ($this->documentGenerated == 1 && $this->documentObject['cacheable'] == 1) {
- if($this->documentObject['type'] === 'document' && $this->documentObject['published'] == 1) {
+ if ($this->documentGenerated && $this->documentObject['cacheable']) {
+ if($this->documentObject['type'] === 'document' && $this->documentObject['published']) {
if (!empty($this->sjscripts)) {
$this->documentObject['__MODxSJScripts__'] = $this->sjscripts;
}
@@ -1035,13 +1041,12 @@ public function outputContent($noEvent = false)
$name = $this->cleanUpMODXTags($name);
$name = strtolower($name);
$name = preg_replace('/&.+?;/', '', $name); // kill entities
- $name = preg_replace('/[^\.%a-z0-9 _-]/', '', $name);
+ $name = preg_replace('/[^.%a-z0-9 _-]/', '', $name);
$name = preg_replace('/\s+/', '-', $name);
- $name = preg_replace('|-+|', '-', $name);
+ $name = preg_replace('/-+/', '-', $name);
$name = trim($name, '-');
}
- $header = 'Content-Disposition: attachment; filename=' . $name;
- header($header);
+ header('Content-Disposition: attachment; filename=' . $name);
}
}
$this->setConditional();
@@ -1120,7 +1125,7 @@ public function outputContent($noEvent = false)
*/
public function RecoveryEscapedTags($contents)
{
- list($sTags, $rTags) = $this->getTagsForEscape();
+ [$sTags, $rTags] = $this->getTagsForEscape();
return str_replace($rTags, $sTags, $contents);
}
@@ -1162,7 +1167,13 @@ public function getTimerStats($tstart)
public function setConditional()
{
- if (!empty($_POST) || (defined('MODX_API_MODE') && MODX_API_MODE) || $this->getLoginUserID('mgr') || !$this->useConditional || empty($this->recentUpdate)) {
+ if (!empty($_POST)) {
+ return;
+ }
+ if (defined('MODX_API_MODE') && MODX_API_MODE) {
+ return;
+ }
+ if ($this->getLoginUserID('mgr') || !$this->useConditional || empty($this->recentUpdate)) {
return;
}
$last_modified = gmdate('D, d M Y H:i:s T', $this->recentUpdate);
@@ -1447,9 +1458,9 @@ public function mergeDocumentContent($content, $ph = false)
$key = substr($key, 1);
} // remove # for QuickEdit format
- list($key, $modifiers) = $this->splitKeyAndFilter($key);
+ [$key, $modifiers] = $this->splitKeyAndFilter($key);
if (strpos($key, '@') !== false) {
- list($key, $context) = explode('@', $key, 2);
+ [$key, $context] = explode('@', $key, 2);
} else {
$context = false;
}
@@ -1492,12 +1503,12 @@ public function _contextValue($key, $parent = false)
if (preg_match('/@\d+\/u/', $key)) {
$key = str_replace(array('@', '/u'), array('@u(', ')'), $key);
}
- list($key, $str) = explode('@', $key, 2);
+ [$key, $str] = explode('@', $key, 2);
if (strpos($str, '(')) {
- list($context, $option) = explode('(', $str, 2);
+ [$context, $option] = explode('(', $str, 2);
} else {
- list($context, $option) = array($str, false);
+ [$context, $option] = array($str, false);
}
if ($option) {
@@ -1538,7 +1549,7 @@ public function _contextValue($key, $parent = false)
} elseif (strpos($option, ',') === false) {
$option .= ',ASC';
}
- list($by, $dir) = explode(',', $option, 2);
+ [$by, $dir] = explode(',', $option, 2);
$children = $this->getActiveChildren($parent, $by, $dir);
$find = false;
$prev = false;
@@ -1564,7 +1575,7 @@ public function _contextValue($key, $parent = false)
} elseif (strpos($option, ',') === false) {
$option .= ',ASC';
}
- list($by, $dir) = explode(',', $option, 2);
+ [$by, $dir] = explode(',', $option, 2);
$children = $this->getActiveChildren($parent, $by, $dir);
$find = false;
$next = false;
@@ -1624,7 +1635,7 @@ public function mergeSettingsContent($content, $ph = false)
}
foreach ($matches[1] as $i => $key) {
- list($key, $modifiers) = $this->splitKeyAndFilter($key);
+ [$key, $modifiers] = $this->splitKeyAndFilter($key);
if (!isset($ph[$key])) {
continue;
@@ -1679,7 +1690,7 @@ public function mergeChunkContent($content, $ph = false)
$key = $snip_call['name'];
$params = $this->getParamsFromString($snip_call['params']);
- list($key, $modifiers) = $this->splitKeyAndFilter($key);
+ [$key, $modifiers] = $this->splitKeyAndFilter($key);
if (!isset($ph[$key])) {
$ph[$key] = $this->getChunk($key);
@@ -1752,7 +1763,7 @@ public function mergePlaceholderContent($content, $ph = false)
}
foreach ($matches[1] as $i => $key) {
- list($key, $modifiers) = $this->splitKeyAndFilter($key);
+ [$key, $modifiers] = $this->splitKeyAndFilter($key);
if (isset($ph[$key])) {
$value = $ph[$key];
@@ -1803,7 +1814,7 @@ public function mergeConditionalTagsContent($content, $iftag = '<@IF:', $elseift
$content = $split;
continue;
}
- list($cmd, $text) = explode('>', $split, 2);
+ [$cmd, $text] = explode('>', $split, 2);
$cmd = str_replace("'", "\'", $cmd);
$content .= "_parseCTagCMD('" . $cmd . "')): ?>";
$content .= $text;
@@ -1814,7 +1825,7 @@ public function mergeConditionalTagsContent($content, $iftag = '<@IF:', $elseift
$content = $split;
continue;
}
- list($cmd, $text) = explode('>', $split, 2);
+ [$cmd, $text] = explode('>', $split, 2);
$cmd = str_replace("'", "\'", $cmd);
$content .= "_parseCTagCMD('" . $cmd . "')): ?>";
$content .= $text;
@@ -1977,7 +1988,7 @@ public function escapeLiteralTagsContent($content, $left = '<@LITERAL>', $right
return $content;
}
- list($sTags, $rTags) = $this->getTagsForEscape();
+ [$sTags, $rTags] = $this->getTagsForEscape();
foreach ($matches[1] as $i => $v) {
$v = str_ireplace($sTags, $rTags, $v);
$s = &$matches[0][$i];
@@ -2041,7 +2052,7 @@ public function evalPlugin($pluginCode, $params)
// When reached here, no fatal error occured so the lock should be removed.
/*if(is_file($lock_file_path)) unlink($lock_file_path);*/
- if ((0 < $this->config['error_reporting']) && $msg && isset($php_errormsg)) {
+ if ((0 < ($this->config['error_reporting'] ?? 1)) && $msg && isset($php_errormsg)) {
$error_info = error_get_last();
if ($this->detectError($error_info['type'])) {
$msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
@@ -2171,7 +2182,7 @@ public function _getSGVar($value)
$key = $value;
$_ = $this->config['enable_filter'];
$this->config['enable_filter'] = 1;
- list($key, $modifiers) = $this->splitKeyAndFilter($key);
+ [$key, $modifiers] = $this->splitKeyAndFilter($key);
$this->config['enable_filter'] = $_;
$key = str_replace(array('(', ')'), array("['", "']"), $key);
$key = rtrim($key, ';');
@@ -2213,7 +2224,7 @@ private function _get_snip_result($piece)
$snip_call = $this->_split_snip_call($piece);
$key = $snip_call['name'];
- list($key, $modifiers) = $this->splitKeyAndFilter($key);
+ [$key, $modifiers] = $this->splitKeyAndFilter($key);
$snip_call['name'] = $key;
$snippetObject = $this->_getSnippetObject($key);
if (is_null($snippetObject['content'])) {
@@ -2285,7 +2296,7 @@ public function getParamsFromString($string = '')
if (in_array($delim, array('"', "'", '`'))) {
$null = null;
//list(, $value, $_tmp)
- list($null, $value, $_tmp) = explode($delim, $_tmp, 3);
+ [$null, $value, $_tmp] = explode($delim, $_tmp, 3);
unset($null);
if (substr(trim($_tmp), 0, 2) === '//') {
@@ -2293,7 +2304,7 @@ public function getParamsFromString($string = '')
}
$i = 0;
while ($delim === '`' && substr(trim($_tmp), 0, 1) !== '&' && 1 < substr_count($_tmp, '`')) {
- list($inner, $outer, $_tmp) = explode('`', $_tmp, 3);
+ [$inner, $outer, $_tmp] = explode('`', $_tmp, 3);
$value .= "`{$inner}`{$outer}";
$i++;
if (200 < $i) {
@@ -2304,7 +2315,7 @@ public function getParamsFromString($string = '')
$value = rtrim($value, '`');
}
} elseif (strpos($_tmp, '&') !== false) {
- list($value, $_tmp) = explode('&', $_tmp, 2);
+ [$value, $_tmp] = explode('&', $_tmp, 2);
$value = trim($value);
} else {
$value = $_tmp;
@@ -2365,7 +2376,7 @@ public function getParamsFromString($string = '')
$k = substr($k, 0, -2);
$params[$k][] = current($p);
} elseif (strpos($k, '[') !== false && substr($k, -1) === ']') {
- list($k, $subk) = explode('[', $k, 2);
+ [$k, $subk] = explode('[', $k, 2);
$subk = substr($subk, 0, -1);
$params[$k][$subk] = current($p);
} else {
@@ -2570,7 +2581,7 @@ public function rewriteUrls($documentSource)
{
// rewrite the urls
if ($this->config['friendly_urls'] == 1) {
- $aliases = [];
+ $aliases = $isfolder = array();
if (is_array($this->documentListing)) {
foreach ($this->documentListing as $path => $docid) { // This is big Loop on large site!
$aliases[$docid] = $path;
@@ -2614,15 +2625,15 @@ public function rewriteUrls($documentSource)
$pref = $this->config['friendly_url_prefix'];
$suff = $this->config['friendly_url_suffix'];
$documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
- global $modx;
+ if ( empty($aliases[$m[1]]) && empty($isfolder[$m[1]]) ) $m[1] = $this->getConfig('error_page');
$thealias = $aliases[$m[1]];
$thefolder = $isfolder[$m[1]];
if ($isfriendly && isset($thealias)) {
//found friendly url
- $out = ($modx->config['seostrict'] == '1' ? $modx->toAlias($modx->makeFriendlyURL($pref, $suff, $thealias, $thefolder, $m[1])) : $modx->makeFriendlyURL($pref, $suff, $thealias, $thefolder, $m[1]));
+ $out = ($this->getConfig('seostrict') == '1' ? $this->toAlias($this->makeFriendlyURL($pref, $suff, $thealias, $thefolder, $m[1])) : $this->makeFriendlyURL($pref, $suff, $thealias, $thefolder, $m[1]));
} else {
//not found friendly url
- $out = $modx->makeFriendlyURL($pref, $suff, $m[1]);
+ $out = $this->makeFriendlyURL($pref, $suff, $m[1]);
}
return $out;
}, $documentSource);
@@ -2650,7 +2661,7 @@ public function sendStrictURI()
$scheme = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
$len_base_url = strlen($this->config['base_url']);
- $url_path = $q;//LANG
+ $url_path = $q ?? '';//LANG
if (substr($url_path, 0, $len_base_url) === $this->config['base_url']) {
$url_path = substr($url_path, $len_base_url);
@@ -3259,10 +3270,11 @@ public function getUltimateParentId($id, $top = 0)
*/
public function getChildIds($id, $depth = 10, $children = [])
{
+ static $cache = null;
$cacheKey = md5(print_r(func_get_args(), true));
- if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) {
- return $this->tmpCache[__FUNCTION__][$cacheKey];
+ if (isset($cache[$cacheKey])) {
+ return $cache[$cacheKey];
}
if ($this->config['aliaslistingfolder'] == 1 || (isset($this->config['full_aliaslisting']) && $this->config['full_aliaslisting'] == 1)) {
@@ -3287,7 +3299,7 @@ public function getChildIds($id, $depth = 10, $children = [])
$children = $this->getChildIds($idx, $depth, $children);
}
}
- $this->tmpCache[__FUNCTION__][$cacheKey] = $children;
+ $cache[$cacheKey] = $children;
return $children;
} else {
@@ -3318,7 +3330,7 @@ public function getChildIds($id, $depth = 10, $children = [])
}
}
}
- $this->tmpCache[__FUNCTION__][$cacheKey] = $children;
+ $cache[$cacheKey] = $children;
return $children;
}
@@ -3405,7 +3417,7 @@ function __alertQuit() {
public function hasPermission($pm)
{
$state = 0;
- $pms = $_SESSION['mgrPermissions'];
+ $pms = $_SESSION['mgrPermissions'] ?? [];
if ($pms) {
$state = ((isset($pms[$pm]) ? (bool) $pms[$pm] : false) === true);
}
@@ -3791,25 +3803,25 @@ public function sendmail($params = [], $msg = '', $files = [])
$sendto = (!isset($p['to'])) ? $this->config['emailsender'] : $p['to'];
$sendto = explode(',', $sendto);
foreach ($sendto as $address) {
- list($name, $address) = $this->mail->address_split($address);
+ [$name, $address] = $this->mail->address_split($address);
$this->mail->AddAddress($address, $name);
}
if (isset($p['cc'])) {
$p['cc'] = explode(',', $p['cc']);
foreach ($p['cc'] as $address) {
- list($name, $address) = $this->mail->address_split($address);
+ [$name, $address] = $this->mail->address_split($address);
$this->mail->AddCC($address, $name);
}
}
if (isset($p['bcc'])) {
$p['bcc'] = explode(',', $p['bcc']);
foreach ($p['bcc'] as $address) {
- list($name, $address) = $this->mail->address_split($address);
+ [$name, $address] = $this->mail->address_split($address);
$this->mail->AddBCC($address, $name);
}
}
if (isset($p['from']) && strpos($p['from'], '<') !== false && substr($p['from'], -1) === '>') {
- list($p['fromname'], $p['from']) = $this->mail->address_split($p['from']);
+ [$p['fromname'], $p['from']] = $this->mail->address_split($p['from']);
}
$this->mail->setFrom(
isset($p['from']) ? $p['from'] : $this->config['emailsender'],
@@ -3823,9 +3835,16 @@ public function sendmail($params = [], $msg = '', $files = [])
if (!is_array($files)) {
$files = [];
}
- foreach ($files as $f) {
- if (file_exists(MODX_BASE_PATH . $f) && is_file(MODX_BASE_PATH . $f) && is_readable(MODX_BASE_PATH . $f)) {
- $this->mail->AddAttachment(MODX_BASE_PATH . $f);
+ foreach ($files as $name => $path) {
+ if (!is_file($path) || !is_readable($path)) {
+ $path = MODX_BASE_PATH . $path;
+ }
+ if (is_file($path) && is_readable($path)) {
+ if (is_numeric($name)) {
+ $mail->AddAttachment($path);
+ } else {
+ $mail->AddAttachment($path, $name);
+ }
}
}
$rs = $this->mail->send();
@@ -3882,12 +3901,11 @@ public function isFrontend()
* @param string $dir Sort direction, ASC and DESC is possible
* Default: ASC
* @param string $fields Default: id, pagetitle, description, parent, alias, menutitle
+ * @param bool $checkAccess
+ * - Check document access permissions. Default: true.
* @return array
*/
- public function getAllChildren($id = 0,
- $sort = 'menuindex',
- $dir = 'ASC',
- $fields = 'id, pagetitle, description, parent, alias, menutitle')
+ public function getAllChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $fields = 'id, pagetitle, description, parent, alias, menutitle', $checkAccess = true)
{
static $cache = null;
@@ -3903,9 +3921,9 @@ public function getAllChildren($id = 0,
sprintf('LEFT JOIN %s dg on dg.document=sc.id', $this->getFullTableName('document_groups'))
],
sprintf(
- "sc.parent='%s' AND (%s) GROUP BY sc.id",
+ "sc.parent='%s' %s GROUP BY sc.id",
$id,
- $this->docAccessConditions()
+ $checkAccess ? 'AND (' . $this->docAccessConditions() . ')' : ''
),
sprintf(
'sc.%s %s',
@@ -3931,12 +3949,11 @@ public function getAllChildren($id = 0,
* @param string $dir Sort direction, ASC and DESC is possible
* Default: ASC
* @param string $fields Default: id, pagetitle, description, parent, alias, menutitle
+ * @param bool $checkAccess
+ * - Check document access permissions. Default: true.
* @return array
*/
- public function getActiveChildren($id = 0,
- $sort = 'menuindex',
- $dir = 'ASC',
- $fields = 'id, pagetitle, description, parent, alias, menutitle')
+ public function getActiveChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $fields = 'id, pagetitle, description, parent, alias, menutitle', $checkAccess = true)
{
static $cache = null;
$cacheKey = md5(print_r(func_get_args(), true));
@@ -3984,17 +4001,10 @@ public function getActiveChildren($id = 0,
* @param $sort {comma separated string} - Should be a comma-separated list of field names on which to sort. Default: 'menuindex'.
* @param $dir {'ASC'; 'DESC'} - Sort direction, ASC and DESC is possible. Default: 'ASC'.
* @param $limit {string} - Should be a valid SQL LIMIT clause without the 'LIMIT ' i.e. just include the numbers as a string. Default: Empty string (no limit).
- *
+ * @param bool $checkAccess - Check document access permissions. Default: true.
* @return {array; false} - Result array, or false.
*/
- public function getDocumentChildren($parentid = 0,
- $published = 1,
- $deleted = 0,
- $fields = '*',
- $where = '',
- $sort = 'menuindex',
- $dir = 'ASC',
- $limit = '')
+ public function getDocumentChildren($parentid = 0, $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '', $checkAccess = true)
{
static $cache = null;
@@ -4017,12 +4027,12 @@ public function getDocumentChildren($parentid = 0,
sprintf('LEFT JOIN %s dg on dg.document=sc.id', $this->getFullTableName('document_groups'))
],
sprintf(
- "sc.parent='%s' %s %s %s AND (%s) GROUP BY sc.id",
+ "sc.parent='%s' %s %s %s %s GROUP BY sc.id",
$parentid,
$published !== 'all' ? 'AND sc.published = ' . $published : '',
$deleted !== 'all' ? 'AND sc.deleted = ' . $deleted : '',
$where ? 'AND ' . $where : '',
- $this->docAccessConditions()
+ $checkAccess ? 'AND (' . $this->docAccessConditions() . ')' : ''
),
$sort
? sprintf(
@@ -4056,17 +4066,12 @@ public function getDocumentChildren($parentid = 0,
* @param $sort {comma separated string} - A comma-separated list of field names to sort by. Default: 'menuindex'.
* @param $dir {'ASC'; 'DESC'} - Sorting direction. Default: 'ASC'.
* @param $limit {string} - SQL LIMIT (without 'LIMIT '). An empty string means no limit. Default: ''.
+ * @param bool $checkAccess
+ * - Check document access permissions. Default: true.
*
* @return {array; false} - Result array with documents, or false.
*/
- public function getDocuments($ids = [],
- $published = 1,
- $deleted = 0,
- $fields = '*',
- $where = '',
- $sort = 'menuindex',
- $dir = 'ASC',
- $limit = '')
+ public function getDocuments($ids = array(), $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '', $checkAccess = true)
{
static $cache = null;
@@ -4094,12 +4099,12 @@ public function getDocuments($ids = [],
sprintf("LEFT JOIN %s dg on dg.document=sc.id", $this->getFullTableName('document_groups'))
],
sprintf(
- "(sc.id IN (%s) %s %s %s) AND (%s) GROUP BY sc.id",
+ "(sc.id IN (%s) %s %s %s) %s GROUP BY sc.id",
implode(',', $ids),
$published === 'all' ? '' : sprintf("AND sc.published='%s'", $published),
$deleted === 'all' ? '' : sprintf("AND sc.deleted='%s'", $deleted),
$where ? 'AND ' . $where : '',
- $this->docAccessConditions()
+ $checkAccess ? 'AND (' . $this->docAccessConditions() . ')' : ''
),
$sort
? sprintf('sc.%s %s', implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))), $dir)
@@ -4145,16 +4150,18 @@ private function docAccessConditions() {
* - Document publication status. Once the parameter equals 'all', the result will be returned regardless of whether the documents are published or they are not. Default: false.
* @param int $deleted {0; 1; 'all'}
* - Document removal status. Once the parameter equals 'all', the result will be returned regardless of whether the documents are deleted or they are not. Default: 0.
+ * @param bool $checkAccess
+ * - Check document access permissions. Default: true.
* @return bool {array; false} - Result array with fields or false.
* - Result array with fields or false.
*/
- public function getDocument($id = 0, $fields = '*', $published = 1, $deleted = 0)
+ public function getDocument($id = 0, $fields = '*', $published = 1, $deleted = 0, $checkAccess = true)
{
if (!$id) {
return false;
}
- $docs = $this->getDocuments(array($id), $published, $deleted, $fields, '', '', '', 1);
+ $docs = $this->getDocuments(array($id), $published, $deleted, $fields, '', '', '', 1, $checkAccess);
if (!$docs) {
return false;
@@ -4188,6 +4195,12 @@ public function getField($field = 'content', $docid = '')
}
$doc = $this->getDocumentObject('id', $docid);
+
+ if (!isset($doc[$field])) {
+ $cache[$field][$docid] = false;
+ return false;
+ }
+
if (is_array($doc[$field])) {
$tvs = $this->getTemplateVarOutput($field, $docid, 'all');
$cache[$field][$docid] = $tvs[$field];
@@ -4211,7 +4224,7 @@ public function getField($field = 'content', $docid = '')
* Default: id, pagetitle, description, alias
* @return boolean|array
*/
- public function getPageInfo($pageid = null, $active = 1, $fields = 'id, pagetitle, description, alias')
+ public function getPageInfo($pageid = -1, $active = 1, $fields = 'id, pagetitle, description, alias', $checkAccess = true)
{
static $cache = null;
@@ -4231,10 +4244,10 @@ public function getPageInfo($pageid = null, $active = 1, $fields = 'id, pagetitl
sprintf('LEFT JOIN %s dg on dg.document = sc.id', $this->getFullTableName('document_groups'))
],
sprintf(
- "(sc.id='%s' %s) AND (%s)",
+ "(sc.id='%s' %s) %s",
$pageid,
$active == 1 ? "AND sc.published=1 AND sc.deleted=0" : '',
- $this->docAccessConditions()
+ $checkAccess ? 'AND (' . $this->docAccessConditions() . ')' : ''
),
'',
1
@@ -4255,19 +4268,19 @@ public function getPageInfo($pageid = null, $active = 1, $fields = 'id, pagetitl
* Default: id, pagetitle, description, alias
* @return boolean|array
*/
- public function getParent($pid = -1, $active = 1, $fields = 'id, pagetitle, description, alias, parent')
+ public function getParent($pid = -1, $active = 1, $fields = 'id, pagetitle, description, alias, parent', $checkAccess = true)
{
if ($pid == -1) {
$pid = $this->documentObject['parent'];
- return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields);
- } elseif ($pid == 0) {
+ return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields, $checkAccess);
+ } else if ($pid == 0) {
return false;
} else {
// first get the child document
- $child = $this->getPageInfo($pid, $active, "parent");
+ $child = $this->getPageInfo($pid, $active, "parent", $checkAccess);
// now return the child's parent
$pid = ($child['parent']) ? $child['parent'] : 0;
- return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields);
+ return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields, $checkAccess);
}
}
@@ -4396,20 +4409,22 @@ public function makeUrl($id, $alias = '', $args = '', $scheme = '')
if ($this->config['aliaslistingfolder'] == 1 || (isset($this->config['full_aliaslisting']) && $this->config['full_aliaslisting'] == 1)) {
$al = $this->getAliasListing($id);
+ } elseif(empty($this->aliasListing[$id])) {
+ $al = $this->aliasListing[$this->config['error_page']];
} else {
$al = $this->aliasListing[$id];
}
+ if (!empty($al)) {
+ if ($al['isfolder'] === 1 && $this->config['make_folders'] === '1') {
+ $f_url_suffix = '/';
+ }
- if ($al['isfolder'] === 1 && $this->config['make_folders'] === '1') {
- $f_url_suffix = '/';
- }
-
- $alPath = !empty ($al['path']) ? $al['path'] . '/' : '';
+ $alPath = !empty ($al['path']) ? $al['path'] . '/' : '';
- if ($al && $al['alias']) {
- $alias = $al['alias'];
+ if ($al && $al['alias']) {
+ $alias = $al['alias'];
+ }
}
-
}
$alias = $alPath . $f_url_prefix . $alias . $f_url_suffix;
@@ -4463,6 +4478,7 @@ public function makeUrl($id, $alias = '', $args = '', $scheme = '')
*/
public function getAliasListing($id)
{
+ $out = [];
if (isset($this->aliasListing[$id])) {
$out = $this->aliasListing[$id];
} else {
@@ -4481,7 +4497,7 @@ public function getAliasListing($id)
if ($this->config['use_alias_path'] == '1') {
//&& $tmp['path'] != '' - fix error slash with epty path
$tmp = $this->getAliasListing($this->aliasListing[$id]['parent']);
- $this->aliasListing[$id]['path'] = $tmp['path'] . ($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '') . $tmp['alias'] : '');
+ $this->aliasListing[$id]['path'] = ($tmp['path'] ?? '') . ($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '') . $tmp['alias'] : '');
} else {
$this->aliasListing[$id]['path'] = '';
}
@@ -4490,6 +4506,7 @@ public function getAliasListing($id)
$out = $this->aliasListing[$id];
}
}
+
return $out;
}
@@ -4501,36 +4518,39 @@ public function getAliasListing($id)
* @param string $name
* @return bool|string
*/
- public function getConfig($name = '')
+ public function getConfig($name = '', $default = null)
{
- if (!empty ($this->config[$name])) {
- return $this->config[$name];
- } else {
- return false;
+ if (!isset($this->config[$name])) {
+ return $default;
}
+ return $this->config[$name];
}
/**
* Returns the EVO version information as version, branch, release date and full application name.
*
- * @param null $data
+ * @param null $key
* @return array
*/
- public function getVersionData($data = null)
+ public function getVersionData($key = null)
{
$out = [];
if (empty($this->version) || !is_array($this->version)) {
//include for compatibility modx version < 1.0.10
include MODX_MANAGER_PATH . "includes/version.inc.php";
- $this->version = [];
- $this->version['version'] = isset($modx_version) ? $modx_version : '';
- $this->version['branch'] = isset($modx_branch) ? $modx_branch : '';
- $this->version['release_date'] = isset($modx_release_date) ? $modx_release_date : '';
- $this->version['full_appname'] = isset($modx_full_appname) ? $modx_full_appname : '';
- $this->version['new_version'] = isset($this->config['newversiontext']) ? $this->config['newversiontext'] : '';
+ $this->version = [
+ 'version' => $modx_version ?? '',
+ 'branch' => $modx_branch ?? '',
+ 'release_date' => $modx_release_date ?? '',
+ 'full_appname' => $modx_full_appname ?? '',
+ 'new_version' => $this->config['newversiontext'] ?? ''
+ ];
+ }
+ if (!$key) {
+ return $this->version;
}
- return (!is_null($data) && is_array($this->version) && isset($this->version[$data])) ? $this->version[$data] : $this->version;
+ return $this->version[$key];
}
/**
@@ -4543,26 +4563,45 @@ public function getVersionData($data = null)
public function runSnippet($snippetName, $params = [])
{
if (isset ($this->snippetCache[$snippetName])) {
- $snippet = $this->snippetCache[$snippetName];
- $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : '';
- } else { // not in cache so let's check the db
- $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->db->escape($snippetName) . "' AND ss.disabled=0;";
- $result = $this->db->query($sql);
- if ($this->db->getRecordCount($result) == 1) {
- $row = $this->db->getRow($result);
- $snippet = $this->snippetCache[$snippetName] = $row['snippet'];
- $mergedProperties = array_merge($this->parseProperties($row['properties']), $this->parseProperties($row['sharedproperties']));
- $properties = $this->snippetCache[$snippetName . "Props"] = json_encode($mergedProperties);
- } else {
- $snippet = $this->snippetCache[$snippetName] = "return false;";
- $properties = $this->snippetCache[$snippetName . "Props"] = '';
- }
+ $parameters = $this->parseProperties(
+ $this->snippetCache[$snippetName . 'Props'] ?? '',
+ $snippetName,
+ 'snippet'
+ );
+ return $this->evalSnippet(
+ $this->snippetCache[$snippetName],
+ array_merge($parameters, $params)
+ );
}
- // load default params/properties
+
+ $result = $this->db->select(
+ "snippet.`name`, snippet.`snippet`, snippet.`properties`, module.properties as `sharedproperties`",
+ [
+ sprintf('%s as snippet', $this->getFullTableName("site_snippets")),
+ sprintf(
+ 'LEFT JOIN %s as module on module.guid=snippet.moduleguid',
+ $this->getFullTableName('site_modules')
+ )
+ ],
+ "snippet.`name`='" . $this->db->escape($snippetName) . "' AND snippet.disabled=0"
+ );
+ if ($this->db->getRecordCount($result) != 1) {
+ $this->snippetCache[$snippetName] = 'return false;';
+ $this->snippetCache[$snippetName . 'Props'] = '';
+ return $this->evalSnippet('return false;', []);
+ }
+
+ $row = $this->db->getRow($result);
+ $snippet = $this->snippetCache[$snippetName] = $row['snippet'];
+ $mergedProperties = array_merge(
+ $this->parseProperties($row['properties']),
+ $this->parseProperties($row['sharedproperties'])
+ );
+ $properties = json_encode($mergedProperties);
+ $this->snippetCache[$snippetName . 'Props'] = $properties;
+
$parameters = $this->parseProperties($properties, $snippetName, 'snippet');
$parameters = array_merge($parameters, $params);
-
- // run snippet
return $this->evalSnippet($snippet, $parameters);
}
@@ -4574,26 +4613,36 @@ public function runSnippet($snippetName, $params = [])
*/
public function getChunk($chunkName)
{
- $out = null;
- if (empty($chunkName)) {
- // nop
- } elseif ($this->isChunkProcessor('DLTemplate')) {
- $out = DLTemplate::getInstance($this)->getChunk($chunkName);
- } elseif (isset ($this->chunkCache[$chunkName])) {
- $out = $this->chunkCache[$chunkName];
- } elseif (stripos($chunkName, '@FILE') === 0) {
- $out = $this->chunkCache[$chunkName] = $this->atBindFileContent($chunkName);
- } else {
- $where = sprintf("`name`='%s' AND disabled=0", $this->db->escape($chunkName));
- $rs = $this->db->select('snippet', '[+prefix+]site_htmlsnippets', $where);
- if ($this->db->getRecordCount($rs) == 1) {
- $row = $this->db->getRow($rs);
- $out = $this->chunkCache[$chunkName] = $row['snippet'];
- } else {
- $out = $this->chunkCache[$chunkName] = null;
- }
+ if (!$chunkName) {
+ return null;
}
- return $out;
+
+ if ($this->isChunkProcessor('DLTemplate')) {
+ return DLTemplate::getInstance($this)->getChunk($chunkName);
+ }
+
+ if (isset ($this->chunkCache[$chunkName])) {
+ return $this->chunkCache[$chunkName];
+ }
+
+ if (stripos($chunkName, '@FILE') === 0) {
+ $this->chunkCache[$chunkName] = $this->atBindFileContent($chunkName);
+ return $this->chunkCache[$chunkName];
+ }
+
+ $rs = $this->db->select(
+ 'snippet',
+ '[+prefix+]site_htmlsnippets',
+ sprintf("`name`='%s' AND disabled=0", $this->db->escape($chunkName))
+ );
+ if ($this->db->getRecordCount($rs) != 1) {
+ $this->chunkCache[$chunkName] = null;
+ return null;
+ }
+
+ $row = $this->db->getRow($rs);
+ $this->chunkCache[$chunkName] = $row['snippet'];
+ return $this->chunkCache[$chunkName];
}
/**
@@ -4635,7 +4684,7 @@ public function parseText($tpl = '', $ph = [], $left = '[+', $right = '+]', $exe
foreach ($matches[1] as $i => $key) {
if (strpos($key, ':') !== false && $execModifier) {
- list($key, $modifiers) = $this->splitKeyAndFilter($key);
+ [$key, $modifiers] = $this->splitKeyAndFilter($key);
} else {
$modifiers = false;
}
@@ -4670,13 +4719,22 @@ public function parseText($tpl = '', $ph = [], $left = '[+', $right = '+]', $exe
*/
public function isChunkProcessor($processor)
{
- $value = (string)$this->getConfig('chunk_processor');
-
if(is_object($processor)) {
$processor = get_class($processor);
}
- return is_scalar($processor) && mb_strtolower($value) === mb_strtolower($processor) && class_exists($processor, false);
+ if (!is_scalar($processor)) {
+ return false;
+ }
+
+ if (mb_strtolower($this->getConfig('chunk_processor', '')) !== mb_strtolower($processor)) {
+ return false;
+ }
+ if (!class_exists($processor, false)) {
+ return false;
+ }
+
+ return true;
}
/**
@@ -4701,9 +4759,14 @@ public function parseChunk($chunkName, $chunkArr, $prefix = '{', $suffix = '}')
return false;
}
- return $prefix === '[+' && $suffix === '+]' && $this->isChunkProcessor('DLTemplate') ?
- DLTemplate::getInstance($this)->parseChunk($chunkName, $chunkArr) :
- $this->parseText($this->getChunk($chunkName), $chunkArr, $prefix, $suffix);
+ if ($prefix !== '[+' || $suffix !== '+]') {
+ return $this->parseText($this->getChunk($chunkName), $chunkArr, $prefix, $suffix);
+ }
+ if (!$this->isChunkProcessor('DLTemplate')) {
+ return $this->parseText($this->getChunk($chunkName), $chunkArr);
+ }
+
+ return DLTemplate::getInstance($this)->parseChunk($chunkName, $chunkArr);
}
/**
@@ -4755,31 +4818,26 @@ public function toDateFormat($timestamp = 0, $mode = '')
{
$timestamp = trim($timestamp);
if ($mode !== 'formatOnly' && empty($timestamp)) {
- return '-';
+ return '';
}
$timestamp = (int)$timestamp;
switch ($this->config['datetime_format']) {
case 'YYYY/mm/dd':
- $dateFormat = '%Y/%m/%d';
+ $dateFormat = 'Y/m/d';
break;
case 'dd-mm-YYYY':
- $dateFormat = '%d-%m-%Y';
+ $dateFormat = 'd-m-Y';
break;
case 'mm/dd/YYYY':
- $dateFormat = '%m/%d/%Y';
- break;
- /*
- case 'dd-mmm-YYYY':
- $dateFormat = '%e-%b-%Y';
+ $dateFormat = 'm/d/Y';
break;
- */
}
if (empty($mode)) {
- $strTime = strftime($dateFormat . " %H:%M:%S", $timestamp);
+ $strTime = date($dateFormat . " H:i:s", $timestamp);
} elseif ($mode == 'dateOnly') {
- $strTime = strftime($dateFormat, $timestamp);
+ $strTime = date($dateFormat, $timestamp);
} elseif ($mode == 'formatOnly') {
$strTime = $dateFormat;
}
@@ -4804,19 +4862,19 @@ public function toTimeStamp($str)
if (!preg_match('/^[0-9]{4}\/[0-9]{2}\/[0-9]{2}[0-9 :]*$/', $str)) {
return '';
}
- list ($Y, $m, $d, $H, $M, $S) = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d');
+ [$Y, $m, $d, $H, $M, $S] = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d');
break;
case 'dd-mm-YYYY':
if (!preg_match('/^[0-9]{2}-[0-9]{2}-[0-9]{4}[0-9 :]*$/', $str)) {
return '';
}
- list ($d, $m, $Y, $H, $M, $S) = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d');
+ [$d, $m, $Y, $H, $M, $S] = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d');
break;
case 'mm/dd/YYYY':
if (!preg_match('/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}[0-9 :]*$/', $str)) {
return '';
}
- list ($m, $d, $Y, $H, $M, $S) = sscanf($str, '%2d/%2d/%4d %2d:%2d:%2d');
+ [$m, $d, $Y, $H, $M, $S] = sscanf($str, '%2d/%2d/%4d %2d:%2d:%2d');
break;
/*
case 'dd-mmm-YYYY':
@@ -4857,18 +4915,12 @@ public function toTimeStamp($str)
* Default: rank
* @param string $tvsortdir How to sort each element of the result array i.e. how to sort the TVs (direction)
* Default: ASC
+ * @param bool $checkAccess - Check document access permissions. Default: true.
* @return array|bool
*/
- public function getDocumentChildrenTVars($parentid = 0,
- $tvidnames = [],
- $published = 1,
- $docsort = "menuindex",
- $docsortdir = "ASC",
- $tvfields = "*",
- $tvsort = "rank",
- $tvsortdir = "ASC")
+ public function getDocumentChildrenTVars($parentid = 0, $tvidnames = array(), $published = 1, $docsort = "menuindex", $docsortdir = "ASC", $tvfields = "*", $tvsort = "rank", $tvsortdir = "ASC", $checkAccess = true)
{
- $docs = $this->getDocumentChildren($parentid, $published, 0, '*', '', $docsort, $docsortdir);
+ $docs = $this->getDocumentChildren($parentid, $published, 0, '*', '', $docsort, $docsortdir, '', $checkAccess);
if (!$docs) {
return false;
}
@@ -4943,12 +4995,13 @@ public function getDocumentChildrenTVars($parentid = 0,
* - SQL WHERE condition (use only document fields, not TV). Default: ''.
* @param string $resultKey {string; false}
* - Field, which values are keys into result array. Use the “false”, that result array keys just will be numbered. Default: 'id'.
+ * @param bool $checkAccess - Check document access permissions. Default: true.
* @return array {array; false} - Result array, or false.
* - Result array, or false.
*/
- public function getDocumentChildrenTVarOutput($parentid = 0, $tvidnames = [], $published = 1, $sortBy = 'menuindex', $sortDir = 'ASC', $where = '', $resultKey = 'id')
+ public function getDocumentChildrenTVarOutput($parentid = 0, $tvidnames = array(), $published = 1, $sortBy = 'menuindex', $sortDir = 'ASC', $where = '', $resultKey = 'id', $checkAccess = true)
{
- $docs = $this->getDocumentChildren($parentid, $published, 0, 'id', $where, $sortBy, $sortDir);
+ $docs = $this->getDocumentChildren($parentid, $published, 0, 'id', $where, $sortBy, $sortDir, '', $checkAccess);
if (!$docs) {
return false;
@@ -5004,13 +5057,13 @@ public function getDocumentChildrenTVarOutput($parentid = 0, $tvidnames = [], $p
* Default: 1
* @return bool
*/
- public function getTemplateVar($idname = "", $fields = "*", $docid = "", $published = 1)
+ public function getTemplateVar($idname = "", $fields = "*", $docid = "", $published = 1, $checkAccess = true)
{
if ($idname == "") {
return false;
}
- $result = $this->getTemplateVars(array($idname), $fields, $docid, $published, "", ""); //remove sorting for speed
+ $result = $this->getTemplateVars(array($idname), $fields, $docid, $published, "", "", $checkAccess); //remove sorting for speed
return ($result != false) ? $result[0] : false;
}
@@ -5031,12 +5084,7 @@ public function getTemplateVar($idname = "", $fields = "*", $docid = "", $publis
*
* @return array|bool Result array, or false.
*/
- public function getTemplateVars($idnames = [],
- $fields = '*',
- $docid = '',
- $published = 1,
- $sort = 'rank',
- $dir = 'ASC')
+ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', $published = 1, $sort = 'rank', $dir = 'ASC', $checkAccess = true)
{
static $cache = null;
$cacheKey = md5(print_r(func_get_args(), true));
@@ -5055,7 +5103,7 @@ public function getTemplateVars($idnames = [],
$docid = $this->documentIdentifier;
$docRow = $this->documentObject;
} else {
- $docRow = $this->getDocument($docid, '*', $published);
+ $docRow = $this->getDocument($docid, '*', $published, 0, $checkAccess);
if (!$docRow) {
$cache[$cacheKey] = false;
return false;
@@ -5395,8 +5443,10 @@ public function getLoginUserType()
*/
public function getUserInfo($uid)
{
- if (isset($this->tmpCache[__FUNCTION__][$uid])) {
- return $this->tmpCache[__FUNCTION__][$uid];
+ static $cache = null;
+
+ if (isset($cache[$uid])) {
+ return $cache[$uid];
}
$from = '[+prefix+]manager_users mu INNER JOIN [+prefix+]user_attributes mua ON mua.internalkey=mu.id';
@@ -5404,7 +5454,7 @@ public function getUserInfo($uid)
$rs = $this->db->select('mu.username, mu.password, mua.*', $from, $where, '', 1);
if (!$this->db->getRecordCount($rs)) {
- return $this->tmpCache[__FUNCTION__][$uid] = false;
+ return $cache[$uid] = false;
}
$row = $this->db->getRow($rs);
@@ -5412,7 +5462,7 @@ public function getUserInfo($uid)
$row['usertype'] = 'manager';
}
- $this->tmpCache[__FUNCTION__][$uid] = $row;
+ $cache[$uid] = $row;
return $row;
}
@@ -5873,7 +5923,7 @@ public function getPluginCode($pluginName)
*/
public function parseProperties($propertyString, $elementName = null, $elementType = null)
{
- $propertyString = trim($propertyString);
+ $propertyString = trim($propertyString ?? '');
$propertyString = str_replace('{}', '', $propertyString);
$propertyString = str_replace('} {', ',', $propertyString);
$property = [];
@@ -6214,7 +6264,7 @@ public function cleanUpMODXTags($content = '')
$this->config['enable_filter'] = 1;
$_ = array('[* *]', '[( )]', '{{ }}', '[[ ]]', '[+ +]');
foreach ($_ as $brackets) {
- list($left, $right) = explode(' ', $brackets);
+ [$left, $right] = explode(' ', $brackets);
if (strpos($content, $left) !== false) {
if ($left === '[*') {
$content = $this->mergeDocumentContent($content);
@@ -6228,7 +6278,7 @@ public function cleanUpMODXTags($content = '')
}
}
foreach ($_ as $brackets) {
- list($left, $right) = explode(' ', $brackets);
+ [$left, $right] = explode(' ', $brackets);
if (strpos($content, $left) !== false) {
$matches = $this->getTagsFromContent($content, $left, $right);
$content = isset($matches[0]) ? str_replace($matches[0], '', $content) : $content;
@@ -6471,7 +6521,7 @@ public function registerErrorHandlers()
*/
public function phpError($nr, $text, $file, $line)
{
- if (error_reporting() == 0 || $nr == 0) {
+ if (error_reporting() == 0 || $nr == 0 || error_reporting() !== E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT) {
return true;
}
if ($this->stopOnNotice == false) {
@@ -6547,7 +6597,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error =
$referer = $this->htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES, $this->config['modx_charset']);
if ($is_error) {
$str = '« Evo Parse Error » ';
- if ($msg != 'PHP Parse Error') {
+ if ($msg !== 'PHP Parse Error') {
$str .= '' . $msg . ' ';
}
} else {
@@ -6655,14 +6705,14 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error =
$totalTime = sprintf("%2.4f s", $totalTime);
$phpTime = sprintf("%2.4f s", $phpTime);
- $str = str_replace('[^q^]', $queries, $str);
- $str = str_replace('[^qt^]', $queryTime, $str);
- $str = str_replace('[^p^]', $phpTime, $str);
- $str = str_replace('[^t^]', $totalTime, $str);
- $str = str_replace('[^m^]', $total_mem, $str);
+ $str = str_replace(
+ ['[^q^]', '[^qt^]', '[^p^]', '[^t^]', '[^m^]'],
+ [$queries, $queryTime, $phpTime, $totalTime, $total_mem],
+ $str
+ );
if (isset($php_errormsg) && !empty($php_errormsg)) {
- $str = "{$php_errormsg} \n{$str}";
+ $str = "" . $php_errormsg . " \n" . $str;
}
$str .= $this->get_backtrace(debug_backtrace());
// Log error
@@ -6740,67 +6790,55 @@ public function get_backtrace($backtrace)
$MakeTable->setRowAlternateClass('gridAltItem');
$table = [];
$backtrace = array_reverse($backtrace);
- foreach ($backtrace as $key => $val) {
- $key++;
- if (substr($val['function'], 0, 11) === 'messageQuit') {
- break;
- } elseif (substr($val['function'], 0, 8) === 'phpError') {
+ foreach ($backtrace as $val) {
+ if (strpos($val['function'], 'messageQuit') === 0) {
break;
}
- $path = str_replace('\\', '/', $val['file']);
- if (strpos($path, MODX_BASE_PATH) === 0) {
- $path = substr($path, strlen(MODX_BASE_PATH));
- }
- switch ($val['type']) {
- case '->':
- case '::':
- $functionName = $val['function'] = $val['class'] . $val['type'] . $val['function'];
- break;
- default:
- $functionName = $val['function'];
+ if (strpos($val['function'], 'phpError') === 0) {
+ break;
}
- $tmp = 1;
- $_ = (!empty($val['args'])) ? count($val['args']) : 0;
+ $num = 1;
+ $_ = empty($val['args']) ? 0 : count($val['args']);
$args = array_pad([], $_, '$var');
$args = implode(", ", $args);
- $modx = &$this;
- $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) {
- $arg = $val['args'][$tmp - 1];
- switch (true) {
- case is_null($arg): {
+ $args = preg_replace_callback(
+ '/\$var/',
+ function () use (&$num, $val) {
+ $arg = $val['args'][$num - 1];
+ if (is_null($arg)) {
$out = 'NULL';
- break;
- }
- case is_numeric($arg): {
+ } elseif (is_numeric($arg)) {
$out = $arg;
- break;
- }
- case is_scalar($arg): {
- $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'");
- break;
- }
- case is_bool($arg): {
+ } elseif (is_scalar($arg)) {
+ if (strlen($arg) <= 20) {
+ $out = sprintf("'%s'", $this->htmlspecialchars(str_replace("'", "\\'", $arg)));
+ } else {
+ $out = 'string $var' . $num;
+ }
+ } elseif (is_bool($arg)) {
$out = $arg ? 'TRUE' : 'FALSE';
- break;
- }
- case is_array($arg): {
- $out = 'array $var' . $tmp;
- break;
- }
- case is_object($arg): {
- $out = get_class($arg) . ' $var' . $tmp;
- break;
- }
- default: {
- $out = '$var' . $tmp;
+ } elseif (is_array($arg)) {
+ $out = 'array $var' . $num;
+ } elseif (is_object($arg)) {
+ $out = get_class($arg) . ' $var' . $num;
+ } else {
+ $out = '$var' . $num;
}
- }
- $tmp++;
- return $out;
- }, $args);
+ $num++;
+ return $out;
+ },
+ $args
+ );
+ if (in_array($val['type'], ['->', '::'])) {
+ $val['function'] = $val['class'] . $val['type'] . $val['function'];
+ }
+ $path = str_replace('\\', '/', $val['file']);
+ if (strpos($path, MODX_BASE_PATH) === 0) {
+ $path = substr($path, strlen(MODX_BASE_PATH));
+ }
$line = array(
- "" . $functionName . " (" . $args . ")",
- $path . " on line " . $val['line']
+ sprintf('%s (%s)', $val['function'], $args),
+ sprintf('%s on line %s', $path, $val['line'])
);
$table[] = array(implode(" ", $line));
}
@@ -6871,88 +6909,103 @@ public function nicesize($size)
*/
public function getHiddenIdFromAlias($parentid, $alias)
{
- $out = false;
- if ($alias !== '') {
- $table = $this->getFullTableName('site_content');
- $query = $this->db->query("SELECT
- `sc`.`id` AS `hidden_id`,
- `children`.`id` AS `child_id`,
- children.alias AS `child_alias`,
- COUNT(`grandsons`.`id`) AS `grandsons_count`
- FROM " . $table ." AS `sc`
- JOIN " . $table . " AS `children` ON `children`.`parent` = `sc`.`id`
- LEFT JOIN " . $table . " AS `grandsons` ON `grandsons`.`parent` = `children`.`id`
- WHERE `sc`.`parent` = '" . (int)$parentid . "' AND `sc`.`alias_visible` = '0'
- GROUP BY `children`.`id`");
-
- while ($child = $this->db->getRow($query)) {
- if ($child['child_alias'] == $alias || $child['child_id'] == $alias) {
- $out = $child['child_id'];
- break;
- } elseif ($child['grandsons_count'] > 0 && ($id = $this->getHiddenIdFromAlias($child['hidden_id'], $alias))) {
- $out = $id;
- break;
- }
+ if ($alias === '') {
+ return false;
+ }
+
+ $query = $this->db->select(
+ 'sc.id AS hidden_id,
+ children.id AS child_id,
+ children.alias AS child_alias,
+ COUNT(grandsons.id) AS grandsons_count',
+ [
+ sprintf('%s AS sc', $this->getFullTableName('site_content')),
+ sprintf(
+ 'JOIN %s AS children ON children.parent=sc.id',
+ $this->getFullTableName('site_content')
+ ),
+ sprintf(
+ 'LEFT JOIN %s AS grandsons ON grandsons.parent=children.id',
+ $this->getFullTableName('site_content')
+ )
+ ],
+ sprintf(
+ "sc.parent='%s' AND sc.alias_visible=0 GROUP BY children.id",
+ (int)$parentid
+ )
+ );
+
+ while ($child = $this->db->getRow($query)) {
+ if ($child['child_alias'] == $alias || $child['child_id'] == $alias) {
+ return $child['child_id'];
+ }
+ $id = $this->getHiddenIdFromAlias($child['hidden_id'], $alias);
+ if ($child['grandsons_count'] > 0 && $id) {
+ return $id;
}
}
- return $out;
+ return false;
}
/**
- * @param string $alias
+ * @param string $aliasPath
* @return bool|int
*/
- public function getIdFromAlias($alias)
+ public function getIdFromAlias($aliasPath)
{
- if (isset($this->documentListing[$alias])) {
- return $this->documentListing[$alias];
+ if (isset($this->documentListing[$aliasPath])) {
+ return $this->documentListing[$aliasPath];
}
- $tbl_site_content = $this->getFullTableName('site_content');
if (!$this->config['use_alias_path']) {
$rs = $this->db->select(
'id',
- $tbl_site_content,
- "deleted=0 and alias='" . $alias . "'",
+ $this->getFullTableName('site_content'),
+ "deleted=0 and alias='" . $aliasPath . "'",
'parent, menuindex'
);
$id = $this->db->getValue($rs);
if (!$id) {
- $id = false;
+ return false;
}
return $id;
}
- if ($alias === '.') {
+ if ($aliasPath === '.') {
return 0;
}
- if (strpos($alias, '/') !== false) {
- $_a = explode('/', $alias);
- } else {
- $_a[] = $alias;
- }
- $id = 0;
+ $_a = strpos($aliasPath, '/') !== false
+ ? explode('/', $aliasPath)
+ : [$aliasPath]
+ ;
+ $id = 0;
foreach ($_a as $alias) {
if ($id === false) {
- break;
+ return false;
}
- $alias = $this->db->escape($alias);
$rs = $this->db->select(
'id',
- $tbl_site_content,
- "deleted=0 and parent='" . $id . "' and alias='" . $alias . "'"
+ $this->getFullTableName('site_content'),
+ sprintf(
+ "deleted=0 and parent='%s' and alias='%s'",
+ $id,
+ $this->db->escape($alias)
+ )
);
- if ($this->db->getRecordCount($rs) == 0) {
+ if (!$this->db->getRecordCount($rs)) {
$rs = $this->db->select(
'id',
- $tbl_site_content,
- "deleted=0 and parent='" . $id . "' and id='" . $alias . "'"
+ $this->getFullTableName('site_content'),
+ sprintf(
+ "deleted=0 and parent='%s' and id='%s'",
+ $id,
+ $this->db->escape($alias)
+ )
);
}
- $next = $this->db->getValue($rs);
- $id = $next ?: $this->getHiddenIdFromAlias($id, $alias);
+ $id = $this->db->getValue($rs) ?: $this->getHiddenIdFromAlias($id, $alias);
}
return $id;
}
@@ -6993,7 +7046,7 @@ public function atBindInclude($str = '')
return false;
}
- if (!$file_path || !is_file($file_path)) {
+ if (!is_file($file_path)) {
return false;
}
diff --git a/manager/includes/extenders/dbapi.mysqli.class.inc.php b/manager/includes/extenders/dbapi.mysqli.class.inc.php
index cc7a2f785d..3a6f384b4f 100644
--- a/manager/includes/extenders/dbapi.mysqli.class.inc.php
+++ b/manager/includes/extenders/dbapi.mysqli.class.inc.php
@@ -31,11 +31,11 @@ public function __construct(
$charset = '',
$connection_method = 'SET CHARACTER SET'
) {
- $this->config['host'] = $host ? $host : $GLOBALS['database_server'];
- $this->config['dbase'] = $dbase ? $dbase : $GLOBALS['dbase'];
- $this->config['user'] = $uid ? $uid : $GLOBALS['database_user'];
- $this->config['pass'] = $pwd ? $pwd : $GLOBALS['database_password'];
- $this->config['charset'] = $charset ? $charset : $GLOBALS['database_connection_charset'];
+ $this->config['host'] = $host ?: $GLOBALS['database_server'];
+ $this->config['dbase'] = $dbase ?: $GLOBALS['dbase'];
+ $this->config['user'] = $uid ?: $GLOBALS['database_user'];
+ $this->config['pass'] = $pwd ?: $GLOBALS['database_password'];
+ $this->config['charset'] = $charset ?: $GLOBALS['database_connection_charset'];
$this->config['connection_method'] = $this->_dbconnectionmethod = (isset($GLOBALS['database_connection_method']) ? $GLOBALS['database_connection_method'] : $connection_method);
$this->config['table_prefix'] = ($pre !== null) ? $pre : $GLOBALS['table_prefix'];
}
@@ -50,19 +50,23 @@ public function __construct(
public function connect($host = '', $dbase = '', $uid = '', $pwd = '')
{
$modx = evolutionCMS();
- $uid = $uid ? $uid : $this->config['user'];
- $pwd = $pwd ? $pwd : $this->config['pass'];
- $host = $host ? $host : $this->config['host'];
+ $uid = $uid ?: $this->config['user'];
+ $pwd = $pwd ?: $this->config['pass'];
+ $host = $host ?: $this->config['host'];
$host = explode(':', $host, 2);
- $dbase = $dbase ? $dbase : $this->config['dbase'];
+ $dbase = $dbase ?: $this->config['dbase'];
$dbase = trim($dbase, '`'); // remove the `` chars
$charset = $this->config['charset'];
$connection_method = $this->config['connection_method'];
$tstart = $modx->getMicroTime();
$safe_count = 0;
do {
- $this->conn = new mysqli($host[0], $uid, $pwd, $dbase, isset($host[1]) ? $host[1] : null);
- if ($this->conn->connect_error) {
+ try {
+ $this->conn = new mysqli($host[0], $uid, $pwd, $dbase, isset($host[1]) ? $host[1] : null);
+ } catch (Exception $e) {
+ $this->conn = null;
+ }
+ if (is_null($this->conn) || $this->conn->connect_error) {
$this->conn = null;
if (isset($modx->config['send_errormail']) && $modx->config['send_errormail'] !== '0') {
if ($modx->config['send_errormail'] <= 2) {
@@ -111,28 +115,24 @@ public function disconnect()
/**
* @param array|string $s
- * @param int $safeCount
* @return array|string
*/
- public function escape($s, $safeCount = 0)
+ public function escape($s)
{
- $safeCount++;
- if (1000 < $safeCount) {
- exit("Too many loops '{$safeCount}'");
- }
- if ( ! ($this->conn instanceof mysqli)) {
+ if (!$this->conn instanceof mysqli) {
$this->connect();
}
- if (is_array($s)) {
- if (count($s) === 0) {
- $s = '';
- } else {
- foreach ($s as $i => $v) {
- $s[$i] = $this->escape($v, $safeCount);
- }
- }
- } else {
- $s = $this->conn->escape_string($s);
+
+ if (!is_array($s)) {
+ return $this->conn->escape_string($s);
+ }
+
+ if (!count($s)) {
+ return '';
+ }
+
+ foreach ($s as $i => $v) {
+ $s[$i] = $this->escape($v);
}
return $s;
@@ -154,7 +154,12 @@ public function query($sql, $watchError = true)
$sql = implode("\n", $sql);
}
$this->lastQuery = $sql;
- if (!($result = $this->conn->query($sql))) {
+ try {
+ $result = $this->conn->query($sql);
+ } catch (Exception $e) {
+ $result = false;
+ }
+ if (!$result) {
if (!$watchError) {
return false;
}
@@ -298,7 +303,7 @@ public function update($fields, $table, $where = "")
$modx = evolutionCMS();
if (!$table) {
$modx->messageQuit('Empty '.$table.' parameter in DBAPI::update().');
- return;
+ return false;
}
$table = $this->replaceFullTableName($table);
if (is_array($fields)) {
@@ -313,7 +318,7 @@ public function update($fields, $table, $where = "")
$fields = implode(',', $fields);
}
if ($where && stripos(trim($where), 'WHERE') !== 0) {
- $where = 'WHERE '.$where;
+ $where = 'WHERE '.trim($where);
}
return $this->query('UPDATE '.$table.' SET '.$fields.' '.$where);
}
@@ -339,8 +344,12 @@ public function insert($fields, $intotable, $fromfields = "*", $fromtable = "",
$this->query("INSERT INTO {$intotable} {$fields}");
} else {
if (empty($fromtable)) {
- $fields = "(`" . implode("`, `", array_keys($fields)) . "`) VALUES('" . implode("', '",
- array_values($fields)) . "')";
+ $field_values = $fields; //проверим значения на null, их нужно передать в запрос без кавычек
+ foreach($field_values as &$f_value)
+ {
+ $f_value = (null === $f_value) ? "NULL" : "'{$f_value}'";
+ }
+ $fields = "(`" . implode("`, `", array_keys($fields)) . "`) VALUES(" . implode(", ", array_values($field_values)) . ")";
$this->query("INSERT INTO {$intotable} {$fields}");
} else {
$fromtable = $this->replaceFullTableName($fromtable);
diff --git a/manager/includes/extenders/maketable.class.php b/manager/includes/extenders/maketable.class.php
index a80bf0e4de..1eb371a73f 100755
--- a/manager/includes/extenders/maketable.class.php
+++ b/manager/includes/extenders/maketable.class.php
@@ -513,7 +513,7 @@ function clickAll() {
public function createPagingNavigation($numRecords, $qs = '')
{
global $_lang;
- $currentPage = (is_numeric($_GET['page']) ? $_GET['page'] : 1);
+ $currentPage = isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 1;
$numPages = ceil($numRecords / MAX_DISPLAY_RECORDS_NUM);
$nav = '';
if ($numPages > 1) {
diff --git a/manager/includes/extenders/modifiers.class.inc.php b/manager/includes/extenders/modifiers.class.inc.php
index da6e862edd..7f0e3050f1 100755
--- a/manager/includes/extenders/modifiers.class.inc.php
+++ b/manager/includes/extenders/modifiers.class.inc.php
@@ -11,10 +11,6 @@ class MODIFIERS {
* @var array
*/
public $vars = array();
- /**
- * @var array
- */
- public $tmpCache = array();
/**
* @var
*/
@@ -229,10 +225,11 @@ public function splitEachModifiers($modifiers) {
public function parsePhx($key,$value,$modifiers)
{
+ static $cache = null;
$modx = evolutionCMS();
$lastKey = '';
- $cacheKey = md5(sprintf('parsePhx#%s#%s#%s',$key,$value,print_r($modifiers,true)));
- if(isset($this->tmpCache[$cacheKey])) return $this->tmpCache[$cacheKey];
+ $cacheKey = md5(print_r(func_get_args(), true));
+ if(isset($cache[$cacheKey])) return $cache[$cacheKey];
if(empty($modifiers)) return '';
foreach($modifiers as $m)
@@ -246,11 +243,11 @@ public function parsePhx($key,$value,$modifiers)
$modifiers[] = array('cmd'=>'else','opt'=>'0');
}
- foreach($modifiers as $i=>$a)
+ foreach($modifiers as $a)
{
$value = $this->Filter($key,$value, $a['cmd'], $a['opt']);
}
- $this->tmpCache[$cacheKey] = $value;
+ $cache[$cacheKey] = $value;
return $value;
}
@@ -678,14 +675,11 @@ public function getValueFromPreset($key, $value, $cmd, $opt)
case 'dateformat':
if(empty($opt)) $opt = $modx->toDateFormat(null, 'formatOnly');
if(!preg_match('@^[0-9]+$@',$value)) $value = strtotime($value);
- if(strpos($opt,'%')!==false)
- return strftime($opt,0+$value);
- else
- return date($opt,0+$value);
+ return date($opt,0+$value);
case 'time':
- if(empty($opt)) $opt = '%H:%M';
+ if(empty($opt)) $opt = 'H:i';
if(!preg_match('@^[0-9]+$@',$value)) $value = strtotime($value);
- return strftime($opt,0+$value);
+ return date($opt,0+$value);
case 'strtotime':
return strtotime($value);
##### mathematical function
diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php
index 166cd22e0f..10a7686740 100755
--- a/manager/includes/header.inc.php
+++ b/manager/includes/header.inc.php
@@ -7,7 +7,7 @@
// invoke OnManagerRegClientStartupHTMLBlock event
$evtOut = $modx->invokeEvent('OnManagerMainFrameHeaderHTMLBlock');
-$modx_textdir = isset($modx_textdir) ? $modx_textdir : null;
+$modx_textdir = $modx_textdir ?? null;
$onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : '';
$textdir = $modx_textdir === 'rtl' ? 'rtl' : 'ltr';
if (!isset($modx->config['mgr_jquery_path'])) {
@@ -19,30 +19,31 @@
$body_class = '';
$theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
-$theme_mode = isset($_COOKIE['MODX_themeMode']) ? $_COOKIE['MODX_themeMode'] : '';
-if (!empty($theme_modes[$theme_mode])) {
+$theme_mode = $_COOKIE['MODX_themeMode'] ?? '';
+if ($theme_mode && !empty($theme_modes[$theme_mode])) {
$body_class .= ' ' . $theme_modes[$theme_mode];
-} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
- $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
+} elseif (!empty($theme_modes[$modx->config['manager_theme_mode'] ?? 3])) {
+ $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode'] ?? 3];
}
-$css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime;
+$css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $modx->recentUpdate;
-if ($modx->config['manager_theme'] == 'default') {
- if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')
- && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
+$style_path = MODX_MANAGER_PATH . 'media/style/';
+if ($modx->config['manager_theme'] === 'default') {
+ if (!file_exists($style_path . $modx->config['manager_theme'] . '/css/styles.min.css')
+ && is_writable($style_path . $modx->config['manager_theme'] . '/css')) {
$files = array(
- 'bootstrap' => MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css',
- 'font-awesome' => MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css',
- 'fonts' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css',
- 'forms' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css',
- 'mainmenu' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css',
- 'tree' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css',
- 'custom' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css',
- 'tabpane' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css',
- 'contextmenu' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css',
- 'index' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css',
- 'main' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'
+ 'bootstrap' => $style_path . 'common/bootstrap/css/bootstrap.min.css',
+ 'font-awesome' => $style_path . 'common/font-awesome/css/font-awesome.min.css',
+ 'fonts' => $style_path . $modx->config['manager_theme'] . '/css/fonts.css',
+ 'forms' => $style_path . $modx->config['manager_theme'] . '/css/forms.css',
+ 'mainmenu' => $style_path . $modx->config['manager_theme'] . '/css/mainmenu.css',
+ 'tree' => $style_path . $modx->config['manager_theme'] . '/css/tree.css',
+ 'custom' => $style_path . $modx->config['manager_theme'] . '/css/custom.css',
+ 'tabpane' => $style_path . $modx->config['manager_theme'] . '/css/tabpane.css',
+ 'contextmenu' => $style_path . $modx->config['manager_theme'] . '/css/contextmenu.css',
+ 'index' => $style_path . $modx->config['manager_theme'] . '/css/index.css',
+ 'main' => $style_path . $modx->config['manager_theme'] . '/css/main.css'
);
$evtOut = $modx->invokeEvent('OnBeforeMinifyCss', array(
'files' => $files,
@@ -63,12 +64,12 @@
$minifier = new Formatter\CSSMinify($files);
$css = $minifier->minify();
file_put_contents(
- MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css',
+ $style_path . $modx->config['manager_theme'] . '/css/styles.min.css',
$css
);
}
- if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
- $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
+ if (file_exists($style_path . $modx->config['manager_theme'] . '/css/styles.min.css')) {
+ $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $modx->recentUpdate;
}
}
@@ -88,14 +89,6 @@
- config['enable_mootools'] != "0") { ?>
-
-
-
-
-
= $onManagerMainFrameHeaderHTMLBlock . "\n" ?>
diff --git a/manager/includes/lang/belarusian.inc.php b/manager/includes/lang/belarusian.inc.php
new file mode 100644
index 0000000000..ca7791242a
--- /dev/null
+++ b/manager/includes/lang/belarusian.inc.php
@@ -0,0 +1,1523 @@
+PHP Application Framework and Content Management System licensed under the GNU GPL .';
+$_lang["about_title"] = 'About Evolution';
+$_lang["access_permission_denied"] = 'You do not have the correct permissions for this Resource.';
+$_lang["access_permission_parent_denied"] = 'You do not have permission to create or move a Resource here! Please choose another location.';
+$_lang["access_permissions"] = 'Access permissions';
+$_lang["access_permissions_add_resource_group"] = 'Create a new Resource Group';
+$_lang["access_permissions_add_user_group"] = 'Create a new User Group';
+$_lang["access_permissions_docs_collision"] = 'Because the Web User Groups and Manager User Groups conflict for your Role, this Resource will be public. Contact a site administrator for further help.';
+$_lang["access_permissions_docs_message"] = 'Select which Resource Groups this Resource belongs to';
+$_lang["access_permissions_group_link"] = 'Create a new group link';
+$_lang["access_permissions_introtext"] = 'Manage the User Groups and Resource Groups used for access permissions. To add a user to a User Group, edit the user and select the groups (s)he should be a member of. To add a Resource to a User Group, edit the Resource and select the groups it should belong to.';
+$_lang["access_permissions_link_to_group"] = 'to Resource Group';
+$_lang["access_permissions_link_user_group"] = 'Link User Group';
+$_lang["access_permissions_links"] = 'User/Resource Group links';
+$_lang["access_permissions_links_tab"] = 'Specify which User Groups are given access (i.e. can edit or create children) to the Resource Groups. To link a Resource Group to a User Group, select the appropriate groups from the drop down menus, and click on \'Submit\'. To remove the link for a certain group, press \'Remove\'. This will immediately remove the link.';
+$_lang["access_permissions_no_resources_in_group"] = 'None.';
+$_lang["access_permissions_no_users_in_group"] = 'None.';
+$_lang["access_permissions_off"] = 'Access Permissions are not activated. This means any changes made here will not have any effect until Access Permissions are activated in your Configuration.';
+$_lang["access_permissions_resource_groups"] = 'Resource Groups';
+$_lang["access_permissions_resources_in_group"] = 'Resources in group: ';
+$_lang["access_permissions_resources_tab"] = 'See which Resource Groups have been created. Also create new groups, rename groups, delete groups and see which Resources are in the different groups (hover over the id of the Resource to see it\'s name). To add a Resource to a group or remove a Resource from a group, edit the Resource directly.';
+$_lang["access_permissions_user_groups"] = 'User groups';
+$_lang["access_permissions_user_message"] = 'Select which User Groups this user belongs to:';
+$_lang["access_permissions_users_in_group"] = 'Users in group:';
+$_lang["access_permissions_users_tab"] = 'View the User Groups that have been created. You can also create new groups, rename groups, delete groups and see which users are members of the different groups. To add a new user to a group or to remove a user from a group, edit the user directly. Administrators (users who have been assigned the role with ID 1) always have access to all Resources, so they don\'t need to be added to any groups.';
+$_lang["account_email"] = 'Account email';
+$_lang["actioncomplete"] = 'Action was completed successfully! - Please wait while EVO cleans up.';
+$_lang["activity_message"] = 'This list shows the last Resources you created or edited:';
+$_lang["activity_title"] = 'Recently edited/created Resources';
+$_lang["add"] = 'Add';
+$_lang["add_chunk"] = 'Add Chunk';
+$_lang["add_doc"] = 'Add Resource';
+$_lang["add_folder"] = 'New Directory';
+$_lang["add_plugin"] = 'Add Plugin';
+$_lang["add_resource"] = 'New Resource';
+$_lang["add_snippet"] = 'Add Snippet';
+$_lang["add_tag"] = 'Add tag';
+$_lang["add_template"] = 'Add Template';
+$_lang["add_tv"] = 'Add TV';
+$_lang["add_weblink"] = 'New Weblink';
+$_lang["administrator_role_message"] = 'This role cannot be edited or deleted.';
+$_lang["administrators"] = 'Administrators';
+$_lang["after_saving"] = 'After saving';
+$_lang["alert_delete_self"] = 'You can\'t delete yourself!';
+$_lang["alias"] = 'URL alias';
+$_lang["all_doc_groups"] = 'All Resource Groups (Public)';
+$_lang["all_events"] = 'All Events';
+$_lang["all_usr_groups"] = 'All User Groups (Public)';
+$_lang["allow_mgr_access"] = 'Manager Interface Access';
+$_lang["allow_mgr_access_message"] = 'Select this option to enable or disable access to the manager interface. NOTE: If this option is set to no then the user will be redirected to the Manager Login Startup or Site Start web page. ';
+$_lang["already_deleted"] = 'has already been deleted.';
+$_lang["attachment"] = 'Attachment';
+$_lang["author_infos"] = 'Author information';
+$_lang["automatic_alias_message"] = 'Select \'yes\' to have the system automatically generate a URL alias based on the Resource\'s page title when saving.';
+$_lang["automatic_alias_title"] = 'Automatically generate URL alias';
+$_lang["backup"] = 'Backup';
+$_lang["bk_manager"] = 'Backup';
+$_lang["block_message"] = 'This user will be blocked after saving the user\'s data!';
+$_lang["blocked_minutes_message"] = 'Enter the number of minutes that a user will be blocked for if they reach their maximum number of allowed failed login attempts. Please enter this value as numbers only (no commas, spaces etc.)';
+$_lang["blocked_minutes_title"] = 'Blocked Minutes';
+$_lang["cache_files_deleted"] = 'The following files were deleted:';
+$_lang["cancel"] = 'Cancel';
+$_lang["captcha_code"] = 'Security code';
+$_lang["captcha_message"] = 'Enable this to strengthen security by requiring users to enter a code which is unreadable by machines (and script-kiddy hacking scripts).';
+$_lang["captcha_title"] = 'Use CAPTCHA codes';
+$_lang["captcha_words_default"] = 'EVO,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Tattoo,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote';
+$_lang["captcha_words_message"] = 'Enter a list of CAPTCHA words to use if CAPTCHA is enabled. Separate the words with commas. This input field is limited to 255 characters.';
+$_lang["captcha_words_title"] = 'CAPTCHA Words';
+$_lang["category_heading"] = 'Category';
+$_lang["category_manager"] = 'Category Manager';
+$_lang["category_management"] = 'Category management';
+$_lang["manage_categories"] = 'Manage Categories';
+$_lang["category_msg"] = 'View and edit all Elements grouped by category.';
+$_lang["cfg_base_path"] = 'MODX_BASE_PATH';
+$_lang["cfg_base_url"] = 'MODX_BASE_URL';
+$_lang["cfg_manager_path"] = 'MODX_MANAGER_PATH';
+$_lang["cfg_manager_url"] = 'MODX_MANAGER_URL';
+$_lang["cfg_site_url"] = 'MODX_SITE_URL';
+$_lang["change_name"] = 'Change username';
+$_lang["change_password"] = 'Change Password';
+$_lang["change_password_confirm"] = 'Confirm password';
+$_lang["change_password_message"] = 'Please enter your new password, and then enter it again to confirm. Your password needs to be at least 6 characters long.';
+$_lang["change_password_new"] = 'New password';
+$_lang["charset_message"] = 'Select the default character encoding for the [(modx_charset)] system variable. This does not affect the Manager.';
+$_lang["charset_title"] = 'Character encoding';
+$_lang["chunk"] = 'Chunk';
+$_lang["chunk_code"] = 'Chunk code (html)';
+$_lang["chunk_multiple_id"] = 'Error: Multiple Chunks share the same unique ID.';
+$_lang["chunk_no_exist"] = 'Chunk does not exist.';
+$_lang["cleaningup"] = 'Cleaning up';
+$_lang["clean_uploaded_filename"] = 'Use Transliteration for File Uploads';
+$_lang["clean_uploaded_filename_message"] = 'Use the default or transalias settings for the file name to clean special characters from uploaded file names, preserving dot-characters (periods)';
+$_lang["clear_log"] = 'Clear log';
+$_lang["click_to_context"] = 'Click to access context menu';
+$_lang["click_to_edit_title"] = 'Click here to edit this record';
+$_lang["click_to_view_details"] = 'Click here to view details';
+$_lang["close"] = 'Close';
+$_lang["code"] = 'Code';
+$_lang["collapse_tree"] = 'Collapse Site Tree';
+$_lang["comment"] = 'Comment';
+$_lang["configcheck_admin"] = 'Please contact a systems administrator and warn them about this message!';
+$_lang["configcheck_cache"] = 'cache directory not writable';
+$_lang["configcheck_cache_msg"] = 'EVO cannot write to the cache directory. EVO will still function as expected, but no caching will take place. To solve this, make the /_cache/ directory writable.';
+$_lang["configcheck_configinc"] = 'Config file still writable';
+$_lang["configcheck_configinc_msg"] = 'Very naughty people could potentially wreak some havoc on your site and everything associated with it. Really. Please make your config file (/[+MGR_DIR+]/includes/config.inc.php) read only!';
+$_lang["configcheck_default_msg"] = 'An unspecified warning was found. Which is strange.';
+$_lang["configcheck_errorpage_unavailable"] = 'Your site\'s Error page is not available.';
+$_lang["configcheck_errorpage_unavailable_msg"] = 'This means that your Error page is not accessible to normal web surfers or does not exist. This can lead to a recursive looping condition and many errors in your site logs. Make sure there are no Webuser Groups assigned to the page.';
+$_lang["configcheck_errorpage_unpublished"] = 'Your site\'s Error page is not published or does not exist.';
+$_lang["configcheck_errorpage_unpublished_msg"] = 'This means that your Error page is inaccessible to the general public. Publish the page or make sure it is assigned to an existing Resource in your Site Tree in the Tools > Configuration menu.';
+$_lang["configcheck_filemanager_path"] = 'The currently set File Manager path seems incorrect.';
+$_lang["configcheck_filemanager_path_msg"] = 'This can happen for example by moving your installation to a different directory or server. Please check and update your Evo system configuration.';
+$_lang["configcheck_hide_warning"] = 'Don\'t show this again. ';
+$_lang["configcheck_images"] = 'Images directory not writable';
+$_lang["configcheck_images_msg"] = 'The images directory isn\'t writable, or doesn\'t exist. This means the Image Manager functions in the editor will not work!';
+$_lang["configcheck_installer"] = 'Installer still present';
+$_lang["configcheck_installer_msg"] = 'The /install directory contains the installer for EVO. Just imagine what might happen if an evil person finds this directory and runs the installer! They\'d probably not get too far, because they need to enter some user information for the database, but it is still best to remove this directory from your server.';
+$_lang["configcheck_lang_difference"] = 'Incorrect number of entries in language file';
+$_lang["configcheck_lang_difference_msg"] = 'The currently selected language has a different number of entries than the default language. While not necessarily a problem, this may mean the language file needs to be updated.';
+$_lang["configcheck_notok"] = 'One or more configuration details didn\'t check out OK:';
+$_lang["configcheck_ok"] = 'Check passed OK - no warnings to report.';
+$_lang["configcheck_php_gdzip"] = 'GD and/or Zip PHP extensions not found';
+$_lang["configcheck_php_gdzip_msg"] = 'EVO needs the GD and Zip extension enabled for PHP. While EVO will work without them, you will not be able to take full advantage of the built-in File Manager, Image Editor or Captcha for logins.';
+$_lang["configcheck_rb_base_dir"] = 'The currently set File base path seems incorrect.';
+$_lang["configcheck_rb_base_dir_msg"] = 'This can happen for example by moving your installation to a different directory or server. Please check and update your Evo system configuration.';
+$_lang["configcheck_register_globals"] = 'register_globals is set to ON in your php.ini configuration file';
+$_lang["configcheck_register_globals_msg"] = 'This configuration makes your site much more susceptible to Cross Site Scripting (XSS) attacks. You should speak to your host about what you can do to disable this setting.';
+$_lang["configcheck_title"] = 'Configuration check';
+$_lang["configcheck_templateswitcher_present"] = 'TemplateSwitcher Plugin detected';
+$_lang["configcheck_templateswitcher_present_delete"] = 'Delete TemplateSwitcher ';
+$_lang["configcheck_templateswitcher_present_disable"] = 'Disable TemplateSwitcher ';
+$_lang["configcheck_templateswitcher_present_msg"] = 'The TemplateSwitcher plugin has been found to cause caching and performance problems, and should be used only the functionality is required in your site.';
+$_lang["configcheck_unauthorizedpage_unavailable"] = 'Your site\'s Unauthorized page is not published or does not exist.';
+$_lang["configcheck_unauthorizedpage_unavailable_msg"] = 'This means that your Unauthorized page is not accessible to normal web surfers or does not exist. This can lead to a recursive looping condition and many errors in your site logs. Make sure there are no Webuser Groups assigned to the page.';
+$_lang["configcheck_unauthorizedpage_unpublished"] = 'The Unauthorized page defined in the site configuration settings is not published.';
+$_lang["configcheck_unauthorizedpage_unpublished_msg"] = 'This means that your Unauthorized page is inaccessible to the general public. Publish the page or make sure it is assigned to an existing Resource in your Site Tree in the Tools > Configuration menu.';
+$_lang["configcheck_validate_referer"] = 'Security Warning: HTTP Header Validation';
+$_lang["configcheck_validate_referer_msg"] = 'The configuration setting Validate HTTP_REFERER headers? is Off. We recommend turning it On. Go to Configuration options ';
+$_lang["configcheck_warning"] = 'Configuration warning: ';
+$_lang["configcheck_what"] = 'What does this mean?';
+$_lang["confirm_block"] = 'Are you sure you want to block this user?';
+$_lang["confirm_delete_category"] = 'Are you sure you want to delete this category?';
+$_lang["confirm_delete_eventlog"] = 'Are you sure you want to delete this event log?';
+$_lang["confirm_delete_file"] = 'Are you sure you want to delete the file?\n\nThis may stop your site from working properly! Only delete this file if you know for certain what you are doing will not break anything.';
+$_lang["confirm_delete_group"] = 'Are you sure you want to delete this group?';
+$_lang["confirm_delete_htmlsnippet"] = 'Are you sure you want to delete this Chunk?';
+$_lang["confirm_delete_keywords"] = 'Are you sure you want to delete these keywords?';
+$_lang["confirm_delete_module"] = 'Are you sure you want to delete this Module?';
+$_lang["confirm_delete_plugin"] = 'Are you sure you want to delete this Plugin?';
+$_lang["confirm_delete_record"] = 'Are you sure you want to delete the selected record(s)?';
+$_lang["confirm_delete_resource"] = 'Are you sure you want to delete this Resource?\nAny children Resources will also be deleted.';
+$_lang["confirm_delete_role"] = 'Are you sure you want to delete this role?';
+$_lang["confirm_delete_snippet"] = 'Are you sure you want to delete this Snippet?';
+$_lang["confirm_delete_tags"] = 'Are you sure you want to delete the selected META tags?';
+$_lang["confirm_delete_template"] = 'Are you sure you want to delete this Template?';
+$_lang["confirm_delete_tmplvars"] = 'Are you sure you want to remove this Template Variable and all stored values?';
+$_lang["confirm_delete_user"] = 'Are you sure you want to delete this User?';
+$_lang["confirm_duplicate_record"] = 'Are you sure you want to duplicate this record?';
+$_lang["confirm_empty_trash"] = 'This will permanently remove ALL deleted Resources?\n\nProceed?';
+$_lang["confirm_load_depends"] = 'Are you sure you want to load the Manage Dependencies screen without saving your modifications?';
+$_lang["confirm_name_change"] = 'Changing the username can affect other applications that are linked to the Content Manager.\n\nAre you sure you want to change this username?';
+$_lang["confirm_publish"] = '\n\nPublishing this Resource now will remove any (un)publishing dates that may have been set. If you wish to set or keep publish or unpublish dates, please choose to \'edit\' the Resource instead.\n\nProceed?';
+$_lang["confirm_remove_locks"] = 'Users sometimes close their browser while editing Resources, Templates, Snippets or parsers, possibly leaving the item they were editing in locked state. By pressing OK you can remove ALL locks currently in place.\n\nProceed?';
+$_lang["confirm_reset_sort_order"] = 'Are you sure you want to reset the \"sort order/index\" of all listed elements to 0 ?';
+$_lang["confirm_resource_duplicate"] = 'Are you sure you want to duplicate this Resource? Any item(s) it contains will also be duplicated.';
+$_lang["confirm_setting_language_change"] = 'You have modified the default value and will lose the changes. Proceed?';
+$_lang["confirm_unblock"] = 'Are you sure you want to unblock this user?';
+$_lang["confirm_undelete"] = '\n\nAny children Resources deleted at the same time as this Resource will also be undeleted, but children Resources deleted at an earlier time will still be deleted.';
+$_lang["confirm_unpublish"] = '\n\nUn-publishing this Resource now will remove any (un)publishing dates that may have been set. If you wish to set or keep publish or unpublish dates, please choose to \'edit\' the Resource instead.\n\nProceed?';
+$_lang["confirm_unzip_file"] = 'Are you sure you want to unzip this file?\n\nExisting files will be overwritten.';
+$_lang["could_not_find_user"] = 'Could not find user';
+$_lang["create_folder_here"] = 'Create Container here';
+$_lang["create_resource_here"] = 'Create Resource here';
+$_lang["create_resource_title"] = 'Create Resource';
+$_lang["create_weblink_here"] = 'Create Weblink here';
+$_lang["createdon"] = 'Creation date';
+$_lang["create_new"] = 'Create new';
+$_lang["credits"] = 'Credits';
+$_lang["credits_shouts_msg"] = 'EVO is managed and maintained at evo.im .
';
+$_lang["custom_contenttype_message"] = 'Add custom content types for Resources. To add a new entry, enter the content type in the text box then click the \'Add\' button.';
+$_lang["custom_contenttype_title"] = 'Custom content types';
+$_lang["database_charset"] = 'Database Charset';
+$_lang["database_collation"] = 'Database Collation Charset';
+$_lang["database_name"] = 'Database name';
+$_lang["database_overhead"] = 'Note: Overhead is unused space reserved by MySQL. To free up this space, click on the table\'s overhead figure.';
+$_lang["database_server"] = 'Database server';
+$_lang["database_table_clickbackup"] = 'Backup & download the selected tables';
+$_lang["database_table_clickhere"] = 'Click here';
+$_lang["database_table_datasize"] = 'Data size';
+$_lang["database_table_droptablestatements"] = 'Generate DROP TABLE statements.';
+$_lang["database_table_effectivesize"] = 'Effective size';
+$_lang["database_table_indexsize"] = 'Index size';
+$_lang["database_table_overhead"] = 'Overhead';
+$_lang["database_table_records"] = 'Records';
+$_lang["database_table_tablename"] = 'Table name';
+$_lang["database_table_totals"] = 'Totals';
+$_lang["database_table_totalsize"] = 'Total size';
+$_lang["database_tables"] = 'Database tables';
+$_lang["database_version"] = 'Database Version';
+$_lang["date"] = 'Date';
+$_lang["datechanged"] = 'Date changed';
+$_lang["datepicker_offset"] = 'Datepicker offset';
+$_lang["datepicker_offset_message"] = 'The number of years to show in the past on the datepicker.';
+$_lang["datetime_format"] = 'Date format';
+$_lang["datetime_format_message"] = 'The format for dates in the Manager.';
+$_lang["default"] = 'Default:';
+$_lang["defaultcache_message"] = 'Select \'Yes\' to make all new Resources cacheable by default.';
+$_lang["defaultcache_title"] = 'Cacheable default';
+$_lang["defaultmenuindex_message"] = 'Select \'Yes\' to turn on automatic menu index incrementing by default.';
+$_lang["defaultmenuindex_title"] = 'Menu indexing default';
+$_lang["defaultpublish_message"] = 'Select \'Yes\' to make all new Resources published by default.';
+$_lang["defaultpublish_title"] = 'Published default';
+$_lang["defaultsearch_message"] = 'Select \'Yes\' to make all new Resources searchable by default.';
+$_lang["defaultsearch_title"] = 'Searchable default';
+$_lang["defaulttemplate_message"] = 'Select the Template you wish to use as a system default for new Resources. You can still select a different Template in the Resource editor, this setting just pre-selects one of your Templates for you.';
+$_lang["defaulttemplate_title"] = 'System Default Template';
+$_lang["defaulttemplate_logic_title"] = 'Automatic Template Assignment';
+$_lang["defaulttemplate_logic_general_message"] = 'New Resources will have the following templates, falling back to higher levels if not found:';
+$_lang["defaulttemplate_logic_system_message"] = 'System : the System Default Template.';
+$_lang["defaulttemplate_logic_parent_message"] = 'Parent : the same Template as the parent container.';
+$_lang["defaulttemplate_logic_sibling_message"] = 'Sibling : the same Template as other Resources in the same container.';
+$_lang["delete"] = 'Delete';
+$_lang["delete_resource"] = 'Delete Resource';
+$_lang["delete_tags"] = 'Delete tags';
+$_lang["deleting_file"] = 'Deleting file `%s`: ';
+$_lang["description"] = 'Description';
+$_lang["deselect_keywords"] = 'Clear keywords';
+$_lang["deselect_metatags"] = 'Clear META tags';
+$_lang["disabled"] = 'Disabled';
+$_lang["doc_data_title"] = 'View Resource data';
+$_lang["documentation"] = 'Documentation';
+$_lang["duplicate"] = 'Duplicate';
+$_lang["duplicate_alias_found"] = 'Resource \'%s\' is already using the URL alias \'%s\'. Please enter a unique URL alias.';
+$_lang["duplicate_alias_message"] = 'Select \'yes\' to allow duplicate URL aliases to be saved. NOTE: This option should be used with \'Friendly URL alias path\' option set to \'Yes\' in order to avoid problems when referencing a Resource. ';
+$_lang["duplicate_alias_title"] = 'Allow duplicate URL aliases';
+$_lang["duplicate_name_found_general"] = 'There is already a %s named \'%s\'. Please enter a unique name.';
+$_lang["duplicate_name_found_module"] = 'There is already a Module named \'%s\'. Please enter a unique name.';
+$_lang["duplicated_el_suffix"] = 'Duplicate';
+$_lang["edit"] = 'Edit';
+$_lang["edit_resource"] = 'Edit Resource';
+$_lang["edit_resource_title"] = 'Edit Resource';
+$_lang["edit_settings"] = 'Configuration';
+$_lang["editedon"] = 'Edit date';
+$_lang["editing_file"] = 'Editing file: ';
+$_lang["editor_css_path_message"] = 'Enter the path to your CSS file that you wish to use within the editor. The best way to enter the path is to enter the path from the root of your server, for example: /assets/site/style.css. If you do not wish to load a style sheet into the editor, leave this field blank.';
+$_lang["editor_css_path_title"] = 'Path to CSS file';
+$_lang["element"] = 'Element';
+$_lang["element_categories"] = 'Combined View';
+$_lang["element_filter_msg"] = 'Type here to filter list';
+$_lang["element_management"] = 'Manage Elements';
+$_lang["element_name"] = 'Element name';
+$_lang["element_selector_msg"] = 'Select the Elements(s) from the list below and click the \'Insert\' button.';
+$_lang["element_selector_title"] = 'Element Selector';
+$_lang["elements"] = 'Elements';
+$_lang["email"] = 'Email';
+$_lang["email_sent"] = 'Email sent';
+$_lang["emailsender_message"] = 'The email address of the site administrator. For example, this email address will be used as the destination of system notification e-mail etc.';
+$_lang["emailsender_title"] = 'E-mail address';
+$_lang["emailsubject_default"] = 'Your login details';
+$_lang["emailsubject_message"] = 'Specify the value of the subject of the signup e-mail.';
+$_lang["emailsubject_title"] = 'E-mail subject';
+$_lang["empty_folder"] = 'This Container is empty';
+$_lang["empty_recycle_bin"] = 'Purge deleted Resources';
+$_lang["empty_recycle_bin_empty"] = 'There are no deleted Resources to purge.';
+$_lang["enable_resource"] = 'Enable Element file.';
+$_lang["enable_sharedparams"] = 'Enable parameter sharing';
+$_lang["enable_sharedparams_msg"] = 'NOTE: The above globally unique id (GUID) will be used to uniquely identify this Module and it\'s shared parameters. The GUID is also used to form a link between the Module and the Plugins or Snippets accessing the it\'s shared parameters. ';
+$_lang["enabled"] = 'Enabled';
+$_lang["error"] = 'Error';
+$_lang["error_sending_email"] = 'Error sending email';
+$_lang["errorpage_message"] = 'Enter a published and publicly accessible Resource ID to redirect users to when requesting a non-existing Resource.';
+$_lang["errorpage_title"] = 'Error page';
+$_lang["event_id"] = 'Event Id';
+$_lang["eventlog"] = 'Event log';
+$_lang["eventlog_msg"] = 'The event log is used to display information, warning and error messages generated by the content manager. The \'source\' column shows the section of the content manager where the message occurred.';
+$_lang["eventlog_viewer"] = 'System Events';
+$_lang["everybody"] = 'Everybody';
+$_lang["existing_category"] = 'Existing Category';
+$_lang["expand_tree"] = 'Expand Site Tree';
+$_lang["export_site"] = 'Export Static HTML';
+$_lang["export_site_cacheable"] = 'Include non-cacheable files:';
+$_lang["export_site_exporting_document"] = '[+status+] [+url+] - [+pagetitle+] ([+id+]) ';
+$_lang["export_site_failed"] = 'Failed!';
+$_lang["export_site_failed_no_open"] = 'Cannot open file: ';
+$_lang["export_site_failed_no_retrieve"] = 'Cannot retrieve document.';
+$_lang["export_site_failed_no_write"] = 'Cannot write file.';
+$_lang["export_site_html"] = 'Export site to HTML';
+$_lang["export_site_maxtime"] = 'Max export time:';
+$_lang["export_site_maxtime_message"] = 'Specify the number of seconds EVO can take to export the site (overriding PHP settings). Enter 0 for unlimited time. Please note, setting 0 or a really high number can do weird things to your server and is not recommended.';
+$_lang["export_site_message"] = 'Use this to export the entire site to static HTML files. Please note, however, that you will lose a lot of the EVO functionality should you do so:
Page reads on the exported files will not be recorded. Interactive Snippets will NOT work in exported files Only regular Resources will be exported, Weblinks will not be exported. The export process may fail if your Resources contain Snippets which send redirection headers. Depending on how you\'ve written your Resources, style sheets and images, the design of your site may be broken. To fix this, save/move your exported files to the same directory where the main EVO index.php file is located. Please fill out the form and press \'Export\' to start the export process. The files created will be saved in the /assets/export directory, using the Resources\' URL aliases as filenames when possible. While exporting your site, it\'s best to have the EVO configuration item \'Friendly URL aliases\' set to \'yes\'. Depending on the size of your site, the export may take a while.
Any existing files will be overwritten by the new files if their names are identical!
';
+$_lang["export_site_numberdocs"] = 'Found %s Resources to export...
';
+$_lang["export_site_prefix"] = 'File prefix:';
+$_lang["export_site_start"] = 'Start export';
+$_lang["export_site_success"] = 'Success!';
+$_lang["export_site_success_skip_dir"] = 'Skip this directory.';
+$_lang["export_site_success_skip_doc"] = 'Skip this document.';
+$_lang["export_site_suffix"] = 'File suffix:';
+$_lang["export_site_target_unwritable"] = 'Target directory isn\'t writable. Please ensure the directory is writable, and try again.';
+$_lang["export_site_time"] = 'Export finished. Export took %s seconds to complete.';
+$_lang["failed_login_message"] = 'Enter the number of failed login attempts allowed before blocking a user.';
+$_lang["failed_login_title"] = 'Failed Login Attempts';
+$_lang["fe_editor_lang_message"] = 'Choose a language for the editor to use when used as a front-end editor.';
+$_lang["fe_editor_lang_title"] = 'Front-end Editor Language';
+$_lang["file_delete_file"] = 'Delete file';
+$_lang["file_delete_folder"] = 'Delete directory';
+$_lang["file_deleted"] = 'Success!';
+$_lang["file_download_file"] = 'Download File';
+$_lang["file_download_unzip"] = 'Unzip File';
+$_lang["file_folder_chmod_error"] = 'Unable to change permissions, you will need to change permissions outside of EVO.';
+$_lang["file_folder_created"] = 'Directory created successfully!';
+$_lang["file_folder_deleted"] = 'Directory was successfully deleted!';
+$_lang["file_folder_not_created"] = 'Unable to create directory';
+$_lang["file_folder_not_deleted"] = 'Unable to delete directory. Make sure it is empty before deleting.';
+$_lang["file_not_deleted"] = 'Failed!';
+$_lang["file_not_saved"] = 'Cannot save file, please ensure target directory is writable!';
+$_lang["file_saved"] = 'File updated successfully!';
+$_lang["file_unzip"] = 'Unzip was successful!';
+$_lang["file_unzip_fail"] = 'Unzip Failed!';
+$_lang["filemanager_path_message"] = 'IIS often does not populate the document_root setting properly, which is used by the file manager to determine what you can see. If you are having problems using the file manager, make sure this path points to the root of your EVO installation.';
+$_lang["filemanager_path_title"] = 'File Manager path';
+$_lang["files_access_denied"] = 'Access denied!';
+$_lang["files_data"] = 'Data';
+$_lang["files_dir_listing"] = 'Directory listing for:';
+$_lang["files_directories"] = 'Directories';
+$_lang["files_directory_is_empty"] = 'This directory is empty.';
+$_lang["files_dirwritable"] = 'Directory writable?';
+$_lang["files_editfile"] = 'Edit file';
+$_lang["files_file_type"] = 'File type: ';
+$_lang["files_filename"] = 'Filename';
+$_lang["files_fileoptions"] = 'Options';
+$_lang["files_files"] = 'Files';
+$_lang["files_filesize"] = 'File size';
+$_lang["files_filetype_notok"] = 'Uploading of this kind of file is not allowed!';
+$_lang["files_management"] = 'Manage Files';
+$_lang["files_management_no_permission"] = 'You do not have enough permissions to view or edit these files. Ask the administrator to grant you access to %s .';
+$_lang["files_modified"] = 'Modified';
+$_lang["files_top_level"] = 'To top level';
+$_lang["files_up_level"] = 'Up one level';
+$_lang["files_upload_copyfailed"] = 'Failed to copy file to destination directory - upload failed!';
+$_lang["files_upload_error"] = 'Error';
+$_lang["files_upload_error0"] = 'There was a problem with your upload.';
+$_lang["files_upload_error1"] = 'The file you are trying to upload is too big.';
+$_lang["files_upload_error2"] = 'The file you are trying to upload is too big.';
+$_lang["files_upload_error3"] = 'The file you are trying upload was only partially uploaded.';
+$_lang["files_upload_error4"] = 'You must select a file for upload.';
+$_lang["files_upload_error5"] = 'There was a problem with your upload.';
+$_lang["files_upload_inhibited_msg"] = 'Upload feature inhibited - make sure uploads are supported and the directory is writable for PHP.';
+$_lang["files_upload_ok"] = 'File uploaded successfully!';
+$_lang["files_upload_permissions_error"] = 'Possible permission problems - the directory you want to upload to needs to be writable by your webserver.';
+$_lang["files_uploadfile"] = 'Upload file';
+$_lang["files_uploadfile_msg"] = 'Select a file to upload:';
+$_lang["files_uploading"] = 'Uploading %s to %s/ ';
+$_lang["files_viewfile"] = 'View file';
+$_lang["folder"] = 'Folder';
+$_lang["forgot_password_email_fine_print"] = '* The URL above will expire once you change your password or after today.';
+$_lang["forgot_password_email_instructions"] = 'From there you will be able to change your password from the My Account menu.';
+$_lang["forgot_password_email_intro"] = 'A request has been made to change the password on your account.';
+$_lang["forgot_password_email_link"] = 'Click here to complete the process.';
+$_lang["forgot_your_password"] = 'Forgot your password?';
+$_lang["friday"] = 'Friday';
+$_lang["friendly_alias_message"] = 'With Friendly URLs enabled, a Resource URL alias will be used when present instead of the Resource ID. E.g., if a Resource with ID 1 has an URL alias of "introduction", no prefix set (empty) and a suffix of ".html", enabling this option would generate an URL alias of "introduction.html". If there is no URL alias set, EVO generates "1.html".';
+$_lang["friendly_alias_title"] = 'Use Friendly URL aliases';
+$_lang["friendlyurls_message"] = 'Use Search Engine Friendly URLs on Apache webservers with mod_rewrite or IIS with third-party plugins. See the .htaccess file in the site root of the distribution for more info.';
+$_lang["friendlyurls_title"] = 'Use FriendlyURLs';
+$_lang["friendlyurlsprefix_message"] = 'A prefix setting of "page" will turn the URL /index.php?id=2 to the URL alias "page2.html" (assuming the suffix is set to .html).';
+$_lang["friendlyurlsprefix_title"] = 'Friendly URL Prefix';
+$_lang["friendlyurlsuffix_message"] = 'Any suffix you choose will work, including no suffix at all. E.g., ".aspx" will append .aspx to all URL aliases.';
+$_lang["friendlyurlsuffix_title"] = 'Friendly URL Suffix';
+$_lang["functionnotimpl"] = 'Sorry!';
+$_lang["functionnotimpl_message"] = 'This function has not been implemented yet.';
+$_lang["further_info"] = 'Further information';
+$_lang["global_tabs"] = 'Global Tabs';
+$_lang["go"] = 'Go';
+$_lang["group_access_permissions"] = 'User group access';
+$_lang['group_tvs'] = 'Group TV';
+$_lang["guid"] = 'GUID';
+$_lang["help"] = 'Help';
+$_lang["help_msg"] = 'You can obtain free community support by visiting the EVO Forums . There is also a growing body of EVO Documentation and Guides that touch on virtually every aspect of EVO.
We are planning to offer commercial support services for EVO as well. Please email us if you\'re interested .
';
+$_lang["help_title"] = 'Help';
+$_lang["hide_tree"] = 'Hide Site Tree';
+$_lang["home"] = 'Dashboard';
+$_lang["htmlsnippet"] = 'Chunk';
+$_lang["htmlsnippets"] = 'Chunks';
+$_lang["htmlsnippet_desc"] = 'Description';
+$_lang["htmlsnippet_management_msg"] = 'Select the Chunk you wish to edit.';
+$_lang["htmlsnippet_msg"] = 'Add and edit Chunks. Remember, Chunks are \'raw\' HTML code, so any PHP code won\'t be processed.';
+$_lang["htmlsnippet_name"] = 'Chunk name';
+$_lang["htmlsnippet_title"] = 'Create/edit Chunk';
+$_lang["icon"] = 'Icon';
+$_lang["icon_description"] = 'CSS class value. e.g. fa fa-star';
+$_lang["id"] = 'ID';
+$_lang["illegal_parent_child"] = 'Parent Assignment:\n\nResource is a child of the selected Resource.';
+$_lang["illegal_parent_self"] = 'Parent Assignment:\n\nThe selected Resource cannot be assigned to itself.';
+$_lang["images_management"] = 'Manage Images';
+$_lang["import_files_found"] = 'Found %s Resources for import... ';
+$_lang["import_params"] = 'Import Module shared parameters';
+$_lang["import_params_msg"] = 'You can import the parameters or settings of a Module by selecting the name of the Module from the above drop down menu. NOTE: In order for Modules to appear inside the menu, this Plugin/Snippet must be a part of the Module\'s dependency listing and the Module must have parameter sharing enabled. ';
+$_lang["import_parent_resource"] = 'Parent Resource:';
+$_lang["import_site"] = 'Import HTML';
+$_lang["import_site_failed"] = 'Failed!';
+$_lang["import_site_failed_db_error"] = 'A database error occured while trying to clone Resource: ';
+$_lang["import_site_failed_no_open_dir"] = 'Could not open directory: ';
+$_lang["import_site_failed_no_retrieve_file"] = 'Could not retrieve file: ';
+$_lang["import_site_html"] = 'Import site from HTML';
+$_lang["import_site_importing_document"] = 'Importing file %s ';
+$_lang["import_site_maxtime"] = 'Max import time:';
+$_lang["import_site_maxtime_message"] = 'Specify the number of seconds allowed for the Content Manager to import the site (overriding PHP settings). Enter 0 for unlimited time. Please note, setting 0 or a really high number can do weird things to your server and is not recommended.';
+$_lang["import_site_message"] = 'Import an entire HTML site into your site database. Please note that you will need to copy your html files and/or directories into the /assets/import directory.
Please fill out the form and press \'Import\' to start the import process. The files imported will be saved into the selected location, using the files name as the Resource\'s URL aliases where possible, and the Resource title tag as the pagetitle.';
+$_lang["import_site_skip"] = 'Skipped!';
+$_lang["import_site_start"] = 'Start Import';
+$_lang["import_site_success"] = 'Success!';
+$_lang["import_site_time"] = 'Import finished. Import took %s seconds to complete.';
+$_lang["inbox"] = 'Inbox';
+$_lang["info"] = 'Info';
+$_lang["information"] = 'Information';
+$_lang["inline"] = 'Inline';
+$_lang["insert"] = 'Insert';
+$_lang["maxImageWidth"] = 'Maximum image width';
+$_lang["maxImageHeight"] = 'Maximum image height';
+$_lang["clientResize"] = 'Resize images on client-side';
+$_lang["clientResize_message"] = 'If enabled then images will be resized by browser before upload to the server';
+$_lang["noThumbnailsRecreation"] = 'Create thumbnails on upload only';
+$_lang["noThumbnailsRecreation_message"] = 'File browser will create thumbnails only on upload; if there\'s no thumbnails for some images, they will not be created';
+$_lang["thumbWidth"] = 'Maximum thumbnail width';
+$_lang["thumbHeight"] = 'Maximum thumbnail height';
+$_lang["thumbsDir"] = 'Thumbnails directory location';
+$_lang["jpegQuality"] = 'JPEG compression';
+$_lang["denyZipDownload"] = 'Disable zip-archives downloading';
+$_lang["denyExtensionRename"] = 'Disable renaming of file extensions';
+$_lang["maxImageWidth_message"] = 'If uploaded image resolution exceeds this setting it will be automatically resized. Set 0 to avoid.';
+$_lang["maxImageHeight_message"] = 'If uploaded image resolution exceeds this setting it will be automatically resized. Set 0 to avoid.';
+$_lang["thumbWidth_message"] = 'Maximum thumbnail width.';
+$_lang["thumbHeight_message"] = 'Maximum thumbnail height.';
+$_lang["thumbsDir_message"] = 'The name of thumbnail directory.';
+$_lang["jpegQuality_message"] = 'JPEG compression quality of thumbnails and resized images';
+$_lang["showHiddenFiles"] = 'Show hidden files in file browser';
+$_lang["keyword"] = 'Keyword';
+$_lang["keywords"] = 'Keywords';
+$_lang["keywords_intro"] = 'To edit a keyword, simply type in the new keyword in the text field next to the keyword you wish to change. To delete a keyword, check the \'delete\' box for that keyword. If you check the keyword\'s delete box, and also change it\'s name, it will be deleted, and the renaming of the keyword will not take place!';
+$_lang["language_message"] = 'Select the language for the EVO Content Manager.';
+$_lang["language_title"] = 'Manager language';
+$_lang["last_update"] = 'Last update';
+$_lang["launch_site"] = 'View Site';
+$_lang["license"] = 'License';
+$_lang["link_attributes"] = 'Link Attributes';
+$_lang["link_attributes_help"] = 'Enter optional attributes for a link for this page, such as target="_blank" or rel="external".';
+$_lang["list_mode"] = 'Turn on/off list mode - used to list all records in the grid.';
+$_lang["loading_doc_tree"] = 'Loading Site Tree...';
+$_lang["loading_menu"] = 'Loading menu...';
+$_lang["loading_page"] = 'Please wait while EVO loads the page...';
+$_lang["localtime"] = 'Local Time';
+$_lang["lock_htmlsnippet"] = 'Lock Chunk for editing';
+$_lang["lock_htmlsnippet_msg"] = 'Only Administrators (Role ID 1) can edit this Chunk.';
+$_lang["lock_module"] = 'Lock Module for editing';
+$_lang["lock_module_msg"] = 'Only Administrators (Role ID 1) can edit this Module.';
+$_lang["lock_msg"] = '%s is currently editing this %s. Please wait until the other user has finished and try again.';
+$_lang["lock_plugin"] = 'Lock Plugin for editing';
+$_lang["lock_plugin_msg"] = 'Only Administrators (Role ID 1) can edit this Plugin.';
+$_lang["lock_settings_msg"] = '%s is currently editing these settings. Please wait until the other user has finished and try again.';
+$_lang["lock_snippet"] = 'Lock Snippet for editing';
+$_lang["lock_snippet_msg"] = 'Only Administrators (Role ID 1) can edit this Snippet.';
+$_lang["lock_template"] = 'Lock Template for editing';
+$_lang["lock_template_msg"] = 'Only Administrators (Role ID 1) can edit this Template.';
+$_lang["lock_tmplvars"] = 'Lock Template Variable for editing';
+$_lang["lock_tmplvars_msg"] = 'Only Administrators (Role ID 1) can edit this Template Variable.';
+$_lang["locked"] = 'Locked';
+$_lang["login_allowed_days"] = 'Allowed Days';
+$_lang["login_allowed_days_message"] = 'Select the days that this user is allowed to login.';
+$_lang["login_allowed_ip"] = 'Allowed IP Address';
+$_lang["login_allowed_ip_message"] = 'Enter the IP addresses that this user is allowed to login from. NOTE: Separate multiple IP addresses with a comma (,) ';
+$_lang["login_button"] = 'Login';
+$_lang["login_cancelled_install_in_progress"] = 'Install/update of this site is currently in progress. Please retry in a couple of minutes!';
+$_lang["login_cancelled_site_was_updated"] = 'Install/update on this site was executed, please login again!';
+$_lang["login_captcha_message"] = 'Please enter the security code shown in the graphic. If you can\'t read the code, click the image to generate a new one or contact your site admin.';
+$_lang["login_homepage"] = 'Login Home Page';
+$_lang["login_homepage_message"] = 'Enter the ID of the Resource you want to send user to after he/she has logged in. NOTE: make sure the ID you enter belongs to an existing Resource, and that it has been published and is accessible by this user! ';
+$_lang["login_message"] = 'Please enter your login credentials to start your Manager session. Your username and password are case-sensitive, so please enter them carefully!';
+$_lang["logo_slogan"] = 'EVO Content Manager - \nCreate and do more with less';
+$_lang["logout"] = 'Logout';
+$_lang["long_title"] = 'Long title';
+$_lang["mail_check_timeperiod_message"] = 'How often to check for new mail messages in the Manager, in seconds.';
+$_lang["mail_check_timeperiod_title"] = 'Mail Check Time Period';
+$_lang["manage_depends"] = 'Manage Dependencies';
+$_lang["manage_files"] = 'Manage Files';
+$_lang["manage_htmlsnippets"] = 'Chunks';
+$_lang["manage_metatags"] = 'Manage META tags and Keywords';
+$_lang["manage_modules"] = 'Manage Modules';
+$_lang["manage_plugins"] = 'Plugins';
+$_lang["manage_snippets"] = 'Snippets';
+$_lang["manage_templates"] = 'Templates';
+$_lang["manage_documents"] = 'Documents';
+$_lang["manager"] = 'Manager';
+$_lang["manager_lockout_message"] = 'You are currently logged into the Content Manager. If you would like to close your login session please click the "Logout" button.
To go to your startup or home page click the "Home" button.';
+$_lang["manager_permissions"] = 'Manager Permissions';
+$_lang["manager_theme"] = 'Manager Theme';
+$_lang["manager_theme_message"] = 'Select the Theme for the Content Manager.';
+$_lang["manager_theme_mode"] = 'Color Scheme:';
+$_lang["manager_theme_mode1"] = 'everything is light';
+$_lang["manager_theme_mode2"] = 'the header is dark';
+$_lang["manager_theme_mode3"] = 'header and sidebar are dark';
+$_lang["manager_theme_mode4"] = 'everything is dark';
+$_lang['manager_theme_mode_message'] = 'This setting is used as the "default" and can be overridden by the manager when using the theme color mode switch button in the Resource Tree: ';
+$_lang['manager_theme_mode_title'] = 'Theme color mode switch';
+$_lang["messages"] = 'Messages';
+$_lang["messages_all"] = 'Everyone';
+$_lang["messages_compose"] = 'Compose a message';
+$_lang["messages_forward"] = 'Forward';
+$_lang["messages_from"] = 'From';
+$_lang["messages_group"] = 'A group';
+$_lang["messages_inbox"] = 'Inbox';
+$_lang["messages_message"] = 'Message';
+$_lang["messages_no_messages"] = 'No messages in Inbox.';
+$_lang["messages_not_allowed_to_read"] = 'You\'re not allowed to read this message!';
+$_lang["messages_private"] = 'Private';
+$_lang["messages_read_message"] = 'Read message';
+$_lang["messages_reply"] = 'Reply';
+$_lang["messages_select_group"] = 'Select a group';
+$_lang["messages_select_user"] = 'Select a user';
+$_lang["messages_send"] = 'Send';
+$_lang["messages_send_to"] = 'Send to';
+$_lang["messages_sent"] = 'Sent on';
+$_lang["messages_subject"] = 'Subject';
+$_lang["messages_system_user"] = '[System]';
+$_lang["messages_title"] = 'Messages';
+$_lang["messages_user"] = 'A user';
+$_lang["meta_keywords"] = 'META Keywords';
+$_lang["metatag_intro"] = 'On this page you can delete, create or edit META tags. To link META tags to Resources, click on the META Keywords tab when editing the Resource, and select the desired META tags and keywords. To add a new tag enter the name and value and click the \'Add tag\' button. To edit the tag click on the name of the tag from within the data grid.';
+$_lang["metatag_notice"] = 'You may wish to reference the HTML Reference Guide site for more information. This is not a complete list of possible Meta Tags.';
+$_lang["metatags"] = 'META tags';
+$_lang["mgr_access_permissions"] = 'Manager access permissions';
+$_lang["mgr_login_start"] = 'Manager Login Startup';
+$_lang["mgr_login_start_message"] = 'Enter the ID of the Resource you want to send the user to after he/she has logged into the manager. NOTE: make sure the ID you\'ve enter belongs to an existing Resource, and that it has been published and is accessible by this user! ';
+$_lang["mgrlog_action"] = 'Action';
+$_lang["mgrlog_actionid"] = 'Action ID';
+$_lang["mgrlog_anyall"] = 'Any/All';
+$_lang["mgrlog_datecheckfalse"] = 'checkdate() returned false.';
+$_lang["mgrlog_datefr"] = 'Date from';
+$_lang["mgrlog_dateinvalid"] = 'Invalid date format.';
+$_lang["mgrlog_dateto"] = 'Date to';
+$_lang["mgrlog_emptysrch"] = 'Your search query returned an empty result set (i.e. not matching logs found).';
+$_lang["mgrlog_field"] = 'Field';
+$_lang["mgrlog_itemid"] = 'Item ID';
+$_lang["mgrlog_itemname"] = 'Item name';
+$_lang["mgrlog_msg"] = 'Message';
+$_lang["mgrlog_noquery"] = 'No search query entered yet.';
+$_lang["mgrlog_qresults"] = 'Query results';
+$_lang["mgrlog_query"] = 'Query logging';
+$_lang["mgrlog_query_msg"] = 'Please make a selection for viewing the logs. You can select log entries by date, but be aware that the dates you enter are not inclusive - to select every log entry for 01-01-2004, set \'date from\' to 01-01-2004 and \'date to\' to 02-01-2004. Message and action are usually the same. If you\'re searching for a specific message, it\'s best to set action to \'Any/All\'.';
+$_lang["mgrlog_results"] = 'No. of results';
+$_lang["mgrlog_searchlogs"] = 'Search logs';
+$_lang["mgrlog_sortinst"] = 'Sort the table by clicking on the column headers. If the logs are too large, empty the log file to remove all log entries up to now. This cannot be undone!';
+$_lang["mgrlog_time"] = 'Time';
+$_lang["mgrlog_user"] = 'User';
+$_lang["mgrlog_username"] = 'Username';
+$_lang["mgrlog_value"] = 'Value';
+$_lang["mgrlog_view"] = 'View manager logs';
+$_lang["module_code"] = 'Module code (php)';
+$_lang["module_config"] = 'Module configuration';
+$_lang["module_desc"] = 'Description';
+$_lang["module_disabled"] = 'Module disabled';
+$_lang["module_edit_click_title"] = 'Click here to edit this Module';
+$_lang["module_group_access_msg"] = 'Select the User Groups that are allowed to execute this Module from within the Content Manager.';
+$_lang["module_management"] = 'Manage Modules';
+$_lang["module_management_msg"] = 'Choose the Module you would like to execute or modify. To run the Module click on the icon in the grid. To modify the Module click on the name of the Module.';
+$_lang["module_msg"] = 'Add/edit Modules. A Module is a collection of Elements (e.g. Plugins, Snippets, etc).';
+$_lang["module_name"] = 'Module name';
+$_lang["module_resource_msg"] = 'Add or remove Elements upon which this Module depends. To add a new Element click on the one of the add buttons below.';
+$_lang["module_resource_title"] = 'Module Dependencies';
+$_lang["module_title"] = 'Create/edit Module';
+$_lang["module_viewdepend_msg"] = 'View the assigned Elements on which this Module depends. Click on the "Manager Dependencies" button to modify the dependencies';
+$_lang["modules"] = 'Modules';
+$_lang["modx_news"] = 'EVO News Notices';
+$_lang["modx_news_tab"] = 'EVO News';
+$_lang["modx_news_title"] = 'EVO News';
+$_lang["modx_security_notices"] = 'EVO Security Notices';
+$_lang["modx_version"] = 'EVO version';
+$_lang["monday"] = 'Monday';
+$_lang["move"] = 'Move';
+$_lang["move_resource"] = 'Move Resource';
+$_lang["move_resource_message"] = 'Move a Resource and all its children by selecting a new parent in the Site Tree. If you select a Resource that is not already a Container, it will be changed into one. Please click on the new parent in the Site Tree.';
+$_lang["move_resource_new_parent"] = 'Please select a new parent in the Site Tree.';
+$_lang["move_resource_title"] = 'Move Resource';
+$_lang["name"] = 'Username';
+$_lang["new_category"] = 'New Category';
+$_lang["new_file_permissions_message"] = 'When uploading a new file in the File Manager, the File Manager will attempt to change the file permissions to those entered in this setting. This may not work on some setups, such as IIS, in which case you will need to manually change the permissions.';
+$_lang["new_file_permissions_title"] = 'New File Permissions';
+$_lang["new_folder_permissions_message"] = 'When creating a new directory in the File Manager, the File Manager will attempt to change the directory permissions to those entered in this setting. This may not work on some setups, such as IIS, in which case you will need to manually change the permissions.';
+$_lang["new_folder_permissions_title"] = 'New Directory Permissions';
+$_lang["new_htmlsnippet"] = 'New Chunk';
+$_lang["new_keyword"] = 'Add new keyword:';
+$_lang["new_module"] = 'New Module';
+$_lang["new_parent"] = 'New parent';
+$_lang["new_plugin"] = 'New Plugin';
+$_lang["new_role"] = 'New Role';
+$_lang["new_snippet"] = 'New Snippet';
+$_lang["new_template"] = 'New Template';
+$_lang["new_tmplvars"] = 'New Template Variable';
+$_lang["new_user"] = 'New Manager User';
+$_lang["new_web_user"] = 'New Web User';
+$_lang["new_resource"] = 'New Resource';
+$_lang["no"] = 'No';
+$_lang["no_active_users_found"] = 'No active users found.';
+$_lang["no_activity_message"] = 'You have not yet created or edited any Resources.';
+$_lang["no_category"] = 'uncategorized';
+$_lang["no_docs_pending_publishing"] = 'No Resources pending publishing.';
+$_lang["no_docs_pending_pubunpub"] = 'No Events Found';
+$_lang["no_docs_pending_unpublishing"] = 'No Resources pending unpublishing.';
+$_lang["no_edits_creates"] = 'No edits or creates found.';
+$_lang["no_groups_found"] = 'No groups found.';
+$_lang["no_keywords_found"] = 'There are currently no keywords.';
+$_lang["no_records_found"] = 'No records found.';
+$_lang["no_results"] = 'No results found';
+$_lang["nologentries_message"] = 'Enter the number of log entries shown per page when you browse the Audit trail.';
+$_lang["nologentries_title"] = 'Number of log entries';
+$_lang["nomessages_message"] = 'Enter the number of messages to show in inbox when viewing messages.';
+$_lang["nomessages_title"] = 'Number of messages';
+$_lang["none"] = 'None';
+$_lang["noresults_message"] = 'Enter the number of results to show in the data grid when viewing listings and search results.';
+$_lang["noresults_title"] = 'Number of Results';
+$_lang["not_deleted"] = 'has not been deleted.';
+$_lang["not_set"] = 'Not set';
+$_lang["offline"] = 'Offline';
+$_lang["online"] = 'Online';
+$_lang["onlineusers_action"] = 'Action';
+$_lang["onlineusers_actionid"] = 'Action-ID';
+$_lang["onlineusers_ipaddress"] = 'IP address';
+$_lang["onlineusers_lasthit"] = 'Last hit';
+$_lang["onlineusers_message"] = 'This list shows all users active within the last 20 minutes (current time is ';
+$_lang["onlineusers_title"] = 'Online users';
+$_lang["onlineusers_user"] = 'Username';
+$_lang["onlineusers_userid"] = 'User\'s ID';
+$_lang["optimize_table"] = 'Click here to optimize this table';
+$_lang["page_data_alias"] = 'Alias';
+$_lang["page_data_cacheable"] = 'Cacheable';
+$_lang["page_data_cacheable_help"] = 'This allows the Resource to be saved to the site cache, and affects all Snippets on the page.';
+$_lang["page_data_cached"] = 'Source retrieved from cache: ';
+$_lang["page_data_changes"] = 'Changes';
+$_lang["page_data_contentType"] = 'Internet Media Type';
+$_lang["page_data_contentType_help"] = 'Select the content type for this Resource. If you\'re not sure which content type the Resource should have, just leave it as text/html.';
+$_lang["page_data_created"] = 'Created';
+$_lang["page_data_edited"] = 'Edited';
+$_lang["page_data_editor"] = 'Edit using rich text editor';
+$_lang["page_data_folder"] = 'Resource is Container';
+$_lang["page_data_general"] = 'General';
+$_lang["page_data_markup"] = 'Markup/structure';
+$_lang["page_data_mgr_access"] = 'Manager access';
+$_lang["page_data_notcached"] = 'This Resource has not yet been cached.';
+$_lang["page_data_publishdate"] = 'Publish date';
+$_lang["page_data_publishdate_help"] = 'If you set a publish date, the Resource will be published as soon as the publish date is reached. Click on the calender icon to select a date, or on the icon next to it to remove the publish date. This will then mean the Resource is never automatically published.';
+$_lang["page_data_published"] = 'Published';
+$_lang["page_data_searchable"] = 'Searchable';
+$_lang["page_data_searchable_help"] = 'Checking this field will allow the Resource to be searched. You can also use this field for other purposes in your Snippets.';
+$_lang["page_data_source"] = 'Source';
+$_lang["page_data_status"] = 'Status';
+$_lang["page_data_template"] = 'Uses Template';
+$_lang["page_data_template_help"] = 'Select the Template for this Resource.';
+$_lang["page_data_title"] = 'Page data';
+$_lang["page_data_unpublishdate"] = 'Un-publish date';
+$_lang["page_data_unpublishdate_help"] = 'If you set an unpublish date, the Resource will be unpublished as soon as the unpublish date is reached. Click on the calender icon to select a date, or on the icon next to it to remove the unpublish date. This will then mean the Resource is never automatically unpublished.';
+$_lang["page_data_unpublished"] = 'Un-published';
+$_lang["page_data_web_access"] = 'Web access';
+$_lang["pagetitle"] = 'Resource\'s title';
+$_lang["pagination_table_first"] = 'First';
+$_lang["pagination_table_gotopage"] = 'Go to page';
+$_lang["pagination_table_last"] = 'Last';
+$_lang["paging_first"] = 'first';
+$_lang["paging_last"] = 'last';
+$_lang["paging_next"] = 'next';
+$_lang["paging_prev"] = 'prev';
+$_lang["paging_showing"] = 'Showing';
+$_lang["paging_to"] = 'to';
+$_lang["paging_total"] = 'total';
+$_lang["parameter"] = 'Parameter';
+$_lang["parse_docblock"] = 'Parse DocBlock';
+$_lang["parse_docblock_msg"] = 'Attention (!): Resets actual name, configuration, description and category to install-defaults by parsing the source code.';
+$_lang["password"] = 'Password';
+$_lang["password_change_request"] = 'Password change request';
+$_lang["password_gen_gen"] = 'Let EVO generate a password.';
+$_lang["password_gen_length"] = 'The password you specify needs to be at least 6 characters long.';
+$_lang["password_gen_method"] = 'New password method';
+$_lang["password_gen_specify"] = 'Let me specify the password:';
+$_lang["password_method"] = 'Password notification method';
+$_lang["password_method_email"] = 'Send the new password by e-mail.';
+$_lang["password_method_screen"] = 'Show the new password on screen.';
+$_lang["password_msg"] = 'The new password for %s is %s ';
+$_lang["php_version_check"] = 'EVO Evolution is compatible with PHP version 5.6.0 and higher. This server is using version %s%. Please upgrade your PHP installation!';
+$_lang["plugin"] = 'Plugin';
+$_lang["plugins"] = 'Plugins';
+$_lang["plugin_code"] = 'Plugin code (php)';
+$_lang["plugin_config"] = 'Plugin configuration';
+$_lang["plugin_desc"] = 'Description';
+$_lang["plugin_disabled"] = 'Plugin Disabled';
+$_lang["plugin_event_msg"] = 'Select the events that you would like this Plugin to listen to.';
+$_lang["plugin_management_msg"] = 'Choose which Plugin you wish to edit.';
+$_lang["plugin_msg"] = 'Add/edit Plugins. Plugins use PHP code that is invoked whenever specific System Events trigger.';
+$_lang["plugin_name"] = 'Plugin name';
+$_lang["plugin_priority"] = 'Edit Plugin Execution Order by Event';
+$_lang["plugin_priority_instructions"] = 'Drag to reorder the Plugins under each Event header. The first plugin to execute should go at the top.';
+$_lang["plugin_priority_title"] = 'Plugin Execution Order';
+$_lang["purge_plugin"] = 'Purge obsolete plugins';
+$_lang["purge_plugin_confirm"] = 'Are you sure you want to purge obsolete plugins?';
+$_lang["plugin_title"] = 'Create/edit Plugin';
+$_lang["preview"] = 'Preview';
+$_lang["preview_msg"] = 'This is a preview of your last saved changes. Click here to Save and Refresh your current changes';
+$_lang["preview_resource"] = 'Preview Resource';
+$_lang["private"] = 'Private';
+$_lang["public"] = 'Public';
+$_lang["publish_date"] = 'Publish Date';
+$_lang["publish_events"] = 'Publish Events';
+$_lang["publish_resource"] = 'Publish Resource';
+$_lang["rb_base_dir_message"] = 'Enter the physical path to the File Browser directory. This setting is usually automatically generated. If you\'re using IIS, however, EVO may not be able to work the path out on its own, causing the File Browser to show an error. In that case, you can enter the path to the images directory here (the path as you\'d see it in Windows Explorer). NOTE: The File Browser directory must contain the subdirectories images, files, flash and media in order for the file browser to function correctly.';
+$_lang["rb_base_dir_title"] = 'File base path';
+$_lang["rb_base_url_message"] = 'Enter the virtual path to files directory. This setting is usually automatically generated. If you\'re using IIS, however, EVO may not be able to work the URL out on it\'s own, causing the File Browser to show an error. In that case, you can enter the URL to the images directory here (the URL as you\'d enter it on Internet Explorer).';
+$_lang["rb_base_url_title"] = 'File Browser URL';
+$_lang["rb_message"] = 'Select yes to enable the File Browser. This will allow your users to browse and upload files such as images, flash and media files on the server.';
+$_lang["rb_title"] = 'Enable File Browser';
+$_lang["rb_webuser_message"] = 'Do you want to allow a web user the ability to use the file browser? WARNING: Allowing web users the use of the file browser exposes the files available to manager users. Only use this option for trusted web users.';
+$_lang["rb_webuser_title"] = 'Web Users?';
+$_lang["recent_docs"] = 'Recent Resources';
+$_lang["recommend_setting_change_title"] = 'Recommended Setting Change';
+$_lang["recommend_setting_change_description"] = 'Your site is not configured to validate the HTTP_REFERER of incoming requests to the Manager. We strongly recommend enabling this setting to reduce the risk of a CSRF (Cross Site Request Forgery) attack.';
+$_lang["references"] = 'References';
+$_lang["refresh_cache"] = 'Cache: Found %s files in cache directory and deleted %d cache files.New cache files will be created when pages are requested.';
+$_lang["refresh_published"] = '%s Resources were published.';
+$_lang["refresh_site"] = 'Clear Cache';
+$_lang["refresh_title"] = 'Refresh site';
+$_lang["refresh_tree"] = 'Refresh Site Tree';
+$_lang["refresh_unpublished"] = '%s Resources were unpublished.';
+$_lang["release_date"] = 'Release date';
+$_lang["remember_last_tab"] = 'Remember tabs';
+$_lang["remember_last_tab_message"] = 'Tabbed Manager pages load with the last tab viewed instead of defaulting to the first tab';
+$_lang["remember_username"] = 'Remember me';
+$_lang["remove"] = 'Remove';
+$_lang["remove_date"] = 'Remove date';
+$_lang["remove_locks"] = 'Remove Locks';
+$_lang["rename"] = 'Rename';
+$_lang["reports"] = 'Reports';
+$_lang["report_issues"] = 'Report issues';
+$_lang["require_tagname"] = 'A tag name is required';
+$_lang["require_tagvalue"] = 'A tag value is required';
+$_lang["reserved_name_warning"] = 'You have used a reserved name.';
+$_lang["reset"] = 'Reset';
+$_lang["reset_failedlogins"] = 'reset';
+$_lang["reset_sort_order"] = 'Reset sort order';
+$_lang["resource"] = 'Resource';
+$_lang["resource_alias"] = 'URL alias';
+$_lang["resource_alias_help"] = 'Set the URL alias to make the Resource accessible as http://example.com/weburl. This only works Friendly URLs are enabled in the site configuration.';
+$_lang["resource_content"] = 'Resource content';
+$_lang["resource_description"] = 'Description';
+$_lang["resource_description_help"] = 'Enter an optional description of this Resource.';
+$_lang["resource_duplicate"] = 'Duplicate Resource';
+$_lang["resource_long_title_help"] = 'Enter an optional longer title for your Resource. This can be used for automatic Resource header tags for search engines, and might be more descriptive for your Resource.';
+$_lang["resource_metatag_help"] = 'Select the META tags or keywords you wish to assign to this Resource. Hold down the CTRL key to select multiple keywords or meta tags.';
+$_lang["resource_opt_contentdispo"] = 'Content-Disposition';
+$_lang["resource_opt_contentdispo_help"] = 'Use the content disposition field to specify how this Resource will be handled by the web browser. For file downloads select the Attachment option.';
+$_lang["resource_opt_emptycache"] = 'Empty cache';
+$_lang["resource_opt_emptycache_help"] = 'Leaving this field checked will make EVO empty the cache after you save the Resource. This way your visitors will not see an older version of the Resource.';
+$_lang["resource_opt_folder"] = 'Container';
+$_lang["resource_opt_folder_help"] = 'Check this to make the Resource also act as a Container for other Resources. A \'Container\' is like a folder, only it can also have content.';
+$_lang["resource_opt_menu_index"] = 'Menu index';
+$_lang["resource_opt_menu_index_help"] = 'Menu Index is a field that can control sorting Resources, particularly in menu Snippet(s). You can also use it for any other purpose in your Snippets.';
+$_lang["resource_opt_menu_title"] = 'Menu title';
+$_lang["resource_opt_menu_title_help"] = 'Menu title is an optional field used to display a short title in menu Snippet(s) or Modules.';
+$_lang["resource_opt_published"] = 'Published';
+$_lang["resource_opt_published_help"] = 'Check this field to have the Resource published immediately after saving it.';
+$_lang["resource_opt_richtext"] = 'Rich text';
+$_lang["resource_opt_richtext_help"] = 'Leave this checked to use the rich text editor for editing Resources. If your Resources contain JavaScript and forms, uncheck this to edit in HTML mode to prevent the editor from incorrectly changing your Resources.';
+$_lang["resource_opt_show_menu"] = 'Show in menu';
+$_lang["resource_opt_show_menu_help"] = 'Select this option to show Resource inside a web menu. Please note that some Menu Builders might choose to ignore this option.';
+$_lang["resource_opt_trackvisit_help"] = 'Log each visitor\'s visit to this page';
+$_lang["resource_overview"] = 'Resource overview';
+$_lang["resource_parent"] = 'Resource parent';
+$_lang["resource_parent_help"] = 'Click the icon to enable setting a Resource parent, then click a Resource in the Site Tree to set a new parent.';
+$_lang["resource_permissions_error"] = 'Assign this Resource to at least one Resource Group to which you have access.';
+$_lang["resource_setting"] = 'Resource setting';
+$_lang["resource_summary"] = 'Summary (introtext)';
+$_lang["resource_summary_help"] = 'Type a brief summary of the Resource';
+$_lang["resource_title"] = 'Title';
+$_lang["resource_title_help"] = 'Enter the name/title of the Resource. Avoid using backslashes in the name.';
+$_lang["resource_to_be_moved"] = 'Resource to be moved';
+$_lang["resource_type"] = 'Resource Type';
+$_lang["resource_type_message"] = 'Weblinks reference Resources on the Internet including another EVO Resource, an external page, or an image or other file on the Internet. Weblinks should have a text/html Internet Media Type and Inline Content-Disposition.';
+$_lang["resource_type_weblink"] = 'Weblink';
+$_lang["resource_type_webpage"] = 'Web page';
+$_lang["resource_weblink_help"] = 'Type the address of the object you wish to reference with this Weblink here. Alternatively insert from the File Browser or use the link selection icon and select a resource from the Site Tree.';
+$_lang["resources_in_container"] = 'Resources in this Container';
+$_lang["resources_in_container_no"] = 'This Container does not have child-Resources.';
+$_lang["role"] = 'Role';
+$_lang["role_about"] = 'View the about page';
+$_lang["role_access_persmissions"] = 'Access permissions';
+$_lang["role_actionok"] = 'View action completed screen';
+$_lang["role_assets_images"] = 'Manage assets/images';
+$_lang["role_assets_files"] = 'Manage assets/files';
+$_lang["role_bk_manager"] = 'Use the Backup Manager';
+$_lang["role_cache_refresh"] = 'Empty the site\'s cache';
+$_lang["role_category_manager"] = 'Use the Category Manager';
+$_lang["role_change_password"] = 'Change password';
+$_lang["role_change_resourcetype"] = 'Change Resource-Type';
+$_lang["role_chunk_management"] = 'Chunk management';
+$_lang["role_config_management"] = 'Configuration management';
+$_lang["role_content_management"] = 'Content management';
+$_lang["role_create_chunk"] = 'Create new Chunks';
+$_lang["role_create_doc"] = 'Create new Resources';
+$_lang["role_create_plugin"] = 'Create new Plugins';
+$_lang["role_create_snippet"] = 'Create new Snippets';
+$_lang["role_create_template"] = 'Create new site Templates';
+$_lang["role_credits"] = 'View credits';
+$_lang["role_delete_chunk"] = 'Delete Chunks';
+$_lang["role_delete_doc"] = 'Delete Resources';
+$_lang["role_delete_eventlog"] = 'Delete event log';
+$_lang["role_delete_module"] = 'Delete Module';
+$_lang["role_delete_plugin"] = 'Delete Plugins';
+$_lang["role_delete_role"] = 'Delete roles';
+$_lang["role_delete_snippet"] = 'Delete Snippets';
+$_lang["role_delete_template"] = 'Delete Templates';
+$_lang["role_delete_user"] = 'Delete manager users';
+$_lang["role_delete_web_user"] = 'Delete web users';
+$_lang["role_edit_chunk"] = 'Edit Chunks';
+$_lang["role_edit_doc"] = 'Edit a Resource';
+$_lang["role_edit_doc_metatags"] = 'Edit Resource META tags and keywords';
+$_lang["role_edit_module"] = 'Edit Module';
+$_lang["role_edit_plugin"] = 'Edit Plugins';
+$_lang["role_edit_role"] = 'Edit roles';
+$_lang["role_edit_settings"] = 'Change site settings';
+$_lang["role_edit_snippet"] = 'Edit Snippets';
+$_lang["role_edit_template"] = 'Edit site Templates';
+$_lang["role_edit_user"] = 'Edit manager users';
+$_lang["role_edit_web_user"] = 'Edit web users';
+$_lang["role_empty_trash"] = 'Permanently purge deleted Resources';
+$_lang["role_errors"] = 'View error dialog';
+$_lang["role_eventlog_management"] = 'Event log management';
+$_lang["role_export_static"] = 'Export Static HTML';
+$_lang["role_file_management"] = 'File Management';
+$_lang["role_file_manager"] = 'Use the file manager (full root access)';
+$_lang["role_frames"] = 'Request manager frames';
+$_lang["role_help"] = 'View help pages';
+$_lang["role_home"] = 'Request manager intro page';
+$_lang["role_import_static"] = 'Import HTML';
+$_lang["role_logout"] = 'Log out of the manager';
+$_lang["role_manage_metatags"] = 'Manage site META tags and keywords';
+$_lang["role_management_msg"] = 'Choose the role you wish to edit.';
+$_lang["role_management_title"] = 'Roles';
+$_lang["role_messages"] = 'View and send messages';
+$_lang["role_module_management"] = 'Module management';
+$_lang["role_name"] = 'Role name';
+$_lang["role_new_module"] = 'Create new Module';
+$_lang["role_new_role"] = 'Create new roles';
+$_lang["role_new_user"] = 'Create new manager users';
+$_lang["role_new_web_user"] = 'Create new web users';
+$_lang["role_plugin_management"] = 'Plugin management';
+$_lang["role_publish_doc"] = 'Publish Resources';
+$_lang["role_remove_locks"] = 'Remove Locks';
+$_lang["role_role_management"] = 'Roles';
+$_lang["role_run_module"] = 'Run Module';
+$_lang["role_save_chunk"] = 'Save Chunks';
+$_lang["role_save_doc"] = 'Save Resources';
+$_lang["role_save_module"] = 'Save Module';
+$_lang["role_save_password"] = 'Save password';
+$_lang["role_save_plugin"] = 'Save Plugins';
+$_lang["role_save_role"] = 'Save roles';
+$_lang["role_save_snippet"] = 'Save Snippets';
+$_lang["role_save_template"] = 'Save Templates';
+$_lang["role_save_user"] = 'Save manager users';
+$_lang["role_save_web_user"] = 'Save web users';
+$_lang["role_snippet_management"] = 'Snippet management';
+$_lang["role_template_management"] = 'Template management';
+$_lang["role_title"] = 'Create/edit role';
+$_lang["role_udperms"] = 'Permissions management';
+$_lang["role_user_management"] = 'Manager user management';
+$_lang["role_view_docdata"] = 'View a Resource\'s data';
+$_lang["role_view_eventlog"] = 'View event log';
+$_lang["role_view_logs"] = 'View system logs';
+$_lang["role_view_unpublished"] = 'View Unpublished Resources';
+$_lang["role_web_access_persmissions"] = 'Web access permissions';
+$_lang["role_web_user_management"] = 'Web user management';
+$_lang["rss_url_news_default"] = 'https://feeds.feedburner.com/evocms-release-news';
+$_lang["rss_url_news_message"] = 'Enter the URL for the EVO News Feed.';
+$_lang["rss_url_news_title"] = 'RSS News Feed';
+$_lang["rss_url_security_default"] = 'https://feeds.feedburner.com/evocms-security-news';
+$_lang["rss_url_security_message"] = 'Enter the URL for the EVO Security Feed.';
+$_lang["rss_url_security_title"] = 'RSS Security Feed';
+$_lang["run_module"] = 'Run Module';
+$_lang["saturday"] = 'Saturday';
+$_lang["save"] = 'Save';
+$_lang["save_all_changes"] = 'Save all changes';
+$_lang["save_tag"] = 'Save tag';
+$_lang["saving"] = 'Saving, please wait...';
+$_lang["search"] = 'Search';
+$_lang["search_criteria"] = 'Search criteria';
+$_lang["search_criteria_content"] = 'Search by content';
+$_lang["search_criteria_content_msg"] = 'Find all Resources with the entered text in their content.';
+$_lang["search_criteria_id"] = 'Search by ID';
+$_lang["search_criteria_id_msg"] = 'Enter a Resource\'s ID to quickly locate that Resource.';
+$_lang["search_criteria_top"] = 'Search in main fields';
+$_lang["search_criteria_top_msg"] = 'Pagetitle, Longtitle, Alias, ID';
+$_lang["search_criteria_template_id"] = 'Search by template ID';
+$_lang["search_criteria_template_id_msg"] = 'Find all Resources using the specified template.';
+$_lang["search_criteria_url_msg"] = 'Find Resource by exact URL.';
+$_lang["search_criteria_longtitle"] = 'Search by long title';
+$_lang["search_criteria_longtitle_msg"] = 'Find all Resources with the entered text in their long title.';
+$_lang["search_criteria_title"] = 'Search by title';
+$_lang["search_criteria_title_msg"] = 'Find all Resources with the entered text in their title.';
+$_lang["search_empty"] = 'Your search returned no results. Please broaden your search criteria and try again.';
+$_lang["search_item_deleted"] = 'This item has been deleted';
+$_lang["search_results"] = 'Search results';
+$_lang["search_results_returned_desc"] = 'Description';
+$_lang["search_results_returned_id"] = 'ID';
+$_lang["search_results_returned_msg"] = 'Your search criteria returned %s Resources. If a lot of results are being returned, try to enter a more specific search. The two left-most columns will allow you to find the Resource in the Site Tree or view the Resource. The two right most columns show, respectively, if a Resource has been deleted and what it\'s published status is.
';
+$_lang["search_results_returned_title"] = 'Title';
+$_lang["search_view_docdata"] = 'View this item';
+$_lang["security"] = 'Users';
+$_lang["security_notices_tab"] = 'Security Notices';
+$_lang["security_notices_title"] = 'Security Notices';
+$_lang["select_date"] = 'Select a date';
+$_lang["send"] = 'Send';
+$_lang["server_protocol_http"] = 'http';
+$_lang["server_protocol_https"] = 'https';
+$_lang["server_protocol_message"] = 'If your site is on a https connection, please specify so here.';
+$_lang["server_protocol_title"] = 'Server type';
+$_lang["serveroffset"] = 'Server offset';
+$_lang["serveroffset_message"] = 'Select the number of hours time difference between where you are and where the server is. Current time on server is [%s] , current time on server using the currently saved offset is [%s] .';
+$_lang["serveroffset_title"] = 'Server offset time';
+$_lang["servertime"] = 'Server Time';
+$_lang["set_automatic"] = 'Set automatic';
+$_lang["set_default"] = 'Set default';
+$_lang["set_default_all"] = 'Set defaults';
+$_lang["settings_after_install"] = 'As this is a new install, you are required to review these settings and change any that you wish to. After you have reviewed the settings, press \'Save\' to update the settings database.';
+$_lang["settings_config"] = 'Configuration';
+$_lang["settings_dependencies"] = 'Dependencies';
+$_lang["settings_events"] = 'System Events';
+$_lang["settings_furls"] = 'Friendly URLs';
+$_lang["settings_general"] = 'General';
+$_lang["settings_group_tv_message"] = 'Choose if Template Variables should be grouped in sections or tabs (named by TV category) when editing a Resource';
+$_lang["settings_group_tv_options"] = 'No,Sections in General tab,Tabs in General tab,Sections in new tab,Tabs in new tab,New tabs';
+$_lang["settings_misc"] = 'File Manager';
+$_lang["settings_security"] = 'Security';
+$_lang["settings_KC"] = 'File Browser';
+$_lang["settings_page_settings"] = 'Settings';
+$_lang["settings_photo"] = 'Photo';
+$_lang["settings_properties"] = 'Properties';
+$_lang["show_fullscreen_btn_message"] = 'Show Menu toggle Fullscreen button';
+$_lang["show_newresource_btn_message"] = 'Show Menu New Resource button';
+$_lang["settings_show_picker_message"] = 'Customize manager theme and save to localstorage';
+$_lang["show_fullscreen_btn"] = 'Toggle Fullscreen button';
+$_lang["show_newresource_btn"] = 'New Resource button';
+$_lang["settings_site"] = 'Site';
+$_lang["settings_strip_image_paths_message"] = 'If this is set to \'No\', EVO will write file browser src\'s (images, files, flash, etc.) as absolute URLs. Relative URLs are helpful should you wish to move your EVO install, e.g., from a staging site to a production site. If you have no idea what this means, it\'s best just to leave it set to \'Yes\'.';
+$_lang["settings_strip_image_paths_title"] = 'Rewrite browser paths?';
+$_lang["settings_templvars"] = 'Template Variables';
+$_lang["settings_title"] = 'System configuration';
+$_lang["settings_ui"] = 'Interface & Features';
+$_lang["settings_users"] = 'User';
+$_lang["show_meta"] = 'Show META Keywords tab';
+$_lang["show_meta_message"] = 'Show the deprecated META Keywords tab when editing Resources in the Manager.';
+$_lang["show_tree"] = 'Show Site Tree';
+$_lang["show_picker"] = 'Show Color Switcher';
+$_lang["showing"] = 'Showing';
+$_lang["signupemail_message"] = 'Set the email message sent to users when creating accounts including their username and password.Note: The following Placeholders are replaced by the Content Manager when the message is sent: [+sname+] - Name of your web site, [+saddr+] - Your web site email address, [+surl+] - Your site url, [+uid+] - User\'s Login name or id, [+pwd+] - User\'s password, [+ufn+] - User\'s full name. Leave the [+uid+] and [+pwd+] in the e-mail, or else the username and password won\'t be sent in the mail and your users won\'t know their username or password! ';
+$_lang["signupemail_title"] = 'Signup e-mail';
+$_lang["site"] = 'Site';
+$_lang["site_schedule"] = 'Schedule';
+$_lang["sitename_message"] = 'Enter the name of your site here.';
+$_lang["sitename_title"] = 'Site name';
+$_lang["sitestart_message"] = 'Enter the ID of the Resource you want to use as homepage here. NOTE: make sure this ID you enter belongs to an existing Resource, and that it has been published! ';
+$_lang["sitestart_title"] = 'Site start';
+$_lang["sitestatus_message"] = 'Select \'Online\' to publish your site on the web. If you select \'Offline\', your visitors will see the \'Site unavailable message\', and won\'t be able to browse the site.';
+$_lang["sitestatus_title"] = 'Site status';
+$_lang["siteunavailable_message"] = 'Message to show when the site is offline or if an error occurs. Note: This message will only be displayed if the Site unavailable page option is not set. ';
+$_lang["siteunavailable_message_default"] = 'The site is currently unavailable.';
+$_lang["siteunavailable_page_message"] = 'Enter the ID of the Resource you want to use as an offline page here. NOTE: make sure this ID you enter belongs to an existing Resource, and that it has been published! ';
+$_lang["siteunavailable_page_title"] = 'Site unavailable page';
+$_lang["siteunavailable_title"] = 'Site unavailable message';
+$_lang["snippet"] = 'Snippet';
+$_lang["snippets"] = 'Snippets';
+$_lang["snippet_code"] = 'Snippet code (php)';
+$_lang["snippet_desc"] = 'Description';
+$_lang["snippet_execonsave"] = 'Execute Snippet after saving.';
+$_lang["snippet_management_msg"] = 'Choose the Snippet you wish to edit.';
+$_lang["snippet_msg"] = 'Add/edit Snippets. Remember, Snippets are \'raw\' PHP code, and if you expect the output of the Snippet to be shown at a certain point within the Template, you need to return a value from within the Snippet.';
+$_lang["snippet_name"] = 'Snippet name';
+$_lang["snippet_properties"] = 'Default Properties';
+$_lang["snippet_title"] = 'Create/edit Snippet';
+$_lang["sort_alphabetically"] = 'Sort alphabetically';
+$_lang["sort_asc"] = 'Ascending';
+$_lang["sort_desc"] = 'Descending';
+$_lang["sort_menuindex"] = 'Sort menu index';
+$_lang["sort_tree"] = 'Sort the Site Tree';
+$_lang['sort_updating'] = 'Updating ...';
+$_lang['sort_updated'] = 'Updated!';
+$_lang['sort_nochildren'] = 'Parent does not have any children';
+$_lang["sort_elements_msg"] = 'Drag to reorder the listed elements.';
+$_lang["source"] = 'Source';
+$_lang["stay"] = 'Continue editing';
+$_lang["stay_new"] = 'Add another';
+$_lang["submit"] = 'Submit';
+$_lang["sunday"] = 'Sunday';
+$_lang["sys_alert"] = 'System Alert';
+$_lang["sysinfo_activity_message"] = 'This list show which Resources have been recently edited by your users.';
+$_lang["sysinfo_userid"] = 'User';
+$_lang["system"] = 'System';
+$_lang["system_email_signup"] = '
+
+Hello [+uid+]
+
+Here are your login details for [+sname+] Content Manager:
+
+Username: [+uid+]
+Password: [+pwd+]
+
+Once you log into the Content Manager ([+surl+]), you can change your password.
+
+Regards,
+Site Administrator
+';
+$_lang["system_email_webreminder"] = 'Hello [+uid+]
+
+To activate your new password click the following link:
+
+[+surl+]
+
+If successful you can use the following password to login:
+
+Password:[+pwd+]
+
+If you did not request this email then please ignore it.
+
+Regards,
+Site Administrator';
+$_lang["system_email_websignup"] = 'Hello [+uid+]
+
+Here are your login details for [+sname+]:
+
+Username: [+uid+]
+Password: [+pwd+]
+
+Once you log into [+sname+] ([+surl+]), you can change your password.
+
+Regards,
+Site Administrator';
+$_lang["table_hoverinfo"] = 'Hover the mouse cursor over a table\'s name to see a short description of the table\'s function (not all tables have comments set).';
+$_lang["table_prefix"] = 'Table prefix';
+$_lang["tag"] = 'Tag';
+$_lang["template"] = 'Template';
+$_lang["templates"] = 'Templates';
+$_lang["template_assignedtv_tab"] = 'Assigned Template Variables';
+$_lang["template_code"] = 'Template code (html)';
+$_lang["template_desc"] = 'Description';
+$_lang["template_edit_tab"] = 'Edit Template';
+$_lang["template_management_msg"] = 'Choose which Template you wish to edit.';
+$_lang["template_msg"] = 'Create and edit Templates. Changed or new Templates won\'t be visible in your site\'s cached pages until the cache is emptied, however, you can use the preview function on a page to see the Template in action.';
+$_lang["template_name"] = 'Template name';
+$_lang["template_no_tv"] = 'No Template Variables have been assigned to this Template yet.';
+$_lang["template_notassigned_tv"] = 'These Template Variables are available for assigning.';
+$_lang["template_reset_all"] = 'Reset all pages to use Default Template';
+$_lang["template_reset_specific"] = 'Reset only \'%s\' pages';
+$_lang["template_selectable"] = 'Template selectable when creating or editing ressources.';
+$_lang["template_title"] = 'Create/edit Template';
+$_lang["template_tv_edit"] = 'Edit the TV sort order';
+$_lang["template_tv_edit_message"] = 'Drag to reorder the Template Variables for this template.';
+$_lang["template_tv_edit_title"] = 'Template Variable Sort Order';
+$_lang["template_tv_msg"] = 'The Template Variables assigned to this Template are listed below.';
+$_lang["thursday"] = 'Thursday';
+$_lang["tmplvar_access_msg"] = 'Select the Resource Groups that are allowed to modify the content or value of this Template Variable';
+$_lang["tmplvar_change_template_msg"] = 'Changing this Template will cause the page to reload the Template Variables, losing any unsaved changes.\n\n Are you sure you want to change this Template?';
+$_lang["tmplvar_inuse"] = 'The following Resource(s) are currently using this Template Variable. To continue with the delete operation click the Delete button otherwise click the Cancel button.';
+$_lang["tmplvar_tmpl_access"] = 'Template Access';
+$_lang["tmplvar_tmpl_access_msg"] = 'Select the Templates that are allowed to access/process this Template Variable';
+$_lang["tmplvar"] = 'Template Variable';
+$_lang["tmplvars"] = 'Template Variables';
+$_lang["tmplvars_binding_msg"] = 'This field supports data source bindings using the @ commands';
+$_lang["tmplvars_caption"] = 'Caption';
+$_lang["tmplvars_default"] = 'Default Value';
+$_lang["tmplvars_description"] = 'Description';
+$_lang["tmplvars_elements"] = 'Input Option Values';
+$_lang["tmplvars_inherited"] = 'Value inherited';
+$_lang["tmplvars_management_msg"] = 'Manage additional Template Variables for your Resources.';
+$_lang["tmplvars_msg"] = 'Add or edit Template Variables here. Template Variables must be assigned to Templates in order to access them from Snippets and Resources.';
+$_lang["tmplvars_name"] = 'Template Variable Name';
+$_lang["tmplvars_novars"] = 'No Template Variables found';
+$_lang["tmplvars_rank"] = 'Sort Order';
+$_lang["tmplvars_rank_edit_message"] = 'Drag to reorder the Template Variables.';
+$_lang["tmplvars_reset_params"] = 'Reset parameters';
+$_lang["tmplvars_title"] = 'Create/edit Template Variable';
+$_lang["tmplvars_type"] = 'Input Type';
+$_lang["tmplvars_widget"] = 'Widget';
+$_lang["tmplvars_widget_prop"] = 'Widget Properties';
+$_lang["to"] = 'to';
+$_lang["toggle_fullscreen"] = 'Toggle Fullscreen';
+$_lang["tools"] = 'Tools';
+$_lang["top_howmany_message"] = 'When viewing reports, how large should the \'Top ...\' lists be?';
+$_lang["top_howmany_title"] = 'Top how many';
+$_lang["total"] = 'total';
+$_lang["track_visitors_message"] = 'Check to show the child resources in the document tree';
+$_lang["track_visitors_title"] = 'Show child resources';
+$_lang["tree_page_click"] = 'Page Click Behavior';
+$_lang["tree_page_click_message"] = 'The default behavior when clicking on a page in the site tree.';
+$_lang["use_breadcrumbs"] = 'Show navigation';
+$_lang["use_breadcrumbs_message"] = 'Show the navigation when creating or editing Resource in the Manager';
+$_lang["tree_show_protected"] = 'Show protected pages';
+$_lang["tree_show_protected_message"] = 'When set to "No", Protected Resources (and all their child-Resources) do not appear in the Site Tree menu. "No" is the legacy setting for EVO.';
+$_lang["truncate_table"] = 'Click here to truncate this table';
+$_lang["tuesday"] = 'Tuesday';
+$_lang["tv"] = 'TV';
+$_lang["type"] = 'Type';
+$_lang["udperms_allowroot_message"] = 'Allow Users to create new Resources in the site root. ';
+$_lang["udperms_allowroot_title"] = 'Allow root';
+$_lang["udperms_message"] = 'Control access to Resources via User Groups and Resource Groups.';
+$_lang["udperms_title"] = 'Use access permissions';
+$_lang["unable_set_link"] = 'Unable to set the link!';
+$_lang["unable_set_parent"] = 'Unable to set new parent!';
+$_lang["unauthorizedpage_message"] = 'Enter a published and publicly accessible Resource ID to redirect Users to when requesting a secured/unauthorized Resource.';
+$_lang["unauthorizedpage_title"] = 'Unauthorized page';
+$_lang["unblock_message"] = 'This User will not be blocked after saving the User\'s data.';
+$_lang["undelete_resource"] = 'Undelete Resource';
+$_lang["unpublish_date"] = 'Unpublish Date';
+$_lang["unpublish_events"] = 'Un-publish Events';
+$_lang["unpublish_resource"] = 'Un-publish Resource';
+$_lang["untitled_resource"] = 'Untitled Resource';
+$_lang["untitled_weblink"] = 'Untitled Weblink';
+$_lang["update_params"] = 'Update parameter display';
+$_lang["update_settings_from_language"] = 'Replace current with:';
+$_lang["upload_maxsize_message"] = 'Enter the maximum file size that can be uploaded via the file manager. Upload file size must be entered in bytes. NOTE: Large files can take a very long time to upload! ';
+$_lang["upload_maxsize_title"] = 'Maximum upload size';
+$_lang["uploadable_files_message"] = 'Enter a list of files that can be uploaded into \'assets/files/\' using the File Browser. Please enter the extensions for the filetypes, separated by commas.';
+$_lang["uploadable_files_title"] = 'Uploadable File Types';
+$_lang["uploadable_flash_message"] = 'Enter a list of files that can be uploaded into \'assets/flash/\' using the File Browser. Please enter the extensions for the flash types, separated by commas.';
+$_lang["uploadable_flash_title"] = 'Uploadable Flash Types';
+$_lang["uploadable_images_message"] = 'Enter a list of files that can be uploaded into \'assets/images/\' using the File Browser. Please enter the extensions for the image types, separated by commas.';
+$_lang["uploadable_images_title"] = 'Uploadable Image Types';
+$_lang["uploadable_media_message"] = 'Enter a list of files that can be uploaded into \'assets/media/\' using the File Browser. Please enter the extensions for the media types, separated by commas.';
+$_lang["uploadable_media_title"] = 'Uploadable Media Types';
+$_lang["use_alias_path_message"] = 'Enabling this option generates a virtual path to the Resource. E.g., if a Resource "child.html" is located in a Container Resource "parent", then the full URL alias path URL will be "/parent/child.html".';
+$_lang["use_alias_path_title"] = 'Use Friendly URL alias path';
+$_lang["use_editor_message"] = 'Enable editing with a Rich Text Editor (RTE). This setting applies to all Resources, but can be overridden in the User settings.';
+$_lang["use_editor_title"] = 'Enable editor';
+$_lang["use_global_tabs"] = 'Use global Tabs';
+$_lang["user"] = 'User';
+$_lang["user_block"] = 'Blocked';
+$_lang["user_blockedafter"] = 'Blocked After';
+$_lang["user_blockeduntil"] = 'Blocked Until';
+$_lang["user_changeddata"] = 'Your data has been changed. Please log in again.';
+$_lang["user_country"] = 'Country';
+$_lang["user_dob"] = 'Date of birth';
+$_lang["user_doesnt_exist"] = 'User does not exist';
+$_lang["user_edit_self_msg"] = 'You may need to log out and log in again after saving to fully update your information. New passwords will be sent to your e-mail address or shown onscreen.';
+$_lang["user_email"] = 'E-mail address';
+$_lang["user_failedlogincount"] = 'Failed logins';
+$_lang["user_fax"] = 'Fax';
+$_lang["user_female"] = 'Female';
+$_lang["user_full_name"] = 'Full name';
+$_lang["user_gender"] = 'Gender';
+$_lang["user_is_blocked"] = 'This User is blocked!';
+$_lang["user_logincount"] = 'Login count';
+$_lang["user_male"] = 'Male';
+$_lang["user_management_msg"] = 'Choose the Content Manager to edit. Content Manager Users are those Users who are allowed to log into the Content Manager';
+$_lang["user_management_title"] = 'Manager Users';
+$_lang["user_mobile"] = 'Mobile phone number';
+$_lang["user_phone"] = 'Phone number';
+$_lang["user_photo"] = 'User Photo';
+$_lang["user_photo_message"] = 'Enter the image url for the this User or use the insert button to selected or upload an image file on the server.';
+$_lang["user_prevlogin"] = 'Last login';
+$_lang["user_role"] = 'User\'s role';
+$_lang["user_state"] = 'State';
+$_lang["user_title"] = 'Create/Edit Manager User';
+$_lang["user_upload_message"] = ' If you wish to stop this User uploading any filetypes in this category, make sure that the \'Use Main Configuration Setting\' checkbox is not ticked and leave the field blank.';
+$_lang["user_use_config"] = 'Use System Configuration Setting';
+$_lang["user_verification"] = 'User is verified';
+$_lang["user_zip"] = 'Zip';
+$_lang["username"] = 'Username';
+$_lang["users"] = 'Users';
+$_lang["valid_hostnames_message"] = 'Help prevent XSS exploits misusing the site_url system setting by providing a comma separated list of valid hostnames for this installation. This is important for some types of shared hosts or hosts direct accessible via an IP address. First hostname in the list is used if the HTTP_HOST does not match any valid hostname.';
+$_lang["valid_hostnames_title"] = 'Valid hostnames';
+$_lang["validate_referer_message"] = 'Validate the HTTP_REFERER headers to reduce the risk of your content editors being tricked into performing unintended actions in the manager as victims of a CSRF (Cross Site Request Forgery) attack. Some configurations may not be able to use this option if the server is not sending HTTP_REFERER headers.';
+$_lang["validate_referer_title"] = 'Validate HTTP_REFERER headers?';
+$_lang["value"] = 'Value';
+$_lang["version"] = 'Version';
+$_lang["view"] = 'View';
+$_lang["view_child_resources_in_container"] = 'View children';
+$_lang["view_log"] = 'View log';
+$_lang["view_logging"] = 'Manager Actions';
+$_lang["view_sysinfo"] = 'System Info';
+$_lang["warning"] = 'Warning!';
+$_lang["warning_not_saved"] = 'The changes you have made have not been saved yet. You can choose to stay on the current page in order to save the changes (\'Cancel\'), or you can leave this page, losing any changes you have made (\'OK\').';
+$_lang["warning_visibility"] = 'Configuration Warnings visible to';
+$_lang["warning_visibility_message"] = 'Control the visibility of the configuration warnings shown on the Manager welcome page';
+$_lang["web_access_permissions"] = 'Web access permissions';
+$_lang["web_access_permissions_user_groups"] = 'Web User groups';
+$_lang["web_permissions"] = 'Web Permissions';
+$_lang["web_user_management_msg"] = 'Choose the web User you wish to edit. Web Users are those Users who are only allowed to log into the web site';
+$_lang["web_user_management_title"] = 'Web Users';
+$_lang["web_user_title"] = 'Create/edit Web User';
+$_lang["web_users"] = 'Web Users';
+$_lang["weblink"] = 'Weblink';
+$_lang["webpwdreminder_message"] = 'Enter a message to be sent to your Web Users whenever they request a new password via email. The Content Manager will send an e-mail containing their new password and activation information. Note: The following Placeholders are replaced by the Content Manager when the message is sent: [+sname+] - Name of your web site, [+saddr+] - Your web site email address, [+surl+] - Your site url, [+uid+] - User\'s Login name or id, [+pwd+] - User\'s password, [+ufn+] - User\'s full name. Leave the [+uid+] and [+pwd+] in the e-mail, or else the username and password won\'t be sent in the mail and your Users won\'t know their username or password! ';
+$_lang["webpwdreminder_title"] = 'Web Reminder Email';
+$_lang["websignupemail_message"] = 'Set the email message sent to Users when creating accounts including their username and passwordNote: The following Placeholders are replaced by the Content Manager when the message is sent: [+sname+] - Name of your web site, [+saddr+] - Your web site email address, [+surl+] - Your site url, [+uid+] - User\'s Login name or id, [+pwd+] - User\'s password, [+ufn+] - User\'s full name. Leave the [+uid+] and [+pwd+] in the e-mail, or else the username and password won\'t be sent in the mail and your Users won\'t know their username or password! ';
+$_lang["websignupemail_title"] = 'Web Signup e-mail';
+$_lang["allow_multiple_emails_title"] = 'Duplicate Web User email address';
+$_lang["allow_multiple_emails_message"] = 'Allows Web Users to share the same email address for situations when a member may not have their own email address or there is just one family email address. Note: Any password reminder and registration logic will need to account for this option if set to yes.';
+$_lang["wednesday"] = 'Wednesday';
+$_lang["welcome_messages"] = 'Your Inbox contains %d message(s), of which %s are unread.';
+$_lang["welcome_title"] = 'Welcome to your EVO Content Manager';
+$_lang["which_editor_message"] = 'Select the rich text editor (RTE). You can download and install additional RTEs from the EVO download page.';
+$_lang["which_editor_title"] = 'Editor to use';
+$_lang["working"] = 'Working...';
+$_lang["wrap_lines"] = 'Wrap lines';
+$_lang["xhtml_urls_message"] = 'Replaces ampersand (&) characters in urls that are generated by EVO with the validating & htmlentity';
+$_lang["xhtml_urls_title"] = 'XHTML URLs';
+$_lang["yes"] = 'Yes';
+$_lang["you_got_mail"] = 'You got mail';
+$_lang["yourinfo_message"] = 'This section shows some information about you:';
+$_lang["yourinfo_previous_login"] = 'Your last login:';
+$_lang["yourinfo_role"] = 'Your role is:';
+$_lang["yourinfo_title"] = 'Your info';
+$_lang["yourinfo_total_logins"] = 'Total number of logins:';
+$_lang["yourinfo_username"] = 'You are logged in as:';
+
+$_lang["a17_error_reporting_title"] = 'Detection level of PHP errors';
+$_lang["a17_error_reporting_msg"] = 'Set the detection level of the PHP errors.';
+$_lang["a17_error_reporting_opt0"] = 'Ignore all';
+$_lang["a17_error_reporting_opt1"] = 'Ignore warnings of a slight notice level (E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT )';
+$_lang["a17_error_reporting_opt2"] = 'Detect all errors except E_NOTICE';
+$_lang["a17_error_reporting_opt99"] = 'Detect all';
+
+$_lang["pwd_hash_algo_title"] = 'Hash algorithm';
+$_lang["pwd_hash_algo_message"] = 'Password hash algorithm.';
+
+$_lang["enable_bindings_title"] = 'Enable @Bindings commands';
+$_lang["enable_bindings_message"] = 'Prevents the execution of PHP functions through TV @Bindings. Useful if you have Manager users who should not be able to create PHP code but need to be able to create or edit TVs. The output of any TV with an @Binding will be "@Bindings disabled".';
+$_lang["enable_filter_title"] = 'Enable filters';
+$_lang["enable_filter_message"] = 'Filters allow you to manipulate the way data is presented or parsed in a tag. They allow you to modify values from inside your templates. This is analogous to PHx. More info '; // todo: change link to documentation
+$_lang["enable_filter_phx_warning"] = 'When PHx plugin enabled, built-in filters are disabled by default';
+
+$_lang["enable_at_syntax_title"] = 'Enable <@SYNTAX>';
+$_lang["enable_at_syntax_message"] = '<@SYNTAX>(atmark syntax) is simple and lightweight template syntax. This is designed to consider coexistence with HTML tags and content strings.';
+
+$_lang["bkmgr_alert_mkdir"] = 'A file cannot be created in a directory. Please check the permission of [+snapshot_path+]';
+$_lang["bkmgr_restore_msg"] = 'Database tables could be restored by SQL:
';
+$_lang["bkmgr_restore_title"] = 'Restore';
+$_lang["bkmgr_import_ok"] = 'SQL recovery was performed normally.';
+$_lang["bkmgr_snapshot_ok"] = 'The snapshot was saved normally.';
+$_lang["bkmgr_run_sql_file_label"] = 'Execute by SQL file';
+$_lang["bkmgr_run_sql_direct_label"] = 'Direct execute SQL commands';
+$_lang["bkmgr_run_sql_submit"] = 'Execute restore';
+$_lang["bkmgr_run_sql_result"] = 'Result';
+$_lang["bkmgr_snapshot_title"] = 'Snapshot save and recovery';
+$_lang["bkmgr_snapshot_msg"] = 'The contents of the database are saved in and restored from a server directory. Location: [+snapshot_path+] ($modx->config[\'snapshot_path\'])
';
+$_lang["bkmgr_snapshot_submit"] = 'Add Snapshot';
+$_lang["bkmgr_snapshot_list_title"] = 'List of snapshots';
+$_lang["bkmgr_restore_submit"] = 'Revert this data';
+$_lang["bkmgr_restore_confirm"] = 'Are you sure you want to revert backup\n[+filename+] ?';
+$_lang["bkmgr_snapshot_nothing"] = 'No snapshots available';
+
+$_lang["files.dynamic.php1"] = 'New File';
+$_lang["files.dynamic.php2"] = 'This directory cannot be displayed.';
+$_lang["files.dynamic.php3"] = 'There is a problem in a file name.';
+$_lang["files.dynamic.php4"] = 'The text file was created.';
+$_lang["files.dynamic.php5"] = 'File could not be duplicated.';
+$_lang["files.dynamic.php6"] = 'File or directory could not be renamed.';
+$_lang["files_dynamic_new_folder_name"] = 'Enter new directory name:';
+$_lang["files_dynamic_new_file_name"] = 'Enter new file name:';
+$_lang["not_readable_dir"] = 'Can not read this directory.';
+$_lang["confirm_delete_dir"] = 'Are you sure you want to delete the directory?';
+$_lang["confirm_delete_dir_recursive"] = 'Are you sure you want to delete this directory?\n\nAll files inside this directory will also be deleted.';
+
+$_lang["make_folders_title"] = 'End Container URL with Slash';
+$_lang["make_folders_message"] = 'Append trailing slash to Resources that are set as containers when using Friendly URLs.';
+
+$_lang["check_files_onlogin_title"] = 'Check core files on login';
+$_lang["check_files_onlogin_message"] = 'By enabling this option, important system files will be checked for modification typical of scripted website attacks. While not a foolproof guarantee, it may alert you to a compromised EVO system file and website.';
+
+$_lang["configcheck_sysfiles_mod"] = 'Important System Files have been modified.';
+$_lang["configcheck_sysfiles_mod_msg"] = 'You have configured EVO to check important system files for possible website script attacks. This warning does not necessarily mean your site has been compromised, however, you should review the watched files in your installation (set in System configuration -> User -> Check core files on login). If you find your files unaltered or changes were made by site administrators, go to System Configuration and click to re-save settings to dismiss this message. Changes in the following files have been found:';
+
+$_lang['email_method_title'] = 'Sendmail method';
+$_lang['email_method_mail'] = 'PHP mail() function';
+$_lang['email_method_smtp'] = 'SMTP Server';
+$_lang['smtp_auth_title'] = 'SMTP-AUTH';
+$_lang['smtp_host_title'] = 'SMTP host';
+$_lang['smtp_secure_title'] = 'Encrypted SMTP';
+$_lang['smtp_username_title'] = 'SMTP username';
+$_lang['smtp_password_title'] = 'SMTP password';
+$_lang['smtp_port_title'] = 'SMTP port';
+
+$_lang["setting_resource_tree_node_name"] = 'Display Name in Resource Tree';
+$_lang["setting_resource_tree_node_name_desc"] = 'Select the Resource field to show as the Resource name in the Resource Tree. The default setting is pagetitle.';
+$_lang["setting_resource_tree_node_name_desc_add"] = 'Note: Since EVO 1.1 you can change this Display Name within Resource-Tree´s sorting option. This setting is used when Display Name in Resource Tree is set to "Default".';
+
+$_lang["resource_opt_alvisibled"] = 'Use current alias in alias path';
+$_lang["resource_opt_alvisibled_help"] = 'The alias of this Resource is inserted in Friendly URL alias path';
+$_lang['resource_opt_is_published'] = 'Published';
+$_lang["docid_incrmnt_method_title"] = 'Increment Resource ID method';
+$_lang["docid_incrmnt_method_0"] = 'DB auto increment';
+$_lang["docid_incrmnt_method_1"] = 'Minimum missed ID';
+$_lang["docid_incrmnt_method_2"] = 'Maximal ID + 1';
+
+$_lang["enable_cache_title"] = 'Document caching';
+$_lang["disable_chunk_cache_title"] = 'Disable chunk caching';
+$_lang["disable_snippet_cache_title"] = 'Disable snippet caching';
+$_lang["disable_plugins_cache_title"] = 'Disable plugins caching';
+$_lang["disabled_at_login"] = 'Disabled at login';
+
+$_lang["cache_type_title"] = 'Document caching type';
+$_lang["cache_type_1"] = 'Cache is based only on Resource ID (standard)';
+$_lang["cache_type_2"] = 'Cache is based on Resource ID and $_GET parameters';
+$_lang["seostrict_title"] = 'Use SEO Strict URLs';
+$_lang["seostrict_message"] = 'Enforces the use of strict URLs to prevent duplicate content (if needed)';
+$_lang["aliaslistingfolder_title"] = 'Use AliasListing only for Folders';
+$_lang["full_aliaslisting_title"] = 'Disable AliasListing for all resources';
+$_lang["aliaslistingfolder_message"] = 'Reduces memory consumption when a large number of resources';
+
+$_lang["settings_friendlyurls_alert"] = 'It is necessary to rename the ht.access file in the EVO installation directory at .htaccess to use the Friendly URL function.';
+$_lang["settings_friendlyurls_alert2"] = 'Since EVO was installed in a subdirectory, it is necessary to change the content of .htaccess.';
+
+$_lang["user_street"] = 'Street';
+$_lang["user_city"] = 'City';
+$_lang["user_other"] = 'Other';
+
+$_lang["import_site.static.php1"] = 'Reset resource tree';
+$_lang["import_site.static.php2"] = 'Reset resource tree and initialize all Resource IDs.';
+$_lang["import_site.static.php3"] = 'Target';
+$_lang["import_site.static.php4"] = 'Only <body></body> part';
+$_lang["import_site.static.php5"] = 'Whole file content';
+
+$_lang["a83_ignore_ids_title"] = 'Ignore IDs (comma separated)';
+$_lang["export_site.static.php1"] = 'Target';
+$_lang["export_site.static.php2"] = 'Only edited Resources';
+$_lang["export_site.static.php3"] = 'All Resources';
+$_lang["export_site.static.php4"] = 'Search for';
+$_lang["export_site.static.php5"] = 'Replace with';
+$_lang["export_site.static.php6"] = 'Target';
+$_lang["export_site.static.php7"] = 'Files could not be saved to [+rb_base_url+]';
+
+$_lang["mutate_settings.dynamic.php6"] = 'Send mail on EVO errors';
+$_lang["mutate_settings.dynamic.php7"] = 'not notify';
+$_lang["mutate_settings.dynamic.php8"] = 'A mail with the error source will be sent to [(emailsender)] ([+emailsender+]) if a EVO error occurs. The details of the error could be seen in the EVO system events log.';
+
+$_lang["error_no_privileges"] = "You don't have enough privileges for this action!";
+$_lang["error_no_optimise_tablename"] = "Table to optimise not found in request!";
+$_lang["error_no_truncate_tablename"] = "Table to truncate not found in request!";
+$_lang["error_double_action"] = "Double action (GET & POST) posted!";
+$_lang["error_no_id"] = "ID not passed in request!";
+$_lang["error_id_nan"] = "ID passed in request is NaN!";
+$_lang["error_no_parent"] = "Couldn't find parent document's name!";
+$_lang["error_parent_deleted"] = "Failed because resource parent is deleted!";
+$_lang["error_many_results"] = "Too many results returned from database!";
+$_lang["error_no_results"] = "Not enough/ no results returned from database!";
+$_lang["error_no_user_selected"] = "No user selected as recipient of this message!";
+$_lang["error_no_group_selected"] = "No group selected as recipient of this message!";
+$_lang["error_movedocument1"] = "Document cannot be it's own parent!";
+$_lang["error_movedocument2"] = "Document's ID not passed in request!";
+$_lang["error_movedocument3"] = "New parent not set in request!";
+$_lang["error_internet_connection"] = "Server isn't available. Check your internet connection!";
+
+$_lang["login_processor_unknown_user"] = "Incorrect username or password entered!";
+$_lang["login_processor_wrong_password"] = "Incorrect username or password entered!";
+$_lang["login_processor_many_failed_logins"] = "Due to too many failed logins, you have been blocked!";
+$_lang["login_processor_blocked1"] = "You are blocked and cannot log in!";
+$_lang["login_processor_blocked2"] = "You are blocked and cannot log in! Please try again later.";
+$_lang["login_processor_blocked3"] = "You are blocked automatic after a specified date and you cannot log in anymore!";
+$_lang["login_processor_bad_code"] = "The security code you entered didn't validate! Please try to login again!";
+$_lang["login_processor_remotehost_ip"] = "Your hostname doesn't point back to your IP!";
+$_lang["login_processor_remote_ip"] = "You are not allowed to login from this location.";
+$_lang["login_processor_date"] = "You are not allowed to login at this time. Please try again later.";
+$_lang["login_processor_captcha_config"] = "Captcha is not configured properly.";
+
+$_lang["dp_dayNames"] = "['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']";
+$_lang["dp_monthNames"] = "['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']";
+$_lang["dp_startDay"] = "1";
+
+$_lang["check_all"] = "Select all";
+$_lang["check_none"] = "Select none";
+$_lang["check_toggle"] = "Toggle selection";
+
+$_lang["version_notices"] = "Version Notices";
+
+$_lang["em_button_shift"] = " (Shift-Mouseclick to open multiple windows)";
+
+$_lang["reset_sysfiles_checksum_button"] = "Rebuild Checksums";
+$_lang["reset_sysfiles_checksum_alert"] = "Are you sure you want to reset the system files checksums?";
+
+$_lang["file_browser_disabled_msg"] = "The File Browser Feature is not enabled.";
+$_lang["which_browser_default_title"]= "Default File Browser";
+$_lang["which_browser_default_msg"]= "Choose the File Browser you prefer as default. In User-Settings you can choose a Custom Browser per User, or leave it on "default".";
+$_lang["which_browser_title"]= "File Browser";
+$_lang["which_browser_msg"]= "You can choose a custom File Browser for this user. To use the System´s default Browser, leave it on "Default".";
+$_lang["option_default"] = "Default";
+$_lang["position"] = "Position";
+$_lang["are_you_sure"] = "Are you sure?";
+
+$_lang['evo_downloads_title'] = "Evolution Downloads";
+$_lang['help_translating_title'] = "Help translating Evolution";
+$_lang['download'] = "Download";
+$_lang['downloads'] = "Downloads";
+$_lang["previous_releases"] = "Previous Releases";
+$_lang["extras"] = "Extras";
+
+$_lang["display_locks"] = "Display Locks";
+$_lang["role_display_locks"] = "Display Locks";
+$_lang["session_timeout"] = "Session Timeout";
+$_lang["session_timeout_msg"] = "EVO will ping the server as per setting "Mail Check Time Period". If the last ping exceeds this setting, the associated session will be considered invalid and all related locks will be removed automatically. Set value in minutes (>2min, default 15min).";
+$_lang["unlock_element_id_warning"] = "Are you sure you want to unlock this [+element_type+] (ID [+id+])?";
+$_lang["lock_element_type_1"] = "Template";
+$_lang["lock_element_type_2"] = "Template-Variable";
+$_lang["lock_element_type_3"] = "Chunk";
+$_lang["lock_element_type_4"] = "Snippet";
+$_lang["lock_element_type_5"] = "Plugin";
+$_lang["lock_element_type_6"] = "Module";
+$_lang["lock_element_type_7"] = "Resource";
+$_lang["lock_element_type_8"] = "Role";
+$_lang["lock_element_editing"] = "You are editing this [+element_type+] since\n[+lasthit_df+]";
+$_lang["lock_element_locked_by"] = "This [+element_type+] is locked by user\n[+username+] since [+lasthit_df+]";
+
+$_lang["minifyphp_incache_title"] = 'Minify php code in site cache';
+$_lang["minifyphp_incache_message"] = 'Minify php code (snippets and plugins) and store in the site cache file, ref:#938 ';
+
+$_lang["logout_reminder_msg"] = "Reminder: It seems on [+date+] you forgot to logout. Please pay attention in future to do so after your work is finished.";
+
+$_lang["allow_eval_title"] = "Eval php code in snippet call";
+$_lang["allow_eval_msg"] = "For developer : Please use \$modx->safeEval().";
+$_lang["allow_eval_with_scan"] = "Execute only permitted functions";
+$_lang["allow_eval_with_scan_at_post"] = "Execute all. However, at POST, only permitted functions";
+$_lang["allow_eval_everytime_eval"] = "Unlimited (Use only for debugging)";
+$_lang["allow_eval_dont_eval"] = "Do not allow all functions";
+
+$_lang["safe_functions_at_eval_title"] = "Functions to allow eval";
+$_lang["safe_functions_at_eval_msg"] = "Comma separated list";
+
+$_lang["multiple_sessions_msg"] = "Information: Multiple active user sessions (total [+total+]) found for user [+username+] .";
+$_lang["iconv_not_available"] = "It is important to install/enable extension iconv. Please speak to your host if you don´t know how to enable it.";
+
+$_lang["cm_create_new_category"] = "Create the new category";
+$_lang["cm_category_name"] = "Category name";
+$_lang["cm_category_position"] = "Category position";
+$_lang["cm_no_x_assigned"] = "No %s assigned";
+$_lang["cm_save_categorization"] = "Save categorization";
+$_lang["cm_update_categories"] = "Update categories";
+$_lang["cm_assigned_elements"] = "Assigned elements";
+$_lang["cm_edit_name"] = "Edit name";
+$_lang["cm_mark_for_deletion"] = "Mark for deletion";
+$_lang["cm_delete_now"] = "Delete immediately";
+$_lang["cm_delete_element_x_now"] = "Delete "%s" immediately";
+$_lang["cm_select_element_group"] = "Select an element group";
+$_lang["cm_global_messages"] = "Global Messages";
+$_lang["cm_add_new_category"] = "Add a new category";
+$_lang["cm_edit_categories"] = "Edit categories";
+$_lang["cm_sort_categories"] = "Sort categories";
+$_lang["cm_categorize_elements"] = "Categorize elements";
+$_lang["cm_translation"] = "Translation";
+$_lang["cm_translations"] = "Translations";
+$_lang["cm_categorize_x"] = "Categorize %s ";
+$_lang["cm_unknown_error"] = "Something went wrong.";
+$_lang["cm_x_assigned_to_category_y"] = "%s(%s) has been assigned to category %s(%s) ";
+$_lang["cm_no_categorization"] = "No categorization made.";
+$_lang["cm_no_changes"] = "Nothing to change, so no changes made.";
+$_lang["cm_x_changes_made"] = "%s changes made";
+$_lang["cm_enter_name_for_category"] = "Please enter a name for the new category.";
+$_lang["cm_category_x_exists"] = "Category %s already exists.";
+$_lang["cm_category_x_saved_at_position_y"] = "The new category %s was saved at position %s .";
+$_lang["cm_category_x_moved_to_position_y"] = "Category %s was moved to position %s ";
+$_lang["cm_category_x_deleted"] = "Category %s has been deleted";
+$_lang["cm_category_x_renamed_to_y"] = "Category %s was renamed to %s ";
+$_lang["cm_translation_for_x_empty"] = "Translation for %s was empty";
+$_lang["cm_translation_for_x_to_y_success"] = "Translation for %s to %s successfully saved";
+$_lang["cm_save_new_sorting"] = "Save new sorting";
+$_lang["cm_translate_phrases"] = "Translate phrases";
+$_lang["cm_translate_module_phrases"] = "Translate module-phrases";
+$_lang["cm_native_phrase"] = "Native phrase";
+
+$_lang["btn_view_options"] = 'View Options';
+$_lang["view_options_msg"] = 'The display & listing of elements can be customized via "View Options"-button. Settings are saved and restored per Browser using HTML5´s localStorage.';
+$_lang["viewopts_title"] = 'View Options';
+$_lang["viewopts_cb_buttons"] = 'Buttons';
+$_lang["viewopts_cb_descriptions"] = 'Descriptions';
+$_lang["viewopts_cb_icons"] = 'Icons';
+$_lang["viewopts_radio_list"] = 'List';
+$_lang["viewopts_radio_inline"] = 'Inline';
+$_lang["viewopts_radio_flex"] = 'Flex';
+$_lang["viewopts_fontsize"] = 'Font-Size';
+$_lang["viewopts_cb_alltabs"] = 'All Tabs';
+
+$_lang['email_sender_method'] = 'The envelope sender of the message';
+$_lang['auto'] = 'Auto-detect';
+$_lang['use_emailsender'] = 'Use [(emailsender)] value';
+$_lang['email_sender_method_message'] = 'The envelope sender of the message. This will usually be turned into a Return-Path header by the receiver, and is the address that bounces will be sent to. Auto-detect will work in most cases.';
+
+$_lang['login_form_position_title'] = 'Login form postiton';
+$_lang['login_form_position_left'] = 'left';
+$_lang['login_form_position_center'] = 'center';
+$_lang['login_form_position_right'] = 'right';
+$_lang["login_form_style"] = 'Login form style:';
+$_lang["login_form_style_dark"] = 'dark';
+$_lang["login_form_style_light"] = 'light';
+$_lang['login_logo_title'] = 'Login page logo image';
+$_lang['login_logo_message'] = 'Recomended login logo image width: 360px, type .png';
+$_lang['login_bg_title'] = 'Login page background image';
+$_lang['login_bg_message'] = 'Recomended login page background image width: 1920px ';
+
+$_lang['manager_menu_position_title'] = 'Main menu position';
+$_lang['manager_menu_position_top'] = 'top';
+$_lang['manager_menu_position_left'] = 'left';
+
+$_lang['invalid_event_response'] = 'The %s event has invalid output';
+
+$_lang['chunk_processor'] = 'Chunks processing class';
diff --git a/manager/includes/lang/bulgarian.inc.php b/manager/includes/lang/bulgarian.inc.php
index ce4653ada2..1b7846b200 100755
--- a/manager/includes/lang/bulgarian.inc.php
+++ b/manager/includes/lang/bulgarian.inc.php
@@ -839,10 +839,10 @@
$_lang["role_view_unpublished"] = 'Преглед на непубликувани документи';
$_lang["role_web_access_persmissions"] = 'Права за уеб достъп';
$_lang["role_web_user_management"] = 'Управление на уеб потребителите';
-$_lang["rss_url_news_default"] = 'http://feeds.feedburner.com/evocms-release-news';
+$_lang["rss_url_news_default"] = 'https://feeds.feedburner.com/evocms-release-news';
$_lang["rss_url_news_message"] = 'Въвеждане на URL адрес за MODX Новините.';
$_lang["rss_url_news_title"] = 'RSS на Новините';
-$_lang["rss_url_security_default"] = 'http://feeds.feedburner.com/evocms-security-news';
+$_lang["rss_url_security_default"] = 'https://feeds.feedburner.com/evocms-security-news';
$_lang["rss_url_security_message"] = 'Въвеждане на URL адрес за MODX Сигурността.';
$_lang["rss_url_security_title"] = 'RSS на Сигурността';
$_lang["run_module"] = 'Стартиране на модул';
@@ -941,7 +941,7 @@
$_lang["sys_alert"] = 'Системен сигнал';
$_lang["sysinfo_activity_message"] = 'Този списък показва кои документи са били редактирани напоследък от потребителите.';
$_lang["sysinfo_userid"] = 'Потребител';
-$_lang["system_email_signup"] = 'Здравей [+uid+]
+$_lang["system_email_signup"] = 'Здравей [+uid+]
Въведи потребителско име и парола, за да влезеш в Мениджъра на [+sname+]:
@@ -966,7 +966,7 @@
С уважение,
Администратор';
-$_lang["system_email_websignup"] = 'Здравей [+uid+]
+$_lang["system_email_websignup"] = 'Здравей [+uid+]
Ето детайлите за акаунта ти в [+sname+]:
diff --git a/manager/includes/lang/country/belarusian_country.inc.php b/manager/includes/lang/country/belarusian_country.inc.php
new file mode 100644
index 0000000000..a4ea14be56
--- /dev/null
+++ b/manager/includes/lang/country/belarusian_country.inc.php
@@ -0,0 +1,257 @@
+
\ No newline at end of file
diff --git a/manager/includes/lang/country/chinese_country.inc.php b/manager/includes/lang/country/chinese_country.inc.php
new file mode 100644
index 0000000000..677c9f05a8
--- /dev/null
+++ b/manager/includes/lang/country/chinese_country.inc.php
@@ -0,0 +1,257 @@
+
\ No newline at end of file
diff --git a/manager/includes/lang/country/czech_country.inc.php b/manager/includes/lang/country/czech_country.inc.php
new file mode 100644
index 0000000000..677c9f05a8
--- /dev/null
+++ b/manager/includes/lang/country/czech_country.inc.php
@@ -0,0 +1,257 @@
+
\ No newline at end of file
diff --git a/manager/includes/lang/country/hebrew_country.inc.php b/manager/includes/lang/country/hebrew_country.inc.php
new file mode 100644
index 0000000000..677c9f05a8
--- /dev/null
+++ b/manager/includes/lang/country/hebrew_country.inc.php
@@ -0,0 +1,257 @@
+
\ No newline at end of file
diff --git a/manager/includes/lang/country/norsk_country.inc.php b/manager/includes/lang/country/norsk_country.inc.php
new file mode 100644
index 0000000000..677c9f05a8
--- /dev/null
+++ b/manager/includes/lang/country/norsk_country.inc.php
@@ -0,0 +1,257 @@
+
\ No newline at end of file
diff --git a/manager/includes/lang/country/ukrainian_country.inc.php b/manager/includes/lang/country/ukrainian_country.inc.php
new file mode 100644
index 0000000000..677c9f05a8
--- /dev/null
+++ b/manager/includes/lang/country/ukrainian_country.inc.php
@@ -0,0 +1,257 @@
+
\ No newline at end of file
diff --git a/manager/includes/lang/english.inc.php b/manager/includes/lang/english.inc.php
index 66f17728f2..eeb97f659b 100755
--- a/manager/includes/lang/english.inc.php
+++ b/manager/includes/lang/english.inc.php
@@ -1360,6 +1360,7 @@
$_lang["error_no_id"] = "ID not passed in request!";
$_lang["error_id_nan"] = "ID passed in request is NaN!";
$_lang["error_no_parent"] = "Couldn't find parent document's name!";
+$_lang["error_parent_deleted"] = "Failed because resource parent is deleted!";
$_lang["error_many_results"] = "Too many results returned from database!";
$_lang["error_no_results"] = "Not enough/ no results returned from database!";
$_lang["error_no_user_selected"] = "No user selected as recipient of this message!";
@@ -1517,8 +1518,6 @@
$_lang['manager_menu_position_top'] = 'top';
$_lang['manager_menu_position_left'] = 'left';
-$_lang['invalid_event_response'] = 'The %s event has ivalid output';
+$_lang['invalid_event_response'] = 'The %s event has invalid output';
$_lang['chunk_processor'] = 'Chunks processing class';
-$_lang['enable_mootools'] = 'Enable Mootools in manager';
-$_lang['enable_mootools_message'] = 'Load Mootools.js in manager for backward compatibility';
diff --git a/manager/includes/lang/japanese-utf8.inc.php b/manager/includes/lang/japanese-utf8.inc.php
index 9d49e9af4b..aebe70ac3d 100755
--- a/manager/includes/lang/japanese-utf8.inc.php
+++ b/manager/includes/lang/japanese-utf8.inc.php
@@ -851,10 +851,10 @@
$_lang["role_view_unpublished"] = '未公開のリソースの閲覧';
$_lang["role_web_access_persmissions"] = 'ウェブアクセス許可';
$_lang["role_web_user_management"] = 'ウェブユーザー管理';
-$_lang["rss_url_news_default"] = 'http://feeds2.feedburner.com/modxjp';
+$_lang["rss_url_news_default"] = 'https://feeds2.feedburner.com/modxjp';
$_lang["rss_url_news_message"] = '管理画面トップの「MODX News」のフィードURL';
$_lang["rss_url_news_title"] = 'RSS ニュースフィード';
-$_lang["rss_url_security_default"] = 'http://feeds.feedburner.com/evocms-security-news';
+$_lang["rss_url_security_default"] = 'https://feeds.feedburner.com/evocms-security-news';
$_lang["rss_url_security_message"] = '管理画面トップの「MODX Security」のフィードURL';
$_lang["rss_url_security_title"] = 'RSS セキュリティ情報フィード';
$_lang["run_module"] = 'モジュールの実行';
diff --git a/manager/includes/lang/russian-UTF8.inc.php b/manager/includes/lang/russian-UTF8.inc.php
index d9020f45aa..a63bde7155 100755
--- a/manager/includes/lang/russian-UTF8.inc.php
+++ b/manager/includes/lang/russian-UTF8.inc.php
@@ -1263,9 +1263,6 @@
$_lang["bkmgr_snapshot_nothing"] = 'Нет резервных копий';
$_lang["files.dynamic.php1"] = 'Создать файл';
-$_lang["files.dynamic.php2"] = 'files.dynamic.php2';
-$_lang["files.dynamic.php3"] = 'files.dynamic.php3';
-$_lang["files.dynamic.php4"] = 'files.dynamic.php4';
$_lang["files.dynamic.php5"] = 'Файл не может быть дублирован.';
$_lang["files.dynamic.php6"] = 'Файл или директория не могут быть переименованы.';
$_lang["files_dynamic_new_folder_name"] = 'Укажите новое имя для папки:';
@@ -1353,6 +1350,7 @@
$_lang["error_no_id"] = "Не верно указан ID в вашем запросе!";
$_lang["error_id_nan"] = "ID переданного запроса пуст!";
$_lang["error_no_parent"] = "Не удалось найти имя родительского документа!";
+$_lang["error_parent_deleted"] = "Не удалось выполнить, потому что родитель отмечен как удаленный!";
$_lang["error_many_results"] = "Слишком много результатов возвращается из базы данных!";
$_lang["error_no_results"] = "Результаты из базы данных не вернулись или вернулись не полностью!";
$_lang["error_no_user_selected"] = "Не указан получатель этого сообщения!";
diff --git a/manager/includes/lang/ukrainian.inc.php b/manager/includes/lang/ukrainian.inc.php
index d3e7f59192..c2750ca67e 100755
--- a/manager/includes/lang/ukrainian.inc.php
+++ b/manager/includes/lang/ukrainian.inc.php
@@ -1,20 +1,1517 @@
' . $contents);
+//$modx_textdir = 'rtl'; // uncomment this line for RTL languages
$modx_lang_attribute = 'uk'; // Manager HTML/XML Language Attribute see http://en.wikipedia.org/wiki/ISO_639-1
+$modx_manager_charset = 'UTF-8';
setlocale (LC_ALL, 'uk_UA.UTF-8');
+
+$_lang["about_msg"] = 'EVO - це PHP Application Framework та Content Management System , поширювана за ліцензією GNU GPL .';
+$_lang["about_title"] = 'Про EVO';
+$_lang["access_permission_denied"] = 'У вас недостатньо прав для перегляду цього ресурсу.';
+$_lang["access_permission_parent_denied"] = 'У вас недостатньо прав для створення ресурсу в цьому розділі';
+$_lang["access_permissions"] = 'Права доступу';
+$_lang["access_permissions_add_resource_group"] = 'Створити нову групу ресурсів';
+$_lang["access_permissions_add_user_group"] = 'Створити нову групу користувачів';
+$_lang["access_permissions_docs_collision"] = 'Оскільки групи веб-користувачів та менеджерів конфліктують з вашою роллю, цей ресурс буде доступний всім.';
+$_lang["access_permissions_docs_message"] = 'Тут ви можете вибрати, до яких груп ресурсів належить цей ресурс.';
+$_lang["access_permissions_group_link"] = 'Створити новий зв\'язок групи користувачів та групи ресурсів';
+$_lang["access_permissions_introtext"] = 'Тут можна керувати доступом груп користувачів до груп ресурсів. Щоб додати користувача до групи, під час редагування виберіть групу, до якої він належатиме. Ресурс також можна додати до групи під час його редагування.';
+$_lang["access_permissions_link_to_group"] = 'із групою ресурсів';
+$_lang["access_permissions_link_user_group"] = 'Зв\'язати групу користувачів';
+$_lang["access_permissions_links"] = 'Зв\'язки груп користувачів та груп ресурсів';
+$_lang["access_permissions_links_tab"] = 'Тут можна визначити, які групи користувачів мають доступ (тобто створювати та редагувати) до груп ресурсів. Щоб прив\'язати групу ресурсів до групи користувачів, виберіть групу зі списку та натисніть \'Виконати\'. Щоб видалити прив\'язку до групи, натисніть \'Видалити\'.';
+$_lang["access_permissions_no_resources_in_group"] = 'Немає ресурсів.';
+$_lang["access_permissions_no_users_in_group"] = 'Немає користувачів.';
+$_lang["access_permissions_off"] = 'Права доступу не активовані. Це означає, що жодні зміни не набудуть чинності, доки ви не зміните налаштування.';
+$_lang["access_permissions_resource_groups"] = 'Групи ресурсів';
+$_lang["access_permissions_resources_in_group"] = 'ресурсів в групі: ';
+$_lang["access_permissions_resources_tab"] = 'Тут ви можете побачити усі групи ресурсів. Також тут можна створити, перейменувати, видалити групу, переглянути ресурси в групі. Для додавання або видалення ресурсу з групи редагуйте ресурс безпосередньо.';
+$_lang["access_permissions_user_groups"] = 'Групи користувачів';
+$_lang["access_permissions_user_message"] = 'Тут ви можете вибрати, до якої групи належить цей користувач:';
+$_lang["access_permissions_users_in_group"] = 'Користувачів в групі:';
+$_lang["access_permissions_users_tab"] = 'Тут ви можете побачити усі групи користувачів. Також, ви можете створити, перейменувати, видалити групу, переглянути членів групи. Щоб додати або видалити користувача з групи, редагуйте користувача безпосередньо. Менеджери завжди мають доступ до всіх ресурсів.';
+$_lang["account_email"] = 'E-mail облікового запису';
+$_lang["actioncomplete"] = 'Дія успішно завершена Зачекайте, поки EVO здійснить очищення.';
+$_lang["activity_message"] = 'Цей список показує недавно створені або відредаговані ресурси:';
+$_lang["activity_title"] = 'Нещодавно створені/відредаговані ресурси';
+$_lang["add"] = 'Створити';
+$_lang["add_chunk"] = 'Чанк';
+$_lang["add_doc"] = 'Ресурс';
+$_lang["add_folder"] = 'Нова папка';
+$_lang["add_plugin"] = 'Плагін';
+$_lang["add_resource"] = 'Новий ресурс';
+$_lang["add_snippet"] = 'Сніппет';
+$_lang["add_tag"] = 'Створити тег';
+$_lang["add_template"] = 'Шаблон';
+$_lang["add_tv"] = 'Параметр (TV)';
+$_lang["add_weblink"] = 'Нове посилання';
+$_lang["administrator_role_message"] = 'Цю роль неможливо редагувати або видалити.';
+$_lang["administrators"] = 'Адміністраторів';
+$_lang["after_saving"] = 'Після збереження';
+$_lang["alert_delete_self"] = 'Ви не можете видалити себе:)';
+$_lang["alias"] = 'Псевдонім';
+$_lang["all_doc_groups"] = 'Без групи (доступний для всіх)';
+$_lang["all_events"] = 'Всі події';
+$_lang["all_usr_groups"] = 'Всі групи (доступні для всіх)';
+$_lang["allow_mgr_access"] = 'Доступ до інтерфейсу системи керування сайтом';
+$_lang["allow_mgr_access_message"] = 'Виберіть цей параметр для дозволу/заборони доступу до системи керування сайтом.Примітка: якщо вимкнено, користувач буде спрямований на стартову сторінку системи керування або на початкову сторінку сайту.';
+$_lang["already_deleted"] = 'вже видалено.';
+$_lang["attachment"] = 'Прикріплене';
+$_lang["author_infos"] = 'Інформація про авторів';
+$_lang["automatic_alias_message"] = 'Виберіть \'Так\' для того, щоб система автоматично генерувала псевдоніми на основі заголовків сторінок (для транслітерації символів кирилиці налаштуйте плагін TransAlias).';
+$_lang["automatic_alias_title"] = 'Автоматично генерувати псевдонім:';
+$_lang["backup"] = 'Бекап';
+$_lang["bk_manager"] = 'Резервне копіювання';
+$_lang["block_message"] = 'Після збереження користувач буде заблокований.';
+$_lang["blocked_minutes_message"] = 'Тут ви можете ввести час у хвилинах, на який користувач буде заблокований, якщо він досягне максимальної кількості дозволених невдалих спроб входу до системи. Будь ласка, введіть це значення як число (не використовуйте розділових знаків, пропуску тощо)';
+$_lang["blocked_minutes_title"] = 'Час блокування:';
+$_lang["cache_files_deleted"] = 'Наступні файли були видалені:';
+$_lang["cancel"] = 'Скасувати';
+$_lang["captcha_code"] = 'Код підтвердження';
+$_lang["captcha_message"] = 'Увімкніть для посилення безпеки. Для авторизації необхідно буде ввести код, який не розпізнається різними скриптами (показаний у вигляді графічного зображення).';
+$_lang["captcha_title"] = 'Використати код CAPTCHA:';
+$_lang["captcha_words_default"] = 'EVO,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Tattoo,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote';
+$_lang["captcha_words_message"] = 'Тут можна задати список слів для генерування коду CAPTCHA. Слова у списку повинні розділятися комами.';
+$_lang["captcha_words_title"] = 'Слова для створення CAPTCHA-кодів:';
+$_lang["category_heading"] = 'Категорія';
+$_lang["category_manager"] = 'Менеджер категорій';
+$_lang["category_management"] = 'Категорії';
+$_lang["manage_categories"] = 'Категорії';
+$_lang["category_msg"] = 'Тут можна переглядати та редагувати всі елементи, згруповані за категоріями.';
+$_lang["cfg_base_path"] = 'MODX_BASE_PATH';
+$_lang["cfg_base_url"] = 'MODX_BASE_URL';
+$_lang["cfg_manager_path"] = 'MODX_MANAGER_PATH';
+$_lang["cfg_manager_url"] = 'MODX_MANAGER_URL';
+$_lang["cfg_site_url"] = 'MODX_SITE_URL';
+$_lang["change_name"] = 'Змінити ім\'я';
+$_lang["change_password"] = 'Змінити пароль';
+$_lang["change_password_confirm"] = 'Підтвердити пароль';
+$_lang["change_password_message"] = 'Введіть новий пароль, а потім введіть його ще раз для підтвердження. Довжина паролю повинна становити від 6 до 15 символів.';
+$_lang["change_password_new"] = 'Новий пароль';
+$_lang["charset_message"] = 'Виберіть кодування сторінок сайту. Памятайте, що EVO не тестувався на всіх кодуваннях. Для більшості мов підходить кодування UTF-8.';
+$_lang["charset_title"] = 'Кодування:';
+$_lang["chunk"] = 'Чанк (HTML-елемент шаблону)';
+$_lang["chunk_code"] = 'Код чанку (HTML)';
+$_lang["chunk_multiple_id"] = 'Помилка: Кілька чанків мають однаковий ідентифікатор.';
+$_lang["chunk_no_exist"] = 'Чанк не знайдено.';
+$_lang['chunk_processor'] = 'Клас обробки чанків';
+$_lang["cleaningup"] = 'Очищення...';
+$_lang["clean_uploaded_filename"] = 'Використовувати транслітерацію при завантаженні файлів.';
+$_lang["clean_uploaded_filename_message"] = 'Використовувати налаштування плагіна transalias для транслітерації імен файлів, що завантажуються зі збереженням крапок і ком.';
+$_lang["clear_log"] = 'Очистити протокол';
+$_lang["click_to_context"] = 'Контекстне меню';
+$_lang["click_to_edit_title"] = 'Редагувати запис';
+$_lang["click_to_view_details"] = 'Деталі';
+$_lang["close"] = 'Закрити';
+$_lang["code"] = 'Код';
+$_lang["collapse_tree"] = 'Згорнути дерево';
+$_lang["comment"] = 'Коментар';
+$_lang["configcheck_admin"] = 'Будь ласка, зв\'яжіться із системним адміністратором та повідомте про цю помилку';
+$_lang["configcheck_cache"] = 'неможливий запис до папки кешування';
+$_lang["configcheck_cache_msg"] = 'EVO не в змозі записувати дані до папки кешування. Система працюватиме нормально, але кешування не відбуватиметься. Щоб вирішити цю проблему, дозвольте запис до папки /assets/cache.';
+$_lang["configcheck_configinc"] = 'Файл конфігурації все ще доступний для запису';
+$_lang["configcheck_configinc_msg"] = 'Зловмисники потенційно можуть зашкодити вашому сайту. Серйозно. Будь ласка, встановіть права доступу до файлу конфігурації (/[+MGR_DIR+]/includes/config.inc.php) в режим \'Тільки для читання\'';
+$_lang["configcheck_default_msg"] = 'Невизначена помилка.';
+$_lang["configcheck_errorpage_unavailable"] = 'Сторінка повідомлення про помилку, вказана в конфігурації сайту, недоступна.';
+$_lang["configcheck_errorpage_unavailable_msg"] = 'Це означає, що вона не існує або недоступна звичайним відвідувачам сайту. Це може призвести до циклічного виклику функції \'повідомлення про помилку\' та великої кількості записів у журналі сайту. Переконайтеся, що немає груп веб-користувачів, яким призначено цю сторінку.';
+$_lang["configcheck_errorpage_unpublished"] = 'Сторінку повідомлення про помилку, вказану в конфігурації сайту, не опубліковано.';
+$_lang["configcheck_errorpage_unpublished_msg"] = 'Це означає, що вона недоступна для відвідувачів сайту. Необхідно опублікувати сторінку повідомлення про помилку, щоб ця функція працювала правильно.';
+$_lang["configcheck_filemanager_path"] = 'Вказано неправильний шлях для файлового менеджера ';
+$_lang["configcheck_filemanager_path_msg"] = 'Це може статися, наприклад, після переміщення вашого сайту в інший каталог або на інший сервер. Будь ласка, перевірте та оновіть налаштування вашої системи EvolutionCMS';
+$_lang["configcheck_hide_warning"] = 'Більше не показувати це повідомлення. ';
+$_lang["configcheck_images"] = 'Папка зображень (images) недоступна для запису';
+$_lang["configcheck_images_msg"] = 'Папка зображень недоступна для запису або не існує на сервері. З цього випливає, що управління зображеннями не працюватиме';
+$_lang["configcheck_installer"] = 'Не видалено папку з файлами, що використовувалися в процесі установки';
+$_lang["configcheck_installer_msg"] = 'Папка /install містить інсталяційні файли системи EVO. Зловмисники можуть скористатися цими файлами для зламу/пошкодження сайту, тому краще видалити папку з сервера.';
+$_lang["configcheck_lang_difference"] = 'Невірна кількість записів у мовному пакеті.';
+$_lang["configcheck_lang_difference_msg"] = 'Поточний мовний пакет має кількість записів, відмінну від необхідного. Незважаючи на те, що система працюватиме нормально, можливо, мовний пакет потребує доопрацювання.';
+$_lang["configcheck_notok"] = 'Конфігурація містить помилки.';
+$_lang["configcheck_ok"] = 'Конфігурація не містить помилок.';
+$_lang["configcheck_php_gdzip"] = 'GD та/або Zip PHP розширення не знайдені';
+$_lang["configcheck_php_gdzip_msg"] = 'Для нормальної роботи EVO необхідно, щоб були дозволені GD та Zip розширення для PHP. EVO буде працювати без цих розширень, але ви не зможете використовувати всі можливості вбудованого файл-менеджера, редактора зображень або код CAPTCHA для авторизації.';
+$_lang["configcheck_rb_base_dir"] = 'Вказано невірний шлях для файл-браузера ';
+$_lang["configcheck_rb_base_dir_msg"] = 'Це може статися, наприклад, після переміщення вашого сайту в інший каталог або на інший сервер. Будь ласка, перевірте та оновіть налаштування вашої системи EvolutionCMS';
+$_lang["configcheck_register_globals"] = 'Параметр \'register_globals\' має значення \'ON\' у конфігураційному файлі \'php.ini\'.';
+$_lang["configcheck_register_globals_msg"] = 'Така конфігурація робить ваш сайт значно вразливішим для Cross Site Scripting (XSS) атак. Зверніться до служби підтримки вашого хостингу за інформацією, яким чином вимкнути цей параметр.';
+$_lang["configcheck_title"] = 'Перевірка конфігурації';
+$_lang["configcheck_templateswitcher_present"] = 'Виявлено плагін TemplateSwitcher';
+$_lang["configcheck_templateswitcher_present_delete"] = 'Видалити плагін TemplateSwitcher ';
+$_lang["configcheck_templateswitcher_present_disable"] = 'Вимкнути плагін TemplateSwitcher ';
+$_lang["configcheck_templateswitcher_present_msg"] = 'Виявлено проблеми з кешуванням та продуктивністю при використанні плагіна TemplateSwitcher';
+$_lang["configcheck_unauthorizedpage_unavailable"] = 'Сторінка повідомлення про обмежений доступ, вказана в конфігурації сайту, не опублікована або не існує.';
+$_lang["configcheck_unauthorizedpage_unavailable_msg"] = 'Це означає, що вона не існує або недоступна звичайним відвідувачам сайту. Це може призвести до рекурсивного виклику функції \'повідомлення про помилку\' та великої кількості записів у журналі сайту. Переконайтеся, що немає груп веб-користувачів, яким призначено цю сторінку.';
+$_lang["configcheck_unauthorizedpage_unpublished"] = 'Сторінку повідомлення про обмежений доступ, зазначену в конфігурації сайту, не опубліковано.';
+$_lang["configcheck_unauthorizedpage_unpublished_msg"] = 'Це означає, що вона недоступна для відвідувачів сайту. Необхідно опублікувати сторінку повідомлення про обмеження доступу, щоб ця функція працювала правильно.';
+$_lang["configcheck_validate_referer"] = 'Попередження безпеки: перевірка заголовка HTTP';
+$_lang["configcheck_validate_referer_msg"] = 'У конфігурації параметр Перевіряти серверні заголовки HTTP_REFERER? вимкнено. Ми рекомендуємо її увімкнути. Перейти до налаштування конфігурації ';
+$_lang["configcheck_warning"] = 'Помилка конфігурації:';
+$_lang["configcheck_what"] = 'Що це означає?';
+$_lang["confirm_block"] = 'Ви впевнені, що хочете заблокувати користувача?';
+$_lang["confirm_delete_category"] = 'Ви впевнені, що хочете видалити цю категорію?';
+$_lang["confirm_delete_eventlog"] = 'Ви впевнені, що хочете видалити протокол подій?';
+$_lang["confirm_delete_file"] = 'Ви впевнені, що хочете видалити файл? \n\nЦе може спричинити проблеми з роботою сайту. Видаляйте файл, якщо ви на 100% впевнені, що робота сайту не постраждає.';
+$_lang["confirm_delete_group"] = 'Ви впевнені, що хочете видалити цю групу?';
+$_lang["confirm_delete_htmlsnippet"] = 'Ви впевнені, що хочете видалити цей чанк?';
+$_lang["confirm_delete_keywords"] = 'Ви впевнені, що хочете видалити ці ключові слова?';
+$_lang["confirm_delete_module"] = 'Ви впевнені, що хочете видалити цей модуль?';
+$_lang["confirm_delete_plugin"] = 'Ви впевнені, що хочете видалити цей плагін?';
+$_lang["confirm_delete_record"] = 'Ви впевнені, що хочете видалити ці записи?';
+$_lang["confirm_delete_resource"] = 'Ви впевнені, що хочете видалити цей ресурс? \nВсі дочірні ресурси будуть також видалені.';
+$_lang["confirm_delete_role"] = 'Ви впевнені, що хочете видалити цю роль?';
+$_lang["confirm_delete_snippet"] = 'Ви впевнені, що хочете видалити цей сніпет?';
+$_lang["confirm_delete_tags"] = 'Ви впевнені, що хочете видалити вибрані META-теги?';
+$_lang["confirm_delete_template"] = 'Ви впевнені, що хочете видалити цей шаблон?';
+$_lang["confirm_delete_tmplvars"] = 'Ви впевнені, що хочете видалити цей параметр (TV) та всі збережені в ньому дані?';
+$_lang["confirm_delete_user"] = 'Ви впевнені, що хочете видалити цього користувача?';
+$_lang["confirm_duplicate_record"] = 'Ви впевнені, що хочете зробити копію цього запису?';
+$_lang["confirm_empty_trash"] = 'Видалити ВСІ помічені видалення файлів назавжди? \n\nПродовжити?';
+$_lang["confirm_load_depends"] = 'Ви впевнені, що хочете завантажити панель \'Залежності\' без збереження змін?';
+$_lang["confirm_name_change"] = 'Зміна імені користувача може вплинути на деякі додатки системи EVO. \n\nВи впевнені, що хочете змінити ім\'я користувача?';
+$_lang["confirm_publish"] = '\n\nПублікація цього ресурсу зараз видаляє всі встановлені розклади публікації. Якщо ви хочете встановити новий розклад або залишити старий – виберіть \'Редагувати\'.\n\nПродовжити?';
+$_lang["confirm_remove_locks"] = 'Користувачі іноді закривають браузер у процесі редагування ресурсів, шаблонів, сніппетів тощо, залишаючи їх заблокованими. Натискаючи \"ОК\", ви видаляєте всі поточні блокування. \n\nПродовжити?';
+$_lang["confirm_reset_sort_order"] = 'Ви впевнені, що хочете скинути \"sort order/index\" з усіх перелічених елементів до 0?';
+$_lang["confirm_resource_duplicate"] = 'Ви впевнені, що хочете зробити копію цього ресурсу? \nВсі дочірні ресурси також будуть скопійовані.';
+$_lang["confirm_setting_language_change"] = 'Ви змінили значення за промовчанням, виконані раніше виправлення будуть втрачені. Продовжити?';
+$_lang["confirm_unblock"] = 'Ви впевнені, що хочете розблокувати цього користувача?';
+$_lang["confirm_undelete"] = '\n\nВсі дочірні ресурси, видалені разом із цим ресурсом, будуть відновлені. Проте ресурси, видалені раніше, не будуть відновлені.';
+$_lang["confirm_unpublish"] = '\n\nСкасування публікації цього ресурсу зараз видаляє всі встановлені розклади публікації. Якщо ви хочете встановити новий розклад або залишити старий - виберіть \'Редагувати\'.\n\nПродовжити?';
+$_lang["confirm_unzip_file"] = 'Ви впевнені, що хочете розпакувати архів? \n\nІснуючі файли будуть перезаписані.';
+$_lang["could_not_find_user"] = 'Не можу знайти користувача';
+$_lang["create_folder_here"] = 'Дочірній контейнер';
+$_lang["create_resource_here"] = 'Дочірній ресурс';
+$_lang["create_resource_title"] = 'Створити ресурс';
+$_lang["create_weblink_here"] = 'Дочірнє веб-посилання';
+$_lang["createdon"] = 'Дата створення';
+$_lang["create_new"] = 'Створити';
+$_lang["credits"] = 'EVO використовує';
+$_lang["credits_shouts_msg"] = ' EVO підтримується на сайті evo.im .
';
+$_lang["custom_contenttype_message"] = 'Тут можна додати типи вмісту (Content-Type) для сайту. Для цього введіть тип вмісту та натисніть \'Додати\'.';
+$_lang["custom_contenttype_title"] = 'Типи вмісту (Content-Type):';
+$_lang["database_charset"] = 'Кодування бази даних';
+$_lang["database_collation"] = 'Співставлення бази даних';
+$_lang["database_name"] = 'Ім\'я бази даних';
+$_lang["database_overhead"] = 'Примітка: \'перевитрата\' – це невикористовуваний, але зарезервований MySQL простір. Щоб звільнити це місце, натисніть \'Перевитрата\' у таблиці (таблицях).';
+$_lang["database_server"] = 'Сервер бази даних';
+$_lang["database_table_clickbackup"] = 'створити та завантажити резервну копію вибраних таблиць';
+$_lang["database_table_clickhere"] = 'Натисніть тут';
+$_lang["database_table_datasize"] = 'Обсяг даних';
+$_lang["database_table_droptablestatements"] = 'Включати в дамп інструкцію \'DROP TABLE\'';
+$_lang["database_table_effectivesize"] = 'Зайнятий об\'єм';
+$_lang["database_table_indexsize"] = 'Обсяг індексу';
+$_lang["database_table_overhead"] = 'Перевитрата';
+$_lang["database_table_records"] = 'Записи';
+$_lang["database_table_tablename"] = 'Назва таблиці';
+$_lang["database_table_totals"] = 'Всього:';
+$_lang["database_table_totalsize"] = 'Загальний обсяг';
+$_lang["database_tables"] = 'Таблиці бази даних';
+$_lang["database_version"] = 'Версія бази даних:';
+$_lang["date"] = 'Дата';
+$_lang["datechanged"] = 'Дата зміни';
+$_lang["datepicker_offset"] = 'Зміщення років: ';
+$_lang["datepicker_offset_message"] = 'Число минулих років, яке буде показано у вікні вибору дати.';
+$_lang["datetime_format"] = 'Формат дати:';
+$_lang["datetime_format_message"] = 'Виберіть формат дати, який буде використано в системі керування.';
+$_lang["default"] = 'За замовчуванням:';
+$_lang["defaultcache_message"] = 'Виберіть \'Так\', щоб нові ресурси після створення кешувалися за замовчуванням.';
+$_lang["defaultcache_title"] = 'Кешований\' за замовчуванням:';
+$_lang["defaultmenuindex_message"] = 'Виберіть \'Так\', для автоматичного збільшення позиції в меню для нових ресурсів.';
+$_lang["defaultmenuindex_title"] = '\'Індексація меню\' за замовчуванням:';
+$_lang["defaultpublish_message"] = 'Виберіть \'Так\', щоб нові ресурси після створення публікувалися за замовчуванням.';
+$_lang["defaultpublish_title"] = '\'Публікувати\' за замовчуванням:';
+$_lang["defaultsearch_message"] = 'Виберіть \'Так\', щоб нові ресурси після створення були доступні для пошуку за замовчуванням.';
+$_lang["defaultsearch_title"] = '\'Доступний для пошуку\' за замовчуванням:';
+$_lang["defaulttemplate_message"] = 'Виберіть шаблон, який буде застосовуватись до нових ресурсів за промовчанням. Під час редагування ресурсу ви можете встановити будь-який шаблон.';
+$_lang["defaulttemplate_title"] = 'Шаблон за замовчуванням:';
+$_lang["defaulttemplate_logic_title"] = 'Автоматичне призначення шаблону';
+$_lang["defaulttemplate_logic_general_message"] = 'Шаблон, призначений для нових ресурсів:';
+$_lang["defaulttemplate_logic_system_message"] = 'Системний : такий самий шаблон, як у системних налаштуваннях.';
+$_lang["defaulttemplate_logic_parent_message"] = 'Батько : такий самий шаблон, як у батька (якщо ресурс у корені сайту, шаблон Системний).';
+$_lang["defaulttemplate_logic_sibling_message"] = 'Сусідний : такий самий шаблон, як у сусідніх ресурсів у цьому контейнері (якщо сусідніх ресурсів немає, шаблон Батько).';
+$_lang["delete"] = 'Видалити';
+$_lang["delete_resource"] = 'Видалити';
+$_lang["delete_tags"] = 'Видалити теги';
+$_lang["deleting_file"] = 'Видаляється файл %s : ';
+$_lang["description"] = 'Опис';
+$_lang["deselect_keywords"] = 'Видалити ключові слова';
+$_lang["deselect_metatags"] = 'Видалити META-теги';
+$_lang["disabled"] = 'Вимкнено';
+$_lang["doc_data_title"] = 'Огляд ресурсу';
+$_lang["documentation"] = 'Документація';
+$_lang["duplicate"] = 'Зробити копію';
+$_lang["duplicate_alias_found"] = 'Ресурс %s вже використовує псевдонім %s . Введіть унікальний псевдонім.';
+$_lang["duplicate_alias_message"] = 'Виберіть \'Так\', щоб дозволити повторення псевдонімів.Примітка: цей параметр повинен використовуватися разом із включеною функцією \'Використовувати вкладені URL\'. ';
+$_lang["duplicate_alias_title"] = 'Дозволити повторювані псевдоніми:';
+$_lang["duplicate_name_found_general"] = 'Об\'єкт %s з ім\'ям %s вже існує. Будь ласка, введіть інше ім\'я.';
+$_lang["duplicate_name_found_module"] = 'Модуль із ім\'ям %s вже існує. Будь ласка, введіть інше ім\'я.';
+$_lang["duplicated_el_suffix"] = 'Копія';
+$_lang["edit"] = 'Редагувати';
+$_lang["edit_resource"] = 'Редагувати';
+$_lang["edit_resource_title"] = 'Редагувати ресурс';
+$_lang["edit_settings"] = 'Конфігурація';
+$_lang["editedon"] = 'Дата редагування';
+$_lang["editing_file"] = 'Редагований файл: ';
+$_lang["editor_css_path_message"] = 'Введіть шлях до файлу CSS, який ви бажаєте використовувати для редактора. Рекомендується вводити шлях від кореня сайту, наприклад: /assets/site/style.css. Якщо ви не хочете використовувати файл CSS для редактора, залиште це поле порожнім.';
+$_lang["editor_css_path_title"] = 'Шлях до CSS файлу:';
+$_lang["element"] = 'Елемент';
+$_lang["element_categories"] = 'Спільний перегляд';
+$_lang["element_filter_msg"] = 'Введіть тут, щоб фільтрувати список';
+$_lang["element_management"] = 'Елементи';
+$_lang["element_name"] = 'Назва елемента';
+$_lang["element_selector_msg"] = 'Виберіть елемент(и) зі списку внизу та натисніть кнопку \'Вставити\'.';
+$_lang["element_selector_title"] = 'Вибір елемента';
+$_lang["elements"] = 'Елементи';
+$_lang["email"] = 'E-mail';
+$_lang["email_sent"] = 'Лист надісланий';
+$_lang["emailsender_message"] = 'Вкажіть адресу e-mail, яка буде відображена у листі підтвердження реєстрації в полі \'Від\'.';
+$_lang["emailsender_title"] = 'Зворотня електронна адреса:';
+$_lang["emailsubject_default"] = 'Дані для авторизації';
+$_lang["emailsubject_message"] = 'Вкажіть текст, який буде відображено у листі підтвердження реєстрації в полі \'Тема\'.';
+$_lang["emailsubject_title"] = 'Тема листа підтвердження реєстрації:';
+$_lang["empty_folder"] = 'Папка порожня';
+$_lang["empty_recycle_bin"] = 'Очистити кошик';
+$_lang["empty_recycle_bin_empty"] = 'Немає ресурсів, помічених на видалення.';
+$_lang["enable_resource"] = 'Підключити файл елементів.';
+$_lang["enable_sharedparams"] = 'Включити \'загальні\' параметри';
+$_lang["enable_sharedparams_msg"] = 'Примітка: Вказаний вище унікальний глобальний ідентифікатор (GUID) буде використаний для ідентифікації цього модуля та загальних параметрів. GUID також використовується для формування зв\'язку модуля, плагінів або сніпетів, які використовують його загальні параметри.';
+$_lang["enabled"] = 'Увімкнено';
+$_lang["error"] = 'Помилка';
+$_lang["error_sending_email"] = 'Помилка надсилання e-mail';
+$_lang["errorpage_message"] = 'Введіть ID ресурсу, який ви хочете використовувати як сторінку помилки (404 - ресурс не знайдено).Примітка: переконайтеся, що цей ID належить існуючому ресурсу, і що цей ресурс опубліковано';
+$_lang["errorpage_title"] = 'Сторінка помилки \'404\':';
+$_lang["event_id"] = 'ID події';
+$_lang["eventlog"] = 'Протокол подій';
+$_lang["eventlog_msg"] = 'Протокол подій використовується для відображення системних інформаційних повідомлень, попереджень та повідомлень про помилки. У колонці \'Код\' показаний розділ системи управління, де сталася подія.';
+$_lang["eventlog_viewer"] = 'Перегляд подій';
+$_lang["everybody"] = 'Всім';
+$_lang["existing_category"] = 'Існуючі категорії';
+$_lang["expand_tree"] = 'Розгорнути дерево';
+$_lang["export_site"] = 'Експортувати сайт';
+$_lang["export_site_cacheable"] = 'Експортувати некешовані ресурси:';
+$_lang["export_site_exporting_document"] = '[+status+] [+url+] - [+pagetitle+] ([+id+]) ';
+$_lang["export_site_failed"] = 'Помилка';
+$_lang["export_site_failed_no_open"] = 'Неможливо відкрити файл:';
+$_lang["export_site_failed_no_retrieve"] = 'Неможливо отримати ресурс.';
+$_lang["export_site_failed_no_write"] = 'Неможливо записати у файл.';
+$_lang["export_site_html"] = 'Експортувати сайт до HTML';
+$_lang["export_site_maxtime"] = 'Максимальний час експорту:';
+$_lang["export_site_maxtime_message"] = 'Вкажіть максимальну кількість секунд, протягом яких буде виконуватися процес експорту сайту (нехтуючи налаштуваннями PHP). Введіть 0 для необмеженого часу. Майте на увазі, що 0 або дуже багато часу, задані для процесу експорту, можуть призвести до неадекватної роботи сервера, тому такі значення задавати не рекомендується.';
+$_lang["export_site_message"] = 'Ця функція дозволяє експортувати сайт у HTML файли повністю. Майте на увазі, що статичний HTML-сайт має дуже обмежені можливості порівняно з EVO-сайтом:
не буде записуватися статистика відвідувань; інтерактивні сніпети працювати не будуть; веб-посилання експортовані не будуть; процес експорту може не вдасться, якщо ресурси містять сніпети з перенаправленням; можлива неправильна робота дизайну шаблону вашого сайту. Щоб уникнути цього, експортовані файли повинні знаходитися в кореневій папці (там же, де і файл index.php системи EVO).
Будь ласка, заповніть форму та натисніть \'Почати експорт\'. Файли будуть записані в папку /assets/export, використовуючи, де можливо, псевдоніми як імена. При експорті сайту рекомендується в конфігурації EVO увімкнути функцію \'Використовувати псевдоніми в URL\'. Час експорту залежить від розмірів вашого сайту.
Існуючі файли з іменами, що збігаються, будуть замінені на нові.
';
+$_lang["export_site_numberdocs"] = 'Знайдено %s ресурсів для експорту...
';
+$_lang["export_site_prefix"] = 'Префікс файлів:';
+$_lang["export_site_start"] = 'Почати експорт';
+$_lang["export_site_success"] = 'Експорт завершено';
+$_lang["export_site_success_skip_dir"] = 'Пропустити цю папку.';
+$_lang["export_site_success_skip_doc"] = 'Пропустити цей ресурс.';
+$_lang["export_site_suffix"] = 'Суфікс файлів:';
+$_lang["export_site_target_unwritable"] = 'Папка експорту недоступна для запису. Виправте це і спробуйте знову.';
+$_lang["export_site_time"] = 'Експорт завершено. Процес зайняв %s секунд.';
+$_lang["failed_login_message"] = 'Тут можна ввести кількість невдалих спроб входу в систему, які дозволені, перш ніж користувач буде заблокований.';
+$_lang["failed_login_title"] = 'Ліміт невдалих спроб входу до системи:';
+$_lang["fe_editor_lang_message"] = 'Виберіть мову редактора, яка використовуватиметься у фронтенді.';
+$_lang["fe_editor_lang_title"] = 'Мова фронтенд-редактора:';
+$_lang["file_delete_file"] = 'Видалити файл';
+$_lang["file_delete_folder"] = 'Видалити папку';
+$_lang["file_deleted"] = 'Видалено';
+$_lang["file_download_file"] = 'Завантажити файл';
+$_lang["file_download_unzip"] = 'Розпакувати файл';
+$_lang["file_folder_chmod_error"] = 'Не вдалося змінити права, необхідно встановити потрібні права поза EVO.';
+$_lang["file_folder_created"] = 'Папка успішно створена';
+$_lang["file_folder_deleted"] = 'Папка успішно видалена';
+$_lang["file_folder_not_created"] = 'Неможливо створити папку';
+$_lang["file_folder_not_deleted"] = 'Неможливо видалити папку. Переконайтеся, що вона порожня';
+$_lang["file_not_deleted"] = 'Помилка';
+$_lang["file_not_saved"] = 'Неможливо зберегти файл';
+$_lang["file_saved"] = 'Файл збережено';
+$_lang["file_unzip"] = 'Архів успішно розпакований';
+$_lang["file_unzip_fail"] = 'Архів не вдалося розпакувати';
+$_lang["filemanager_path_message"] = 'Часто IIS неправильно виводить параметр document_root, який використовується файл-менеджером. Встановіть правильний шлях, щоб уникнути проблем із файл-менеджером.';
+$_lang["filemanager_path_title"] = 'Шлях для файл-менеджера:';
+$_lang["files_access_denied"] = 'Доступ заборонено';
+$_lang["files_data"] = 'Сумарний об\'єм';
+$_lang["files_dir_listing"] = 'Список файлів у папці: ';
+$_lang["files_directories"] = 'Папки';
+$_lang["files_directory_is_empty"] = 'У цій папці немає файлів.';
+$_lang["files_dirwritable"] = 'Дозволений запис до папки?';
+$_lang["files_editfile"] = 'Редагувати файл';
+$_lang["files_file_type"] = 'Тип файлу: ';
+$_lang["files_filename"] = 'Ім\'я файлу';
+$_lang["files_fileoptions"] = 'Параметри';
+$_lang["files_files"] = 'Файли';
+$_lang["files_filesize"] = 'Розмір файлу';
+$_lang["files_filetype_notok"] = 'Завантаження файлів такого типу заборонено';
+$_lang["files_management"] = 'Файли';
+$_lang["files_management_no_permission"] = 'У вас немає достатньо прав для перегляду або редагування цих файлів. Зверніться до адміністратора, щоб надати вам доступ до %s .';
+$_lang["files_modified"] = 'Змінено';
+$_lang["files_top_level"] = 'На кореневий рівень';
+$_lang["files_up_level"] = 'На рівень вище';
+$_lang["files_upload_copyfailed"] = 'Не вдалося скопіювати файл у потрібну папку - завантаження перервано!';
+$_lang["files_upload_error"] = 'Помилка';
+$_lang["files_upload_error0"] = 'Повстала проблема під час завантаження.';
+$_lang["files_upload_error1"] = 'Файл, який ви намагаєтесь завантажити, занадто великий.';
+$_lang["files_upload_error2"] = 'Файл, який ви намагаєтесь завантажити, занадто великий.';
+$_lang["files_upload_error3"] = 'Файл, який ви намагалися завантажити, завантажено лише частково.';
+$_lang["files_upload_error4"] = 'Ви повинні вибрати файл для завантаження.';
+$_lang["files_upload_error5"] = 'Виникли проблеми із завантаженням.';
+$_lang["files_upload_inhibited_msg"] = 'Функція завантаження файлів на сервер файлів недоступна - переконайтеся, що папка доступна PHP для запису.';
+$_lang["files_upload_ok"] = 'Файл успішно завантажено';
+$_lang["files_upload_permissions_error"] = 'Можлива помилка прав доступу - папка, в яку ви хочете завантажити дані, не доступна для запису на вашому сервері.';
+$_lang["files_uploadfile"] = 'Завантажити';
+$_lang["files_uploadfile_msg"] = 'Виберіть файли для завантаження:';
+$_lang["files_uploading"] = 'Завантажується файл %s у %s/ ';
+$_lang["files_viewfile"] = 'Перегляд файлу';
+$_lang["folder"] = 'Папка';
+$_lang["forgot_password_email_fine_print"] = '* Вказана адреса стане недійсною, як тільки ви зміните пароль (або автоматично післязавтра).';
+$_lang["forgot_password_email_instructions"] = 'Звідти ви зможете змінити свій пароль, редагуючи обліковий запис.';
+$_lang["forgot_password_email_intro"] = 'Було зроблено запит на зміну пароля вашого облікового запису.';
+$_lang["forgot_password_email_link"] = 'Натисніть тут, щоб завершити процес.';
+$_lang["forgot_your_password"] = 'Забули свій пароль?';
+$_lang["friday"] = 'П\'ятниця';
+$_lang["friendly_alias_message"] = 'Якщо сайт використовує дружні URL, і ресурс має псевдонім, то при включенні цього параметра URL ресурсу матиме вигляд: \'http://mysite.com/псевдонім\'. Якщо визначено суфікс (наприклад \'.html\') та/або префікс (наприклад \'page-\') дружніх URL, адреса сторінки буде така: \'http://mysite.com/page-псевдонім.html\' . Якщо не задані псевдоніми, суфікси та префікси, EVO згенерує таку URL: \'http://mysite.com/2\', де 2 - ID ресурсу.';
+$_lang["friendly_alias_title"] = 'Використовувати псевдоніми в URL:';
+$_lang["friendlyurls_message"] = 'Даний параметр дає можливість використання дружніх URL-адрес на сайті. Пам\'ятайте, що ця можливість доступна лише тоді, коли EVO працює на сервері Apache із встановленим mod_rewrite; Крім того, потрібно змінити файл .htaccess. Для отримання детальної інформації дивіться файл .htaccess, який входить до дистрибутиву EVO.';
+$_lang["friendlyurls_title"] = 'Використовувати дружні URL:';
+$_lang["friendlyurlsprefix_message"] = 'Тут можна вказати особливий префікс для дружніх URL. Наприклад, якщо в якості такого префікса ви вкажете слово \'page\', то URL типу /index.php?id=2 буде перетворено на /page2.html (як суфікс URL тут виступає \'.html\').' ;
+$_lang["friendlyurlsprefix_title"] = 'Префікс для дружніх URL:';
+$_lang["friendlyurlsuffix_message"] = 'Тут можна вказати суфікс для дружніх URL. Вказавши \'.html\', ви додасте .html до всіх дружніх URL.';
+$_lang["friendlyurlsuffix_title"] = 'Суфікс для дружніх URL:';
+$_lang["functionnotimpl"] = 'На жаль';
+$_lang["functionnotimpl_message"] = 'Ця функція ще не використовується цією версією EVO.';
+$_lang["further_info"] = 'Докладна інформація';
+$_lang["global_tabs"] = 'Глобальні вкладки';
+$_lang["go"] = 'Перейти';
+$_lang["group_access_permissions"] = 'Доступ груп користувачів';
+$_lang['group_tvs'] = 'Групувати ТV-параметри';
+$_lang["guid"] = 'GUID';
+$_lang["help"] = 'Допомога';
+$_lang["help_msg"] = 'Ви можете отримати безкоштовну допомогу спільноти EVO на форумах EVO . Дивіться також \'Документація та уроки з EVO\' , де докладно описано кожен аспект системи.
';
+$_lang["help_title"] = 'Допомога';
+$_lang["hide_tree"] = 'Сховати дерево';
+$_lang["home"] = 'Головна';
+$_lang["htmlsnippet"] = 'Чанк';
+$_lang["htmlsnippets"] = 'Чанки';
+$_lang["htmlsnippet_desc"] = 'Опис';
+$_lang["htmlsnippet_management_msg"] = 'Чанки - це шматки (X)HTML-коду, які використовуються в незмінному вигляді в декількох місцях. Щоб мати можливість централізовано редагувати код, що повторюється, винесіть його в чанк. Чанки не можуть прямо містити виконуваний код, однак можуть включати виклики сніппетів та/або параметрів (TV) , що забезпечують динамічну логіку.Використання: вставте {{chunkName}} десь у шаблоні , у області контенту , в коді іншого чанка або в параметрі (TV) .
Виклик через EVO API: $modx->getChunk(\'chunkName\'); $modx->putChunk(\'chunkName\');
Виберіть чанк для редагування або створіть новий.';
+$_lang["htmlsnippet_msg"] = 'Тут можна створити / відредагувати чанк. Пам\'ятайте, чанки – чистий HTML-код, і будь-які php-скрипти виконуватись у них не будуть.';
+$_lang["htmlsnippet_name"] = 'Назва чанка';
+$_lang["htmlsnippet_title"] = 'Створити/редагувати чанк';
+$_lang["icon"] = 'Значок';
+$_lang["icon_description"] = "CSS клас";
+$_lang["id"] = 'ID';
+$_lang["illegal_parent_child"] = 'Зміна батьківського ресурсу: \n\nресурс є дочірнім до обраного.';
+$_lang["illegal_parent_self"] = 'Зміна батьківського ресурсу: \n\nвибраний ресурс не може бути присвоєний як батько самому собі.';
+$_lang["images_management"] = 'Зображення';
+$_lang["import_files_found"] = 'Знайдено %s ресурсів для імпорту... ';
+$_lang["import_params"] = 'Імпортувати загальні параметри модуля';
+$_lang["import_params_msg"] = 'Ви можете імпортувати параметри та установки модуля, вибравши його назву зі списку вгорі.Примітка: щоб модулі відображалися в меню, цей плагін/сніппет повинен бути однією з залежностей модуля і модуля повинні бути включені загальні параметри.';
+$_lang["import_parent_resource"] = 'Батьківський ресурс:';
+$_lang["import_site"] = 'Імпортувати сайт';
+$_lang["import_site_failed"] = 'Помилка';
+$_lang["import_site_failed_db_error"] = 'Під час копіювання ресурсу сталася помилка в базі даних: ';
+$_lang["import_site_failed_no_open_dir"] = 'Неможливо відкрити папку: ';
+$_lang["import_site_failed_no_retrieve_file"] = 'Неможливо вийняти файл: ';
+$_lang["import_site_html"] = 'Імпортувати сайт із HTML';
+$_lang["import_site_importing_document"] = 'Імпортується файл %s ';
+$_lang["import_site_maxtime"] = 'Максимальний час імпорту:';
+$_lang["import_site_maxtime_message"] = 'Тут ви можете вказати скільки секунд може зайняти процес імпорту (перевизначення установок PHP). Введіть 0, щоб встановити необмежений час. Майте на увазі, що 0 або дуже великий проміжок часу, задані для процесу імпорту, можуть призвести до неадекватної роботи сервера, тому такі значення не рекомендується.';
+$_lang["import_site_message"] = 'Використовуючи цю функцію, ви можете імпортувати сайт з HTML до бази даних. Зверніть увагу, що всі HTML-файли потрібно скопіювати в папку \'assets/import\'. Заповніть форму, виберіть батьківський ресурс у дереві сайту та натисніть \'Почати імпорт\' для початку процесу. Файли будуть скопійовані у вказане місце, використовуючи, де можливо, імена файлів як псевдоніми та заголовки сторінок як назви ресурсів. ';
+$_lang["import_site_skip"] = 'Пропущено';
+$_lang["import_site_start"] = 'Почати імпорт';
+$_lang["import_site_success"] = 'Успішно';
+$_lang["import_site_time"] = 'Імпорт завершено. Процес зайняв %s секунд.';
+$_lang["inbox"] = 'Вхідні';
+$_lang["info"] = 'Інформація';
+$_lang["information"] = 'Інформація';
+$_lang["inline"] = 'Відображуване';
+$_lang["insert"] = 'Вставити';
+$_lang["maxImageWidth"] = 'Максимальна ширина зображення';
+$_lang["maxImageHeight"] = 'Максимальна висота зображення';
+$_lang["clientResize"] = 'Зміна розміру зображення на стороні клієнта';
+$_lang["clientResize_message"] = 'Якщо увімкнено, зображення будуть змінюватися браузером до завантаження на сервер';
+$_lang["noThumbnailsRecreation"] = 'Створення ескізів лише при завантаженні зображення';
+$_lang["noThumbnailsRecreation_message"] = 'Файловий менеджер створюватиме ескізи тільки при завантаженні; якщо для деяких зображень немає ескізів, вони не створені';
+$_lang["thumbWidth"] = 'Максимальна ширина прев\'ю';
+$_lang["thumbHeight"] = 'Максимальна висота прев\'ю';
+$_lang["thumbsDir"] = 'Папка для зберігання прев\'ю';
+$_lang["jpegQuality"] = 'Ступінь стиснення JPEG';
+$_lang["denyZipDownload"] = 'Заборонити скачування zip-архівів';
+$_lang["denyExtensionRename"] = 'Заборонити перейменування розширень файлів';
+$_lang["maxImageWidth_message"] = 'Якщо зображення ширше, ніж зазначено, воно буде зменшено. Вкажіть 0, щоб не змінювати ширину зображення під час завантаження.';
+$_lang["maxImageHeight_message"] = 'Якщо зображення вище, ніж зазначено, воно буде зменшено. Вкажіть 0, щоб не змінювати висоту зображення під час завантаження.';
+$_lang["thumbWidth_message"] = 'Максимальна ширина прев\'ю';
+$_lang["thumbHeight_message"] = 'Максимальна висота прев\'ю';
+$_lang["thumbsDir_message"] = 'Назва папки, в якій зберігатимуться прев\'ю';
+$_lang["jpegQuality_message"] = 'Ступінь стиснення зображень та прев\'ю JPEG-формату';
+$_lang["showHiddenFiles"] = 'Показувати приховані файли';
+$_lang["keyword"] = 'Ключове слово';
+$_lang["keywords"] = 'Ключові слова';
+$_lang["keywords_intro"] = 'Для редагування ключового слова просто введіть нове значення поруч із наявним. Для видалення - поставте галочку в поле \'видалити\'.';
+$_lang["language_message"] = 'Виберіть мову системи керування сайтом.';
+$_lang["language_title"] = 'Мова системи управління:';
+$_lang["last_update"] = 'Останні оновлення';
+$_lang["launch_site"] = 'Запустити сайт';
+$_lang["license"] = 'Ліцензія';
+$_lang["link_attributes"] = 'Атрибути посилання';
+$_lang["link_attributes_help"] = 'Тут ви можете ввести атрибути посилання для цієї сторінки, наприклад target="_blank" або rel="external".';
+$_lang["list_mode"] = 'Включити/вимкнути режим списку - використовується для виведення списку записів.';
+$_lang["loading_doc_tree"] = 'Завантажується дерево сайту...';
+$_lang["loading_menu"] = 'Завантажується меню...';
+$_lang["loading_page"] = 'Зачекайте...';
+$_lang["localtime"] = 'Місцевий час';
+$_lang["lock_htmlsnippet"] = 'Обмежити доступ до редагування чанка';
+$_lang["lock_htmlsnippet_msg"] = 'Тільки адміністратори (ID ролі - 1) можуть редагувати цей чанк.';
+$_lang["lock_module"] = 'Обмежити доступ до редагування модуля';
+$_lang["lock_module_msg"] = 'Тільки адміністратори (ID ролі - 1) можуть редагувати цей модуль.';
+$_lang["lock_msg"] = '%s зараз редагує %s . Зачекайте, поки інший користувач закінчить редагування, і спробуйте знову.';
+$_lang["lock_plugin"] = 'Обмежити доступ до редагування плагіна';
+$_lang["lock_plugin_msg"] = 'Тільки адміністратори (ID ролі - 1) мають право редагувати цей плагін.';
+$_lang["lock_settings_msg"] = '%s зараз редагує системні установки. Зачекайте, поки інший користувач закінчить редагування, і спробуйте знову.';
+$_lang["lock_snippet"] = 'Обмежити доступ до редагування сніпету';
+$_lang["lock_snippet_msg"] = 'Тільки адміністратори (ID ролі - 1) можуть редагувати цей сніпет.';
+$_lang["lock_template"] = 'Обмежити доступ до редагування шаблону';
+$_lang["lock_template_msg"] = 'Тільки адміністратори (ID ролі - 1) можуть редагувати цей шаблон.';
+$_lang["lock_tmplvars"] = 'Обмежити доступ до редагування параметра';
+$_lang["lock_tmplvars_msg"] = 'Тільки адміністратори (ID ролі - 1) можуть редагувати цей параметр.';
+$_lang["locked"] = 'Заблоковано';
+$_lang["login_allowed_days"] = 'Дозволені дні';
+$_lang["login_allowed_days_message"] = 'Виберіть дні, в які цей користувач може входити.';
+$_lang["login_allowed_ip"] = 'Дозволена IP-адреса';
+$_lang["login_allowed_ip_message"] = 'Введіть IP-адресу, з якої дозволено заходити цьому користувачеві.Примітка: кілька IP-адрес розділяйте комами (,)';
+$_lang["login_button"] = 'Увійти';
+$_lang["login_cancelled_install_in_progress"] = 'На даний момент виконується встановлення/оновлення сайту. Повторіть спробу за кілька хвилин! ';
+$_lang["login_cancelled_site_was_updated"] = 'Процес встановлення/оновлення сайту завершено успішно. Потрібна повторна авторизація в системі! ';
+$_lang["login_captcha_message"] = 'Введіть код підтвердження. \n\nЯкщо у вас виникли труднощі з прочитанням коду, натисніть на нього, щоб створити новий варіант.';
+$_lang["login_homepage"] = 'Сторінка успішної авторизації';
+$_lang["login_homepage_message"] = 'Введіть ID ресурсу, який завантажиться після успішної авторизації користувача.Примітка: переконайтеся, що цей ID належить існуючому ресурсу, що цей ресурс опублікований і що він доступний для цього користувача';
+$_lang["login_message"] = 'Введіть ваше ім\'я користувача та пароль. Зверніть увагу - малі та великі літери різняться.';
+$_lang["logo_slogan"] = 'Створюйте більше з меншими зусиллями - \nСистема керування сайтом EVO';
+$_lang["logout"] = 'Вийти';
+$_lang["long_title"] = 'Розширений заголовок';
+$_lang["mail_check_timeperiod_message"] = 'Як часто перевіряти наявність нових повідомлень у системі управління, (сек).';
+$_lang["mail_check_timeperiod_title"] = 'Період перевірки пошти:';
+$_lang["manage_depends"] = 'Залежності';
+$_lang["manage_files"] = 'Файли';
+$_lang["manage_htmlsnippets"] = 'Чанки';
+$_lang["manage_metatags"] = 'META-теги та ключові слова';
+$_lang["manage_modules"] = 'Модулі';
+$_lang["manage_plugins"] = 'Плагіни';
+$_lang["manage_snippets"] = 'Сніпети';
+$_lang["manage_templates"] = 'Шаблони';
+$_lang["manage_documents"] = 'Документи';
+$_lang["manager"] = 'Менеджер';
+$_lang["manager_lockout_message"] = 'В даний момент ви перебуваєте в режимі керування сайтом. Щоб завершити сеанс адміністрування, натисніть кнопку "Вийти".
Щоб перейти на головну або стартову сторінку, натисніть кнопку \'Додому\'.';
+$_lang["manager_permissions"] = 'Права менеджерів';
+$_lang["manager_theme"] = 'Шаблон системи керування:';
+$_lang["manager_theme_message"] = 'Виберіть шаблон для системи керування.';
+$_lang["manager_theme_mode"] = 'Схема кольорів:';
+$_lang["manager_theme_mode1"] = 'все світле';
+$_lang["manager_theme_mode2"] = 'шапка темна';
+$_lang["manager_theme_mode3"] = 'шапка та дерево темні';
+$_lang["manager_theme_mode4"] = 'все темне';
+$_lang['manager_theme_mode_message'] = 'Цей параметр використовується як \'за замовчуванням\' і може бути перевизначений при перемиканні режиму кольору теми в дереві документів: ';
+$_lang['manager_theme_mode_title'] = 'Перемикач колірної схеми: 4 схеми';
+$_lang["messages"] = 'Повідомлення';
+$_lang["messages_all"] = 'Всім';
+$_lang["messages_compose"] = 'Написати повідомлення';
+$_lang["messages_forward"] = 'Переслати';
+$_lang["messages_from"] = 'Від';
+$_lang["messages_group"] = 'Група';
+$_lang["messages_inbox"] = 'Поштова скринька';
+$_lang["messages_message"] = 'Повідомлення';
+$_lang["messages_no_messages"] = 'Поштова скринька порожня';
+$_lang["messages_not_allowed_to_read"] = 'Вам заборонено читати ці повідомлення';
+$_lang["messages_private"] = 'Приватне';
+$_lang["messages_read_message"] = 'Читати повідомлення';
+$_lang["messages_reply"] = 'Відповісти';
+$_lang["messages_select_group"] = 'Виберіть групу';
+$_lang["messages_select_user"] = 'Виберіть користувача';
+$_lang["messages_send"] = 'Надіслати';
+$_lang["messages_send_to"] = 'Кому';
+$_lang["messages_sent"] = 'Надіслано';
+$_lang["messages_subject"] = 'Тема';
+$_lang["messages_system_user"] = '[System]';
+$_lang["messages_title"] = 'Повідомлення';
+$_lang["messages_user"] = 'Користувач';
+$_lang["meta_keywords"] = 'Ключові слова';
+$_lang["metatag_intro"] = 'На цій сторінці ви можете створювати/редагувати/вилучати теги META. Щоб прив\'язати теги META до ресурсів, натисніть Ключові слова , коли редагуєте ресурс, і виберіть потрібні ключові слова та теги META. Щоб створити новий тег, введіть його ім\'я та значення та натисніть \'Створити тег\'. Для редагування натисніть назву тега.';
+$_lang["metatag_notice"] = 'Це не повний список можливих мета-тегів. Детальну інформацію щодо використання мета-тегів ви можете отримати тут: HTML Reference Guide .';
+$_lang["metatags"] = 'META-теги';
+$_lang["mgr_access_permissions"] = 'Права доступу менеджерів';
+$_lang["mgr_login_start"] = 'Авторизація менеджера сайту';
+$_lang["mgr_login_start_message"] = 'Введіть ID ресурсу, який ви хочете надіслати користувачеві після авторизації в системі керування сайтом.Примітка: переконайтеся, що ID належить існуючому ресурсу, який опубліковано і доступний цьому користувачеві';
+$_lang["mgrlog_action"] = 'Дія:';
+$_lang["mgrlog_actionid"] = 'ID дії:';
+$_lang["mgrlog_anyall"] = 'Будь-яке / Всі';
+$_lang["mgrlog_datecheckfalse"] = 'Функція checkdate() повернула значення false.';
+$_lang["mgrlog_datefr"] = 'Починаючи з дати';
+$_lang["mgrlog_dateinvalid"] = 'Помилковий формат дати.';
+$_lang["mgrlog_dateto"] = 'Закінчуючи датою';
+$_lang["mgrlog_emptysrch"] = 'За вашим запитом нічого не знайдено (немає записів, що відповідають заданим критеріям).';
+$_lang["mgrlog_field"] = 'Поле';
+$_lang["mgrlog_itemid"] = 'ID ресурсу';
+$_lang["mgrlog_itemname"] = 'Назва ресурсу';
+$_lang["mgrlog_msg"] = 'Повідомлення';
+$_lang["mgrlog_noquery"] = 'Ви не ввели запиту. Вкажіть критерії запиту.';
+$_lang["mgrlog_qresults"] = 'Результати запиту';
+$_lang["mgrlog_query"] = 'Протокол запитів до бази';
+$_lang["mgrlog_query_msg"] = 'Будь ласка, вкажіть критерії перегляду записів.Примітка: вказаний діапазон дат не включає результати за дату, вказану в полі \'Закінчуючи датою\'. Наприклад, щоб зробити вибірку за 25-12-2018, вкажіть у полі \'Починаючи з дати\' значення 25-12-2018, а в полі \'Закінчуючи датою\' - значення 25-12-2018.
Повідомлення та дія зазвичай однакові. Якщо ви хочете знайти якесь конкретне повідомлення, зазвичай найкраще встановити дію \'Будь-яке / Все\'.';
+$_lang["mgrlog_results"] = 'Відображати результати порціями';
+$_lang["mgrlog_searchlogs"] = 'Знайти записи протоколу';
+$_lang["mgrlog_sortinst"] = 'Ви можете відсортувати таблицю, вибравши заголовок будь-якої колонки. Якщо записів буде занадто багато, можна очистити протокол . УВАГА: це призведе до видалення всіх записів протоколу до сьогодні! ';
+$_lang["mgrlog_time"] = 'Час';
+$_lang["mgrlog_user"] = 'Користувач';
+$_lang["mgrlog_username"] = 'Ім\'я користувача';
+$_lang["mgrlog_value"] = 'Значення';
+$_lang["mgrlog_view"] = 'Перегляд записів протоколу системи управління сайтом';
+$_lang["module_code"] = 'Код модуля (php)';
+$_lang["module_config"] = 'Конфігурація модуля';
+$_lang["module_desc"] = 'Опис';
+$_lang["module_disabled"] = 'Модуль вимкнено';
+$_lang["module_edit_click_title"] = 'Натисніть, щоб редагувати модуль';
+$_lang["module_group_access_msg"] = 'Виберіть групи користувачів, які можуть запускати цей модуль.';
+$_lang["module_management"] = 'Модулі';
+$_lang["module_management_msg"] = 'Модуль - це програма, заснована на архітектурі EVO та розширює можливості системи управління. Модуль може групувати набір елементів (сніпети , чанки , дані ), реалізуючи принцип інкапсуляції через поділ інтерфейсу та реалізації.
Виберіть модуль, який потрібно запустити або змінити, або створіть новий модуль. Для запуску модуля натисніть на значок поруч із його ім\'ям, для редагування модуля натисніть його назву.';
+$_lang["module_msg"] = 'Тут ви можете створювати/редагувати модулі. Модуль - це набір елементів (плагінів, сніппетів тощо).';
+$_lang["module_name"] = 'Назва модуля';
+$_lang["module_resource_msg"] = 'Тут ви можете додати/видалити елементи, від яких залежить цей модуль. Щоб додати новий елемент, натисніть одну з клавіш внизу.';
+$_lang["module_resource_title"] = 'Залежність модуля';
+$_lang["module_title"] = 'Створити/редагувати модуль';
+$_lang["module_viewdepend_msg"] = 'Тут можна переглянути, від яких елементів залежить цей модуль. Щоб змінити залежність, натисніть \'Залежність\'.';
+$_lang["modules"] = 'Модулі';
+$_lang["modx_news"] = 'Новини EVO';
+$_lang["modx_news_tab"] = 'Новини EVO';
+$_lang["modx_news_title"] = 'Новини EVO';
+$_lang["modx_security_notices"] = 'Оповіщення безпеки EVO';
+$_lang["modx_version"] = 'Версія EVO';
+$_lang["monday"] = 'Понеділок';
+$_lang["move"] = 'Перемістити';
+$_lang["move_resource"] = 'Перемістити';
+$_lang["move_resource_message"] = 'Ви можете перемістити ресурс і всі його дочірні ресурси, вибравши новий \'батьківський\' ресурс. Якщо ви виберете як батьківський ресурс, який не є папкою, EVO автоматично зробить його папкою. Виберіть новий \'батьківський ресурс\' у дереві сайту ліворуч.';
+$_lang["move_resource_new_parent"] = 'Виберіть новий \'батьківський\' ресурс у дереві сайту зліва.';
+$_lang["move_resource_title"] = 'Перемістити';
+$_lang["name"] = 'Назва';
+$_lang["new_category"] = 'Нова категорія';
+$_lang["new_file_permissions_message"] = 'При завантаженні нового файлу за допомогою файл-менеджера буде зроблено спробу встановити права на файл відповідно до вказаного тут значення. На деяких системах автоматичне встановлення прав може бути недоступне (зокрема, при використанні IIS) - у такому разі необхідно буде встановити відповідні права вручну.';
+$_lang["new_file_permissions_title"] = 'Права на новий файл:';
+$_lang["new_folder_permissions_message"] = 'Під час створення нової папки за допомогою файл-менеджера буде спроба встановити права на папку відповідно до вказаного тут значення. На деяких системах автоматичне встановлення прав може бути недоступне (зокрема, при використанні IIS) - у такому разі необхідно буде встановити відповідні права вручну.';
+$_lang["new_folder_permissions_title"] = 'Права на нову папку:';
+$_lang["new_htmlsnippet"] = 'Новий чанк';
+$_lang["new_keyword"] = 'Додати ключове слово:';
+$_lang["new_module"] = 'Новий модуль';
+$_lang["new_parent"] = 'Новий батьківський ресурс';
+$_lang["new_plugin"] = 'Новий плагін';
+$_lang["new_role"] = 'Нова роль';
+$_lang["new_snippet"] = 'Новий сніпет';
+$_lang["new_template"] = 'Новий шаблон';
+$_lang["new_tmplvars"] = 'Новий параметр (TV)';
+$_lang["new_user"] = 'Новий користувач';
+$_lang["new_web_user"] = 'Новий веб-користувач';
+$_lang["new_resource"] = 'Новий ресурс';
+$_lang["no"] = 'Ні';
+$_lang["no_active_users_found"] = 'Не знайдено активних користувачів.';
+$_lang["no_activity_message"] = 'Ви не створили або не редагували жодного ресурсу.';
+$_lang["no_category"] = 'Без категорії';
+$_lang["no_docs_pending_publishing"] = 'Немає ресурсів, які чекають на публікацію.';
+$_lang["no_docs_pending_pubunpub"] = 'Події не знайдені.';
+$_lang["no_docs_pending_unpublishing"] = 'Немає ресурсів, які чекають на скасування публікації.';
+$_lang["no_edits_creates"] = 'Створених або редагованих ресурсів не виявлено.';
+$_lang["no_groups_found"] = 'Груп не знайдено.';
+$_lang["no_keywords_found"] = 'Ключових слів немає.';
+$_lang["no_records_found"] = 'Не знайдено записів.';
+$_lang["no_results"] = 'Нічого не знайдено';
+$_lang["nologentries_message"] = 'Виберіть кількість записів протоколу на сторінці під час перегляду.';
+$_lang["nologentries_title"] = 'Кількість записів протоколу:';
+$_lang["nomessages_message"] = 'Виберіть кількість повідомлень на сторінці під час їх перегляду.';
+$_lang["nomessages_title"] = 'Кількість повідомлень:';
+$_lang["none"] = 'Ні';
+$_lang["noresults_message"] = 'Введіть кількість елементів, що відображаються у списках та результатах пошуку.';
+$_lang["noresults_title"] = 'Кількість результатів:';
+$_lang["not_deleted"] = 'не видалено.';
+$_lang["not_set"] = 'немає даних';
+$_lang["offline"] = 'Оффлайн';
+$_lang["online"] = 'Онлайн';
+$_lang["onlineusers_action"] = 'Дія';
+$_lang["onlineusers_actionid"] = 'ID дії';
+$_lang["onlineusers_ipaddress"] = 'IP-адреса відвідувача сайту';
+$_lang["onlineusers_lasthit"] = 'Момент останньої дії';
+$_lang["onlineusers_message"] = 'Цей список показує всіх користувачів, активних протягом останніх 20 хвилин (поточний час - ';
+$_lang["onlineusers_title"] = 'Користувачі онлайн';
+$_lang["onlineusers_user"] = 'Користувач';
+$_lang["onlineusers_userid"] = 'ID користувача';
+$_lang["optimize_table"] = 'Натисніть, щоб оптимізувати таблицю';
+$_lang["page_data_alias"] = 'Псевдонім';
+$_lang["page_data_cacheable"] = 'Кешований';
+$_lang["page_data_cacheable_help"] = 'Позначте, щоб дозволити кешування ресурсу. Будьте уважні в тому випадку, якщо ресурс містить виклики сніпетів - можливо, краще скасувати кешування.';
+$_lang["page_data_cached"] = 'Код взятий із кешу: ';
+$_lang["page_data_changes"] = 'Створення та зміна';
+$_lang["page_data_contentType"] = 'Тип вмісту';
+$_lang["page_data_contentType_help"] = 'Виберіть тип вмісту ресурсу. Якщо ви не впевнені, який тип даних повинен бути у ресурсу, залиште text/html.';
+$_lang["page_data_created"] = 'Створено';
+$_lang["page_data_edited"] = 'Редагувався';
+$_lang["page_data_editor"] = 'Використовувати HTML-редактор';
+$_lang["page_data_folder"] = 'Ресурс є контейнером';
+$_lang["page_data_general"] = 'Загальні';
+$_lang["page_data_markup"] = 'Розмітка/структура';
+$_lang["page_data_mgr_access"] = 'Менеджерський доступ';
+$_lang["page_data_notcached"] = 'Ресурс ще не кешувався.';
+$_lang["page_data_publishdate"] = 'Дата публікації';
+$_lang["page_data_publishdate_help"] = 'Якщо ви встановите дату публікації, ресурс буде опубліковано після настання цієї дати. Натисніть значок календаря, щоб вибрати дату, або значок поряд, щоб видалити дату публікації. Це означатиме, що ресурс не буде публікуватися автоматично.';
+$_lang["page_data_published"] = 'Опубліковано';
+$_lang["page_data_searchable"] = 'Доступний для пошуку';
+$_lang["page_data_searchable_help"] = 'Позначте, щоб дозволити пошук у вмісті цього ресурсу (внутрішньою пошуковою машиною). Цей параметр також можна використовувати при розробці сніпетів.';
+$_lang["page_data_source"] = 'Код';
+$_lang["page_data_status"] = 'Статус';
+$_lang["page_data_template"] = 'Шаблон';
+$_lang["page_data_template_help"] = 'Тут можна вказати, який шаблон має використовувати ресурс. Виберіть (blank), якщо хочете, щоб ресурс не використовував жодних шаблонів (рекомендується для порожніх ресурсів, що виконують роль контейнера).';
+$_lang["page_data_title"] = 'Дані ресурсу (сторінки)';
+$_lang["page_data_unpublishdate"] = 'Дата скасування публікації';
+$_lang["page_data_unpublishdate_help"] = 'Якщо ви встановите дату скасування публікації, ресурс буде знято з публікації після настання цієї дати. Натисніть значок календаря, щоб вибрати дату, або значок поряд, щоб видалити дату скасування публікації. Це означатиме, що ресурс не буде знято з публікації автоматично.';
+$_lang["page_data_unpublished"] = 'Не опубліковано';
+$_lang["page_data_web_access"] = 'Веб-доступ';
+$_lang["pagetitle"] = 'Заголовок ресурсу';
+$_lang["pagination_table_first"] = 'Перший';
+$_lang["pagination_table_gotopage"] = 'Перейти на';
+$_lang["pagination_table_last"] = 'Останній';
+$_lang["paging_first"] = 'На початок';
+$_lang["paging_last"] = 'Наприкінці';
+$_lang["paging_next"] = 'Далі';
+$_lang["paging_prev"] = 'Назад';
+$_lang["paging_showing"] = 'Відображаються записи з';
+$_lang["paging_to"] = 'по';
+$_lang["paging_total"] = 'всього';
+$_lang["parameter"] = 'Параметр';
+$_lang["parse_docblock"] = 'Аналізувати DocBlock';
+$_lang["parse_docblock_msg"] = 'Увага (!): Скидання актуального імені, конфігурації, опису та категорії для встановлення дефолту шляхом аналізу вихідного коду.';
+$_lang["password"] = 'Пароль';
+$_lang["password_change_request"] = 'Запит на зміну пароля';
+$_lang["password_gen_gen"] = 'Дозволити EVO згенерувати пароль.';
+$_lang["password_gen_length"] = 'Пароль повинен містити мінімум 6 символів.';
+$_lang["password_gen_method"] = 'Спосіб завдання нового пароля';
+$_lang["password_gen_specify"] = 'Я сам задам пароль:';
+$_lang["password_method"] = 'Спосіб сповіщення про новий пароль';
+$_lang["password_method_email"] = 'Надіслати новий пароль по e-mail.';
+$_lang["password_method_screen"] = 'Показати новий пароль на екрані.';
+$_lang["password_msg"] = 'Для користувача %s задано новий пароль - %s ';
+$_lang["php_version_check"] = 'Система EVO працює з PHP версії 5.6.0 або вищою. Будь ласка, оновіть PHP';
+$_lang["plugin"] = 'Плагін';
+$_lang["plugins"] = 'Плагіни';
+$_lang["plugin_code"] = 'Код плагіна (php)';
+$_lang["plugin_config"] = 'Конфігурація плагіна';
+$_lang["plugin_desc"] = 'Опис';
+$_lang["plugin_disabled"] = 'Плагін вимкнено';
+$_lang["plugin_event_msg"] = 'Виберіть події, які слід відстежувати плагін.';
+$_lang["plugin_management_msg"] = 'Плагіни - це інтерактивні PHP-скрипти, що запускаються при настанні події, яку вони відстежують.
Виберіть плагін для редагування або створіть новий. Також ви можете встановити порядок виклику плагінів при настанні подій, які вони обробляють.';
+$_lang["plugin_msg"] = 'Тут можна створити / відредагувати плагін.';
+$_lang["plugin_name"] = 'Назва плагіна';
+$_lang["plugin_priority"] = 'Редагувати порядок виклику плагінів';
+$_lang["plugin_priority_instructions"] = 'Перетягніть мишею для визначення порядку виконання плагінів для кожної події. Спочатку виконується перший у списку плагін.';
+$_lang["plugin_priority_title"] = 'Порядок виклику плагінів';
+$_lang["purge_plugin"] = 'Видалення старих плагінів';
+$_lang["purge_plugin_confirm"] = 'Ви дійсно хочете видалити застарілі плагіни?';
+$_lang["plugin_title"] = 'Створити/редагувати плагін';
+$_lang["preview"] = 'Перегляд';
+$_lang["preview_msg"] = 'Перегляд останніх змін. Зберегти та оновити останні зміни';
+$_lang["preview_resource"] = 'Перегляд';
+$_lang["private"] = 'Особистий';
+$_lang["public"] = 'Доступний для всіх';
+$_lang["publish_date"] = 'Дата публікації';
+$_lang["publish_events"] = 'Події, пов\'язані з публікацією ресурсів.';
+$_lang["publish_resource"] = 'Опублікувати';
+$_lang["rb_base_dir_message"] = 'Введіть шлях до папки файлів. Зазвичай, цей шлях встановлюється автоматично. Якщо ви використовуєте сервер IIS, цього може статися. У такому разі введіть шлях, як він відображається в адресному рядку Internet Explorer.Примітка: для коректної роботи браузера папка файлів повинна містити вкладені папки: images, files, flash та media.';
+$_lang["rb_base_dir_title"] = 'Шлях до файлів:';
+$_lang["rb_base_url_message"] = 'Введіть адресу (URL) папки файлів. Зазвичай, цей шлях встановлюється автоматично. Якщо ви використовуєте сервер IIS, цього може не статися. У такому разі введіть шлях, як він відображається в Internet Explorer.';
+$_lang["rb_base_url_title"] = 'URL до файлів:';
+$_lang["rb_message"] = 'Виберіть \'Так\', щоб увімкнути браузер файлів. Це дозволить менеджерам завантажувати файли (зображення, медіа-файли) на сервер.';
+$_lang["rb_title"] = 'Увімкнути файл-менеджер:';
+$_lang["rb_webuser_message"] = 'Чи хочете, щоб веб-користувачі використовували файл-менеджер? Примітка: Дозволяючи веб-користувачам використовувати файл-менеджер, ви робите доступ для всіх файлів, доступних менеджерам. Використовуйте це налаштування лише для перевірених веб-користувачів.';
+$_lang["rb_webuser_title"] = 'Користувачі?';
+$_lang["recent_docs"] = 'Останні зміни';
+$_lang["recommend_setting_change_title"] = 'Рекомендована зміна налаштування';
+$_lang["recommend_setting_change_description"] = 'Ваш сайт не налаштований на перевірку серверних заголовків HTTP_REFERER у вхідних запитах до системи керування. Ми рекомендуємо включити цей параметр, щоб знизити ризик CSRF (Cross Site Request Forgery - підробка міжсайтових запитів) атак.';
+$_lang["references"] = 'Рекомендації';
+$_lang["refresh_cache"] = 'Кеш: знайдено %s файлів у папці кешування та видалено %d кеш-файлів.
Нові кеш-файли будуть створені при запити сторінок.';
+$_lang["refresh_published"] = '%s ресурсів опубліковано.';
+$_lang["refresh_site"] = 'Очистити кеш';
+$_lang["refresh_title"] = 'Оновити сайт';
+$_lang["refresh_tree"] = 'Оновити дерево';
+$_lang["refresh_unpublished"] = '%s ресурсів знято з публікації.';
+$_lang["release_date"] = 'Дата випуску';
+$_lang["remember_last_tab"] = 'Запам\'ятовувати вкладки';
+$_lang["remember_last_tab_message"] = 'Відкривається не перша вкладка, а використовувана під час останнього відвідування';
+$_lang["remember_username"] = 'Запам\'ятати мене';
+$_lang["remove"] = 'Видалити';
+$_lang["remove_date"] = 'Видалити дату';
+$_lang["remove_locks"] = 'Видалити блокування';
+$_lang["rename"] = 'Перейменувати';
+$_lang["reports"] = 'Звіти';
+$_lang["report_issues"] = 'Повідомити про проблеми';
+$_lang["require_tagname"] = 'Назва тега обов\'язково';
+$_lang["require_tagvalue"] = 'Значення тега є обов\'язковим';
+$_lang["reserved_name_warning"] = 'Ви використовували зарезервоване ім\'я.';
+$_lang["reset"] = 'Скидання';
+$_lang["reset_failedlogins"] = 'скидання';
+$_lang["reset_sort_order"] = 'Скидання сортування';
+$_lang["resource"] = 'Ресурс';
+$_lang["resource_alias"] = 'Псевдонім';
+$_lang["resource_alias_help"] = 'Тут ви можете вибрати псевдонім для ресурсу. Псевдонім дозволяє звертатися до ресурсу за адресою http://example.com/псевдонім. УВАГА: функція буде працювати тільки при включених \'дружніх URL\'.';
+$_lang["resource_content"] = 'Вміст ресурсу';
+$_lang["resource_description"] = 'Опис';
+$_lang["resource_description_help"] = 'Тут можна ввести опис ресурсу.';
+$_lang["resource_duplicate"] = 'Зробити копію';
+$_lang["resource_long_title_help"] = 'Тут ви можете ввести розширений заголовок вашого ресурсу, що може бути корисним для пошукових систем.';
+$_lang["resource_metatag_help"] = 'Виберіть теги META та ключові слова, які ви бажаєте надати цьому ресурсу. Щоб вибрати кілька ключових слів або МЕТА-тегів, натискайте на них мишкою, утримуючи Ctrl.';
+$_lang["resource_opt_contentdispo"] = 'Місцезнаходження вмісту';
+$_lang["resource_opt_contentdispo_help"] = 'Цей параметр визначає, як браузер повинен обробити ресурс. Щоб ресурс став доступним для завантаження, а не відображався у вікні браузера, виберіть \'Прикріплене\'.';
+$_lang["resource_opt_emptycache"] = 'Очистити кеш';
+$_lang["resource_opt_emptycache_help"] = 'Позначте, щоб очистити кеш після збереження змін цього ресурсу. У цьому випадку відвідувачі побачать нову версію ресурсу.';
+$_lang["resource_opt_folder"] = 'Контейнер (містить дочірні ресурси)';
+$_lang["resource_opt_folder_help"] = 'Позначте, щоб ресурс виконував роль папки (батька) для інших ресурсів. Не варто звертати увагу на цей параметр – EVO автоматично встановить для ресурсу режим папки, якщо всередині нього почнуть створюватися ресурси.';
+$_lang["resource_opt_menu_index"] = 'Позиція в меню';
+$_lang["resource_opt_menu_index_help"] = 'Позиція (індекс) у меню – це порядковий номер ресурсу в меню. Цю величину можна також використовувати у розробці сніпетів.';
+$_lang["resource_opt_menu_title"] = 'Пункт меню';
+$_lang["resource_opt_menu_title_help"] = 'Пункт меню - це параметр, який можна використовувати для відображення короткого заголовка ресурсу в меню.';
+$_lang["resource_opt_published"] = 'Публікувати';
+$_lang["resource_opt_published_help"] = 'Позначте, щоб опублікувати ресурс одразу після збереження.';
+$_lang["resource_opt_richtext"] = 'Використовувати HTML-редактор';
+$_lang["resource_opt_richtext_help"] = 'Позначте, щоб для редагування ресурсу використовувався HTML-редактор. Якщо ресурс містить JavaScript або форми - зніміть галочку, щоб редагувати його в режимі HTML-коду (щоб HTML-редактор не вносив жодних змін до коду).';
+$_lang["resource_opt_show_menu"] = 'Показувати в меню';
+$_lang["resource_opt_show_menu_help"] = 'Увімкніть цей параметр для відображення ресурсу в будь-якому меню сайту. Майте на увазі, що деякі сніпети можуть ігнорувати цей параметр.';
+$_lang["resource_opt_trackvisit_help"] = 'Позначте, щоб показувати дочірні ресурси у дереві документів';
+$_lang["resource_overview"] = 'Огляд ресурсу';
+$_lang["resource_parent"] = 'Папка';
+$_lang["resource_parent_help"] = 'Клацніть мишею на піктограмі контейнера вгорі, щоб увімкнути (вимкнути) режим вибору батьківського ресурсу, потім виберіть його в дереві сайту ліворуч.';
+$_lang["resource_permissions_error"] = 'Зв\'яжіть цей ресурс принаймні з однією групою ресурсів, до якої ви маєте доступ.';
+$_lang["resource_setting"] = 'Налаштування ресурсу';
+$_lang["resource_summary"] = 'Анотація (введення)';
+$_lang["resource_summary_help"] = 'Введіть короткий опис ресурсу';
+$_lang["resource_title"] = 'Заголовок';
+$_lang["resource_title_help"] = 'Введіть ім\'я/заголовок ресурсу. Небажано використовувати зворотний слеш (\)';
+$_lang["resource_to_be_moved"] = 'Переміщуваний ресурс';
+$_lang["resource_type"] = 'Тип ресурсу';
+$_lang["resource_type_message"] = 'Веб-посилання на ресурс в Інтернеті, включаючи інші ресурси EVO, зовнішні веб-сторінки, зображення або інші файли в Інтернеті. Для ресурсу повинен бути заданий тип вмісту text/html, а місцезнаходження вмісту - відображається.';
+$_lang["resource_type_weblink"] = 'Веб-посилання';
+$_lang["resource_type_webpage"] = 'Веб-сторінка';
+$_lang["resource_weblink_help"] = 'Введіть адресу (URI) об\'єкта в мережі, на яку має вказувати веб-посилання.';
+$_lang["resources_in_container"] = '- кількість ресурсів у контейнері';
+$_lang["resources_in_container_no"] = 'Поточний контейнер не містить дочірніх ресурсів.';
+$_lang["role"] = 'Роль';
+$_lang["role_about"] = 'Перегляд інформації про систему';
+$_lang["role_access_persmissions"] = 'Менеджерський доступ';
+$_lang["role_actionok"] = 'Перегляд сторінки підтвердження завершення дії';
+$_lang["role_assets_images"] = 'Доступ до assets/images';
+$_lang["role_assets_files"] = 'Доступ до assets/files';
+$_lang["role_bk_manager"] = 'Використовувати резервне копіювання';
+$_lang["role_cache_refresh"] = 'Очищення кешу';
+$_lang["role_category_manager"] = 'Використовувати менеджер категорій';
+$_lang["role_change_password"] = 'Зміна пароля';
+$_lang["role_change_resourcetype"] = 'Зміна типу ресурсу';
+$_lang["role_chunk_management"] = 'Чанки';
+$_lang["role_config_management"] = 'Зміна конфігурації';
+$_lang["role_content_management"] = 'Вміст';
+$_lang["role_create_chunk"] = 'Створення нових чанків';
+$_lang["role_create_doc"] = 'Створення нових ресурсів';
+$_lang["role_create_plugin"] = 'Створення нових плагінів';
+$_lang["role_create_snippet"] = 'Створення нових сніпетів';
+$_lang["role_create_template"] = 'Створення нових шаблонів';
+$_lang["role_credits"] = 'Перегляд списку розробників';
+$_lang["role_delete_chunk"] = 'Видалення чанків';
+$_lang["role_delete_doc"] = 'Видалення ресурсів';
+$_lang["role_delete_eventlog"] = 'Видалення протоколу подій';
+$_lang["role_delete_module"] = 'Видалення модулів';
+$_lang["role_delete_plugin"] = 'Видалення плагінів';
+$_lang["role_delete_role"] = 'Видалення ролей';
+$_lang["role_delete_snippet"] = 'Видалення сніпетів';
+$_lang["role_delete_template"] = 'Видалення шаблонів';
+$_lang["role_delete_user"] = 'Видалення користувачів';
+$_lang["role_delete_web_user"] = 'Видалення веб-користувачів';
+$_lang["role_edit_chunk"] = 'Редагування чанків';
+$_lang["role_edit_doc"] = 'Редагування ресурсів';
+$_lang["role_edit_doc_metatags"] = 'Редагувати META-теги та ключові слова';
+$_lang["role_edit_module"] = 'Редагування модулів';
+$_lang["role_edit_plugin"] = 'Редагування плагінів';
+$_lang["role_edit_role"] = 'Редагування ролей';
+$_lang["role_edit_settings"] = 'Змінювати конфігурацію сайту';
+$_lang["role_edit_snippet"] = 'Редагування сніпетів';
+$_lang["role_edit_template"] = 'Редагування шаблонів';
+$_lang["role_edit_user"] = 'Редагування користувачів';
+$_lang["role_edit_web_user"] = 'Редагування веб-користувачів';
+$_lang["role_empty_trash"] = 'Очищення кошика';
+$_lang["role_errors"] = 'Перегляд діалогу помилки';
+$_lang["role_eventlog_management"] = 'Протокол подій';
+$_lang["role_export_static"] = 'Експорт статичних сторінок в HTML';
+$_lang["role_file_management"] = 'Файли';
+$_lang["role_file_manager"] = 'Використання файл-менеджера';
+$_lang["role_frames"] = 'Запит менеджерських кадрів';
+$_lang["role_help"] = 'Перегляд сторінок допомоги';
+$_lang["role_home"] = 'Запит на вхідну сторінку менеджера';
+$_lang["role_import_static"] = 'Імпорт HTML';
+$_lang["role_logout"] = 'Вихід із системи управління';
+$_lang["role_manage_metatags"] = 'META-теги та ключові слова';
+$_lang["role_management_msg"] = 'Роль - це набір прав здійснювати певні дії. Ролі призначаються користувачам. Типові ролі:
Адміністратори сайту - керують користувачами та загальними налаштуваннями;Розробники - пишуть код і, відповідно, мають набір прав на створення / редагування / видалення модулів , плагінів , сніппетів< /i>, чанків , параметрів (TV) ; Дизайнери - відповідають за зовнішній вигляд та верстку сторінок сайту, мають набір прав на створення / редагування / видалення шаблонів та чанків ; Редактори - відповідають за зміст сторінок сайту, створюють, редагують та видаляють ресурси; Коректори - читають та коригують ресурси, але не мають прав на їх створення та видалення; >Головний редактор - приймає рішення про публікацію нових ресурсів, керує розкладом публікації. Виберіть роль для редагування або створіть нову роль.';
+$_lang["role_management_title"] = 'Ролі';
+$_lang["role_messages"] = 'Читати та надсилати повідомлення';
+$_lang["role_module_management"] = 'Модулі';
+$_lang["role_name"] = 'Назва ролі';
+$_lang["role_new_module"] = 'Створення нових модулів';
+$_lang["role_new_role"] = 'Створення нових ролей';
+$_lang["role_new_user"] = 'Створення нових користувачів';
+$_lang["role_new_web_user"] = 'Створення веб-користувачів';
+$_lang["role_plugin_management"] = 'Плагіни';
+$_lang["role_publish_doc"] = 'Публікація ресурсів';
+$_lang["role_remove_locks"] = 'Видалити блокування';
+$_lang["role_role_management"] = 'Ролі';
+$_lang["role_run_module"] = 'Запуск модулів';
+$_lang["role_save_chunk"] = 'Збереження чанків';
+$_lang["role_save_doc"] = 'Збереження ресурсів';
+$_lang["role_save_module"] = 'Збереження модулів';
+$_lang["role_save_password"] = 'Збереження пароля';
+$_lang["role_save_plugin"] = 'Збереження плагінів';
+$_lang["role_save_role"] = 'Збереження ролей';
+$_lang["role_save_snippet"] = 'Збереження сніпетів';
+$_lang["role_save_template"] = 'Збереження шаблонів';
+$_lang["role_save_user"] = 'Збереження користувачів';
+$_lang["role_save_web_user"] = 'Збереження веб-користувачів';
+$_lang["role_snippet_management"] = 'Сніппети';
+$_lang["role_template_management"] = 'Шаблони';
+$_lang["role_title"] = 'Створити/редагувати роль';
+$_lang["role_udperms"] = 'Доступ';
+$_lang["role_user_management"] = 'Користувачі';
+$_lang["role_view_docdata"] = 'Перегляд інформації про ресурс';
+$_lang["role_view_eventlog"] = 'Перегляд протоколу подій';
+$_lang["role_view_logs"] = 'Перегляд системного протоколу';
+$_lang["role_view_unpublished"] = 'Перегляд неопублікованих ресурсів';
+$_lang["role_web_access_persmissions"] = 'Права веб-доступу';
+$_lang["role_web_user_management"] = 'Веб-користувачі';
+$_lang["rss_url_news_default"] = 'https://feeds.feedburner.com/evocms-release-news';
+$_lang["rss_url_news_message"] = 'Введіть адресу (URL) RSS-стрічки новин EVO.';
+$_lang["rss_url_news_title"] = 'Лента RSS новин';
+$_lang["rss_url_security_default"] = 'https://feeds.feedburner.com/evocms-security-news';
+$_lang["rss_url_security_message"] = 'Введіть адресу (URL) RSS-стрічки безпеки EVO.';
+$_lang["rss_url_security_title"] = 'Стрічка RSS безпеки';
+$_lang["run_module"] = 'Запуск модуля';
+$_lang["saturday"] = 'Субота';
+$_lang["save"] = 'Зберегти';
+$_lang["save_all_changes"] = 'Зберегти зміни';
+$_lang["save_tag"] = 'Зберегти тег';
+$_lang["saving"] = 'Збереження ресурсу, зачекайте, будь ласка...';
+$_lang["search"] = 'Пошук';
+$_lang["search_criteria"] = 'Критерій пошуку';
+$_lang["search_criteria_content"] = 'Шукати у вмісті';
+$_lang["search_criteria_content_msg"] = 'Знайти всі ресурси, які містять введений текст у своєму тілі.';
+$_lang["search_criteria_id"] = 'Шукати за ID';
+$_lang["search_criteria_id_msg"] = 'Введіть ID ресурсу, щоб швидко знайти його.';
+$_lang["search_criteria_top"] = 'Шукати за основними полями';
+$_lang["search_criteria_top_msg"] = 'Заголовок, Розширений заголовок, Псевдонім, ID';
+$_lang["search_criteria_template_id"] = 'Шукати за ID шаблоном';
+$_lang["search_criteria_template_id_msg"] = 'Знайти всі документи, що використовують вказаний шаблон.';
+$_lang["search_criteria_url_msg"] = 'Знайти ресурс по повному URL або ID.';
+$_lang["search_criteria_longtitle"] = 'Шукати в розширених заголовках';
+$_lang["search_criteria_longtitle_msg"] = 'Знайти всі ресурси, які містять текст у розширених заголовках.';
+$_lang["search_criteria_title"] = 'Шукати в заголовках';
+$_lang["search_criteria_title_msg"] = 'Знайти всі ресурси, які містять введений текст у заголовку.';
+$_lang["search_empty"] = 'На ваш запит нічого не знайдено. Спробуйте розширити критерій пошуку.';
+$_lang["search_item_deleted"] = 'Видалено';
+$_lang["search_results"] = 'Результати пошуку';
+$_lang["search_results_returned_desc"] = 'Опис';
+$_lang["search_results_returned_id"] = 'ID';
+$_lang["search_results_returned_msg"] = 'За вашим запитом знайдено %s ресурсів. Якщо знайдено дуже багато ресурсів, спробуйте сформувати більш специфічний запит. Дві крайні колонки зліва дозволять знайти ресурс у дереві сайту або переглянути ресурс. Дві крайні колонки справа показують, відповідно, чи був ресурс позначений видалення і чи опублікований он.';
+$_lang["search_results_returned_title"] = 'Заголовок';
+$_lang["search_view_docdata"] = 'Переглянути';
+$_lang["security"] = 'Менеджери';
+$_lang["security_notices_tab"] = 'Повіщення безпеки';
+$_lang["security_notices_title"] = 'Повіщення безпеки';
+$_lang["select_date"] = 'Вибрати дату';
+$_lang["send"] = 'Надіслати';
+$_lang["server_protocol_http"] = 'http';
+$_lang["server_protocol_https"] = 'https';
+$_lang["server_protocol_message"] = 'Якщо ваш сайт використовує https-з\'єднання, вкажіть це тут.';
+$_lang["server_protocol_title"] = 'Тип сервера:';
+$_lang["serveroffset"] = 'Поправка часу на сервері';
+$_lang["serveroffset_message"] = 'Виберіть поправку (кількість годин) між часом на місці вашого перебування та на місці знаходження сервера. Поточний час на сервері - [%s] , поточний час на сервері з урахуванням тимчасової зміни - [%s] .';
+$_lang["serveroffset_title"] = 'Різниця в часі:';
+$_lang["servertime"] = 'Час на сервері';
+$_lang["set_automatic"] = 'Автоматично';
+$_lang["set_default"] = 'За замовчуванням';
+$_lang["set_default_all"] = 'Все за замовчуванням';
+$_lang["settings_after_install"] = 'Оскільки ви щойно встановили систему, слід встановити основні налаштування. Внесіть бажані зміни і натисніть \'Зберегти\' для набуття чинності. ';
+$_lang["settings_config"] = 'Конфігурація';
+$_lang["settings_dependencies"] = 'Залежності';
+$_lang["settings_events"] = 'Системні події';
+$_lang["settings_furls"] = 'Дружні URL';
+$_lang["settings_general"] = 'Загальні';
+$_lang["settings_group_tv_message"] = 'Виберіть тип групування параметрів TV під час редагування документа.';
+$_lang["settings_group_tv_options"] = 'Ні,Секціями на вкладці Загальні,Табами на вкладці Загальні,Секціями на новій вкладці,Табами на новій вкладці,На нових вкладках';
+$_lang["settings_misc"] = 'Файл-менеджер';
+$_lang["settings_security"] = 'Безпека';
+$_lang["settings_KC"] = 'Файл-браузер';
+$_lang["settings_page_settings"] = 'Налаштування сторінки';
+$_lang["settings_photo"] = 'Фото';
+$_lang["settings_properties"] = 'Властивості';
+$_lang["show_fullscreen_btn_message"] = 'Показувати на головному меню кнопку \'На весь екран\'';
+$_lang["show_newresource_btn_message"] = 'Показувати на головному меню кнопку \'Новий ресурс\'';
+$_lang["settings_show_picker_message"] = 'Налаштувати тему панелі адміністрування та зберегти в localstorage';
+$_lang["show_fullscreen_btn"] = 'Кнопка \'На весь екран\'';
+$_lang["show_newresource_btn"] = 'Кнопка \'Новий ресурс\'';
+$_lang["settings_site"] = 'Сайт';
+$_lang["settings_strip_image_paths_message"] = 'Якщо встановлено значення \'Ні\', EVO буде використовувати абсолютні посилання для зображень, файлів, анімація тощо. Відносні посилання є зручнішими, якщо ви в майбутньому збираєтеся перемістити свій сайт, наприклад, з тестового сервера на кінцевий. Якщо ви не знаєте, про що йдеться, залиште значення \'Так\'.';
+$_lang["settings_strip_image_paths_title"] = 'Переписувати шляхи для браузера?';
+$_lang["settings_templvars"] = 'Параметри (TV)';
+$_lang["settings_title"] = 'Системна конфігурація';
+$_lang["settings_ui"] = 'Інтерфейс та уявлення';
+$_lang["settings_users"] = 'Користувачі';
+$_lang["show_meta"] = 'Показувати вкладку з META-тегами та ключовими словами';
+$_lang["show_meta_message"] = 'Показувати нерекомендовану вкладку з META-тегами та ключовими словами під час редагування ресурсів.';
+$_lang["show_tree"] = 'Показати дерево';
+$_lang["show_picker"] = 'Показати перемикач кольору';
+$_lang["showing"] = 'Показано';
+$_lang["signupemail_message"] = 'Тут ви можете створити повідомлення, яке надсилатиметься менеджерам, коли створюється обліковий запис нового менеджера. Лист повинен містити ім\'я користувача та пароль.Примітка: наступні \'поля виведення\' відобразять відповідні дані при відправленні листа: [+sname+] - назва сайту , [+saddr+] - e-mail адреса сайту, [+surl+] - адреса (URL) сайту, [+uid+] – ім\'я користувача або id користувача, [+pwd+] - пароль користувача, [+ufn+] - повне ім\'я користувача. Переконайтеся, що в повідомленні присутні поля [+uid+] та [+pwd+], інакше користувач не дізнається про своє ім\'я користувача та пароль ';
+$_lang["signupemail_title"] = 'Реєстрація менеджера:';
+$_lang["site"] = 'Сайт';
+$_lang["site_schedule"] = 'Розклад сайту';
+$_lang["sitename_message"] = 'Введіть заголовок вашого сайту.';
+$_lang["sitename_title"] = 'Заголовок сайту:';
+$_lang["sitestart_message"] = 'Введіть ID ресурсу, який ви хочете використовувати як стартову (домашню) сторінку.Примітка: переконайтеся, що цей ID належить існуючому ресурсу і що цей ресурс опубліковано';
+$_lang["sitestart_title"] = 'Перша сторінка:';
+$_lang["sitestatus_message"] = 'Виберіть \'Онлайн\' для опублікування вашого сайту. Якщо ви оберете \'Оффлайн\', відвідувачі сайту побачать повідомлення про недоступність сайту та не зможуть переглянути сам сайт.';
+$_lang["sitestatus_title"] = 'Статус сайту:';
+$_lang["siteunavailable_message"] = 'Повідомлення, що відображається у разі недоступності сайту (коли вибрано статус \'Оффлайн\') або у разі виникнення помилки.Примітка: це повідомлення виводиться лише в тому випадку, якщо не вибрано сторінку \'Сайт недоступний\'.';
+$_lang["siteunavailable_message_default"] = 'В даний час сайт недоступний.';
+$_lang["siteunavailable_page_message"] = 'Введіть ID ресурсу, який повинні будуть побачити відвідувачі, якщо спробують зайти на сайт, коли він недоступний.Примітка: переконайтеся, що цей ID належить існуючому ресурсу , та що цей ресурс опубліковано';
+$_lang["siteunavailable_page_title"] = 'Сторінка \'Сайт недоступний\':';
+$_lang["siteunavailable_title"] = 'Повідомлення про недоступність сайту:';
+$_lang["snippet"] = 'Сніппет';
+$_lang["snippets"] = 'Сніппети';
+$_lang["snippet_code"] = 'Код сніпету (php)';
+$_lang["snippet_desc"] = 'Опис';
+$_lang["snippet_execonsave"] = 'Виконати сніпет після збереження';
+$_lang["snippet_management_msg"] = 'Сніппети - це чистий PHP-код, що забезпечує динамічну логіку. Сніппети дозволяють відокремити бізнес-логіку від структури та представлення даних на веб-сторінці. Вони можуть використовуватися для генерації динамічних меню, виведення контенту з бази даних за певною умовою (наприклад, тільки для зареєстрованих користувачів), взагалі для будь-яких дій, доступних через EVO API. Сніпети можуть (але не зобов\'язані) приймати параметри та виводити будь-який результат (наприклад, генерувати HTML-код).
Використання: вставте [[snippetName]]< /code> або [!snippetName!] де-небудь у шаблоні , у області контенту , у чанці або у параметрі (TV) . Формат [[snippetName]] дозволяє кешувати результати виконання сніпету, якщо для сторінки включено кешування. Формат [!snippetName!] використовується для виконання PHP-коду сніпету при кожному перегляді сторінки, навіть якщо для сторінки дозволено кешування. Щоб під час виклику PHP-коду сніпета передати параметри, використовуйте формат [[snippetName? ¶m1=\'value1\' ¶m2=\'value2\' .. ¶mN=\'valueN\']] (або [!snippetName? ¶m1=\' value1\' ¶m2=\'value2\' .. ¶mN=\'valueN\'!]). В якості параметрів виклику сніпету можна використовувати виклик інших сніпетів (також з параметрами) або чанків .
Виклик через EVO API: $modx->runSnippet(\'snippetName\');
Виберіть сніпет для редагування або створіть новий.';
+$_lang["snippet_msg"] = '
Тут можна створити або відредагувати сніпет. Код сніпету повинен починатися з <?php
Пам\'ятайте, сніпети - це чистий PHP-код, і якщо ви хочете вивести дані сніпета в певному місці в шаблоні, вам необхідно повертати дані із самого сніппета.
';
+$_lang["snippet_name"] = 'Назва сніпета';
+$_lang["snippet_properties"] = 'Настройки за замовчуванням';
+$_lang["snippet_title"] = 'Створити/редагувати сніпет';
+$_lang["sort_alphabetically"] = 'Сортувати за алфавітом';
+$_lang["sort_asc"] = 'За зростанням';
+$_lang["sort_desc"] = 'За спаданням';
+$_lang["sort_menuindex"] = 'Сортувати за позицією в меню';
+$_lang["sort_tree"] = 'Сортувати дерево';
+$_lang['sort_updating'] = 'Оновлення...';
+$_lang['sort_updated'] = 'Оновлено!';
+$_lang['sort_nochildren'] = 'Документ не містить дочірніх документів';
+$_lang["sort_elements_msg"] = 'Перетягніть, щоб змінити порядок вибраних елементів.';
+$_lang["source"] = 'Код';
+$_lang["stay"] = 'Продовжити';
+$_lang["stay_new"] = 'Створити новий';
+$_lang["submit"] = 'Виконати';
+$_lang["sunday"] = 'Неділя';
+$_lang["sys_alert"] = 'Системне попередження';
+$_lang["sysinfo_activity_message"] = 'Цей список показує останні створені/відредаговані ресурси.';
+$_lang["sysinfo_userid"] = 'Користувач';
+$_lang["system"] = 'Службове';
+$_lang["system_email_signup"] = 'Здрастуйте, [+uid+]!
+
+Ваші дані для авторизації в системі керування сайтом [+sname+]:
+
+Ім\'я користувача: [+uid+]
+Пароль: [+pwd+]
+
+Після успішної авторизації в системі керування сайтом ([+surl+]), ви зможете змінити свій пароль.
+
+З повагою адміністрація';
+$_lang["system_email_webreminder"] = 'Здрастуйте, [+uid+]!
+
+Щоб активувати новий пароль, перейдіть за наступним посиланням:
+
+[+surl+]
+
+Пізніше ви зможете використовувати наступний пароль для авторизації: [+ pwd+]
+
+Якщо цей лист прийшов до вас помилково, будь ласка, проігноруйте його.
+
+З повагою адміністрація';
+$_lang["system_email_websignup"] = 'Здрастуйте, [+uid+]!
+
+Ваші дані для авторизації на [+sname+]:
+
+Ім\'я користувача: [+uid+]
+Пароль: [+pwd+]
+
+Після успішної авторизації на [+sname+] ([+surl+]), ви зможете змінити свій пароль.
+
+З повагою адміністрація';
+$_lang["table_hoverinfo"] = 'Затримайте вказівник миші над рядком таблиці, щоб побачити коротке пояснення призначення таблиці (коментарі є не всі таблиці).';
+$_lang["table_prefix"] = 'Префікс таблиць бази даних';
+$_lang["tag"] = 'Тег';
+$_lang["template"] = 'Шаблон';
+$_lang["templates"] = 'Шаблони';
+$_lang["template_assignedtv_tab"] = 'Призначені параметри (TV)';
+$_lang["template_code"] = 'Код шаблону (HTML)';
+$_lang["template_desc"] = 'Опис';
+$_lang["template_edit_tab"] = 'Редагувати шаблон';
+$_lang["template_management_msg"] = 'Шаблони - це (X)HTML-розмітка сторінок сайту. Шаблон описує структуру та дизайн відображення елементів сторінки (статичних та генерованих). Шаблон може містити виклики сніппетів , чанків , параметрів (TV) , а також посилання на CSS-файли та інші об\'єкти, що визначають візуальне відображення сторінки та її елементів.Використання: призначте шаблон будь-якому ресурсу.
Виберіть шаблон для редагування або створіть новий.';
+$_lang["template_msg"] = 'Тут можна створити / відредагувати шаблон.';
+$_lang["template_name"] = 'Ім\'я шаблону';
+$_lang["template_no_tv"] = 'Цему шаблону не надано жодних параметрів (TV).';
+$_lang["template_notassigned_tv"] = 'Ці TV доступні для вибору.';
+$_lang["template_reset_all"] = 'Скинути всі шаблони (буде встановлено шаблон за замовчуванням)';
+$_lang["template_reset_specific"] = 'Скинути лише сторінки із шаблоном %s ';
+$_lang["template_selectable"] = 'Шаблон вибирається під час створення або редагування ресурсів.';
+$_lang["template_title"] = 'Створити/редагувати шаблон';
+$_lang["template_tv_edit"] = 'Редагувати порядок TV';
+$_lang["template_tv_edit_message"] = 'Перетягніть мишею для зміни порядку параметрів (TV) для цього шаблону.';
+$_lang["template_tv_edit_title"] = 'Порядок сортування параметрів (TV)';
+$_lang["template_tv_msg"] = 'Наведені нижче параметри (TV) призначені для цього шаблону.';
+$_lang["thursday"] = 'Четвер';
+$_lang["tmplvar_access_msg"] = 'Виберіть групи ресурсів, в яких можна змінити цей Додатковий Параметр (TV)';
+$_lang["tmplvar_change_template_msg"] = 'Зміна шаблону спричинить перезавантаження сторінки. Усі незбережені зміни будуть втрачені. \n\nВи впевнені, що хочете змінити шаблон?';
+$_lang["tmplvar_inuse"] = 'Цей параметр (TV) використовують наступні шаблони. Щоб продовжити процес видалення, натисніть \'Видалити\', для скасування - натисніть \'Скасувати\'.';
+$_lang["tmplvar_tmpl_access"] = 'Доступ шаблонів';
+$_lang["tmplvar_tmpl_access_msg"] = 'Вкажіть шаблони, які можуть використовувати цей параметр (TV)';
+$_lang["tmplvar"] = 'Додаткові поля';
+$_lang["tmplvars"] = 'Параметри (TV)';
+$_lang["tmplvars_binding_msg"] = 'Це поле підтримує прив\'язку даних з використанням @-команд';
+$_lang["tmplvars_caption"] = 'Заголовок';
+$_lang["tmplvars_default"] = 'Значення за замовчуванням';
+$_lang["tmplvars_description"] = 'Опис';
+$_lang["tmplvars_elements"] = 'Можливі значення';
+$_lang["tmplvars_inherited"] = 'Value inherited';
+$_lang["tmplvars_management_msg"] = 'Параметри (TV) - це динамічні елементи шаблону, які набувають свого значення з якогось джерела даних . Існують також параметри, визначені для кожного конкретного ресурсу (наприклад, визначений параметр [*pagetitle*] містить заголовок сторінки). Параметри можуть мати різний тип даних і різне значення на різних сторінках сайту. вираз [*tvName*]
Виклик через EVO API: $modx->documentObject[\'variable-name\']
Виберіть параметр для редагування або створіть новий.';
+$_lang["tmplvars_msg"] = 'Тут можна створити / відредагувати параметр (TV). Пам\'ятайте, що параметри повинні бути доступні для вибраних шаблонів, щоб їх можна було використовувати.';
+$_lang["tmplvars_name"] = 'Ім\'я параметра';
+$_lang["tmplvars_novars"] = 'Параметрів (TV) не знайдено';
+$_lang["tmplvars_rank"] = 'Порядок у списку';
+$_lang["tmplvars_rank_edit_message"] = 'Перетягніть, щоб змінити порядок TV.';
+$_lang["tmplvars_reset_params"] = 'Скинути параметри';
+$_lang["tmplvars_title"] = 'Створити/редагувати параметр (TV)';
+$_lang["tmplvars_type"] = 'Тип введення';
+$_lang["tmplvars_widget"] = 'Візуальний компонент';
+$_lang["tmplvars_widget_prop"] = 'Властивості компонента (widget)';
+$_lang["to"] = 'до';
+$_lang["toggle_fullscreen"] = 'Розгорнути на весь екран';
+$_lang["tools"] = 'Інструменти';
+$_lang["top_howmany_message"] = 'Кількість найкращих показників у звітах статистики. Наприклад, \'10 найпопулярніших...\'';
+$_lang["top_howmany_title"] = 'Кількість найкращих показників:';
+$_lang["total"] = 'всього';
+$_lang["track_visitors_message"] = 'Надає дані для плагіна аналітики, наприклад, прапорець, який визначає, чи враховувати перегляди конкретного ресурсу.';
+$_lang["track_visitors_title"] = 'Показувати дочірні ресурси';
+$_lang["tree_page_click"] = 'Режим клацання мишею на ресурсі';
+$_lang["tree_page_click_message"] = 'Дій за замовчуванням при клацанні мишею на ресурсі в дереві сайту.';
+$_lang["use_breadcrumbs"] = 'Показати навігацію';
+$_lang["use_breadcrumbs_message"] = 'Показувати навігацію при створенні або редагуванні ресурсу';
+$_lang["tree_show_protected"] = 'Показувати захищені ресурси у дереві сайту:';
+$_lang["tree_show_protected_message"] = 'Якщо включено \'Ні\', то захищені ресурси (включаючи їх дочірні ресурси) не відображатимуться в дереві сайту.';
+$_lang["truncate_table"] = 'Натисніть для усічення таблиці (TRUNCATE)';
+$_lang["tuesday"] = 'Вівторок';
+$_lang["tv"] = 'Параметр (TV)';
+$_lang["type"] = 'Тип';
+$_lang["udperms_allowroot_message"] = 'Дозволити користувачам створювати ресурси в кореневій папці.';
+$_lang["udperms_allowroot_title"] = 'Дозволити доступ до кореневої папки:';
+$_lang["udperms_message"] = 'Права доступу дозволяють визначити, які сторінки можуть редагувати користувачі. Для цього необхідно, щоб користувачі належали до групи користувачів, а ресурси до групи ресурсів і далі ви можете вибрати, які групи ресурсів може редагувати та чи інша група користувачів. При першому включенні цієї функції редагувати ресурси можуть лише менеджери.';
+$_lang["udperms_title"] = 'Використовувати права доступу:';
+$_lang["unable_set_link"] = 'Неможливо встановити посилання';
+$_lang["unable_set_parent"] = 'Неможливо встановити новий батьківський ресурс';
+$_lang["unauthorizedpage_message"] = 'Введіть ID ресурсу, який повинні будуть побачити відвідувачі, якщо спробують зайти на закриту сторінку (403 – доступ заборонено).Примітка: переконайтеся, що цей ID належить існуючому ресурсу, і що цей ресурс опубліковано';
+$_lang["unauthorizedpage_title"] = 'Сторінка \'Доступ заборонено\':';
+$_lang["unblock_message"] = 'Після збереження користувач буде розблокований.';
+$_lang["undelete_resource"] = 'Відновити';
+$_lang["unpublish_date"] = 'Дата скасування публікації';
+$_lang["unpublish_events"] = 'Події, пов\'язані зі скасуванням публікації ресурсів.';
+$_lang["unpublish_resource"] = 'Скасувати публікацію';
+$_lang["untitled_resource"] = 'Новий ресурс';
+$_lang["untitled_weblink"] = 'Нове веб-посилання';
+$_lang["update_params"] = 'Оновити параметри';
+$_lang["update_settings_from_language"] = 'Змінити на:';
+$_lang["upload_maxsize_message"] = 'Встановіть максимальний розмір файлів, що завантажуються. Значення має бути в байтах.Примітка: великі файли завантажуються, як правило, ДУЖЕ довго';
+$_lang["upload_maxsize_title"] = 'Максимальний розмір завантаження:';
+$_lang["uploadable_files_message"] = 'Тут можна вказати, які типи файлів можуть бути завантажені на сервер через файл-менеджер. Задайте список розширень через кому.';
+$_lang["uploadable_files_title"] = 'Дозволені до завантаження файли:';
+$_lang["uploadable_flash_message"] = 'Тут ви можете ввести список файлів, які можуть бути завантажені в \'assets/flash/\' за допомогою файл-менеджера. Введіть розширення дозволених типів флеш-файлів, розділяючи їх комами.';
+$_lang["uploadable_flash_title"] = 'Дозволені до завантаження flash-файли:';
+$_lang["uploadable_images_message"] = 'Тут можна ввести список файлів, які можуть бути завантажені в \'assets/images/\' за допомогою файл-менеджера. Введіть розширення типів графічних файлів, розділяючи їх комами.';
+$_lang["uploadable_images_title"] = 'Дозволені для завантаження зображення:';
+$_lang["uploadable_media_message"] = 'Тут ви можете ввести список файлів, які можуть бути завантажені в \'assets/media/\' за допомогою файл-менеджера. Введіть розширення дозволених типів медіа-файлів, розділяючи їх комами.';
+$_lang["uploadable_media_title"] = 'Дозволені до завантаження медіа-файли:';
+$_lang["use_alias_path_message"] = 'Увімкнувши цю функцію, ви отримаєте вкладену структуру URL. Наприклад, якщо дочірній ресурс називається \'дочірній\', а батьківський ресурс називається \'батьківський\', ми отримаємо URL такого типу: http://example.com/батьківський/дочірній.Увага:< /b> якщо ця функція включена, переконайтеся, що всі шляхи до зображень, css, java-скриптів мають шлях типу \'/assets/images/...\', а не \'assets/images/...\' , або ви завжди можете використовувати приставку [(site_url)] для правильного розуміння сервером шляху, наприклад \'[(site_url)]assets/images/...\'. Також можна використовувати HTML-тег <base href=\'[(site_url)]\'> у HEAD-секції кожної сторінки сайту, тоді всі відносні шляхи будуть працювати правильно.';
+$_lang["use_alias_path_title"] = 'Використовувати вкладені URL:';
+$_lang["use_editor_message"] = 'Хочете використовувати HTML-редактор? Якщо ви звикли писати HTML-теги вручну, вимкніть цю функцію. Майте на увазі, що це налаштування застосовується до всіх ресурсів для всіх менеджерів';
+$_lang["use_editor_title"] = 'Використовувати HTML-редактор:';
+$_lang["use_global_tabs"] = 'Використовувати глобальні вкладки';
+$_lang["user"] = 'Користувач';
+$_lang["user_block"] = 'Заблоковано';
+$_lang["user_blockedafter"] = 'Заблоковано після';
+$_lang["user_blockeduntil"] = 'Заблоковано до';
+$_lang["user_changeddata"] = 'Дані вашої реєстрації змінені. Будь ласка, заново авторизуйтесь у системі.';
+$_lang["user_country"] = 'Країна';
+$_lang["user_dob"] = 'Дата народження';
+$_lang["user_doesnt_exist"] = 'Користувач не існує';
+$_lang["user_edit_self_msg"] = 'Рекомендується вийти і знову авторизуватися для того, щоб усі зміни набули чинності. Також, якщо ви вирішили згенерувати новий пароль для себе, він буде надісланий вам по e-mail.';
+$_lang["user_email"] = 'Адреса e-mail';
+$_lang["user_failedlogincount"] = 'Відмови авторизації';
+$_lang["user_fax"] = 'Факс';
+$_lang["user_female"] = 'Жіночий';
+$_lang["user_full_name"] = 'Повне ім\'я';
+$_lang["user_gender"] = 'Стать';
+$_lang["user_is_blocked"] = 'Цей користувач заблокований';
+$_lang["user_logincount"] = 'Кількість авторизацій';
+$_lang["user_male"] = 'Чоловічий';
+$_lang["user_management_msg"] = 'Менеджери - це користувачі з правом авторизації в системі керування сайтом. Виберіть менеджера, налаштування якого ви хочете редагувати, або створіть нового менеджера.';
+$_lang["user_management_title"] = 'Менеджери';
+$_lang["user_mobile"] = 'Номер мобільного телефону';
+$_lang["user_phone"] = 'Номер телефону';
+$_lang["user_photo"] = 'Фото користувача';
+$_lang["user_photo_message"] = 'Введіть адресу (URL) зображення для цього користувача або натисніть кнопку вставки, щоб завантажити її на сервер.';
+$_lang["user_prevlogin"] = 'Остання авторизація';
+$_lang["user_role"] = 'Роль користувача';
+$_lang["user_state"] = 'Регіон/область/район';
+$_lang["user_title"] = 'Створити/редагувати користувача';
+$_lang["user_upload_message"] = 'Якщо ви бажаєте заборонити цьому користувачеві завантаження будь-яких файлів цієї категорії, переконайтеся, що прапорець \'Використовувати загальні налаштування\' не встановлений, і залиште це поле порожнім.';
+$_lang["user_use_config"] = 'Використовувати системні установки';
+$_lang["user_verification"] = 'Користувача перевірено';
+$_lang["user_zip"] = 'Поштовий індекс';
+$_lang["username"] = 'Користувач';
+$_lang["users"] = 'Користувачі';
+$_lang["valid_hostnames_message"] = 'Допомагає запобігти XSS вразливості в системному налаштуванні site_url надаючи розділений комами список доступних імен хостів для цієї установки. Це важливо для деяких типів шаред-хостингів або хостів, доступних за IP-адресою. Перше ім\'я хоста у списку використовується, якщо HTTP_HOST не збігається з жодним доступним ім\'ям хоста зі списку.';
+$_lang["valid_hostnames_title"] = 'Допустимі імена хостів';
+$_lang["validate_referer_message"] = 'Перевіряти серверні заголовки HTTP_REFERER для захисту від уразливостей CSRF (Cross Site Request Forgery). Якщо сервер не використовує заголовки HTTP_REFERER, ця функція не буде працювати.';
+$_lang["validate_referer_title"] = 'Перевіряти серверні заголовки HTTP_REFERER?';
+$_lang["value"] = 'Значення';
+$_lang["version"] = 'Версія';
+$_lang["view"] = 'Перегляд';
+$_lang["view_child_resources_in_container"] = 'Перегляд дочірніх ресурсів';
+$_lang["view_log"] = 'Переглянути протокол';
+$_lang["view_logging"] = 'Протокол системи керування';
+$_lang["view_sysinfo"] = 'Системна інформація';
+$_lang["warning"] = 'Попередження';
+$_lang["warning_not_saved"] = 'Зміни не були збережені. Ви можете залишитися на цій сторінці для того, щоб зберегти зміни (\'Скасувати\'), або залишити її, втративши всі зміни (\'OK\').';
+$_lang["warning_visibility"] = 'Показувати попередження';
+$_lang["warning_visibility_message"] = 'Показувати звіт про перевірку конфігурації на сторінці привітання менеджера';
+$_lang["web_access_permissions"] = 'Права доступу для веб-користувачів';
+$_lang["web_access_permissions_user_groups"] = 'Групи веб-користувачів';
+$_lang["web_permissions"] = 'Права веб-користувачів';
+$_lang["web_user_management_msg"] = 'Веб-користувачі - це зареєстровані відвідувачі сайту (не менеджери). Виберіть веб-користувача, налаштування якого ви хочете редагувати, або створіть нового веб-користувача.';
+$_lang["web_user_management_title"] = 'Веб-користувачі';
+$_lang["web_user_title"] = 'Створити/редагувати веб-користувача';
+$_lang["web_users"] = 'Користувачі';
+$_lang["weblink"] = 'Веб-посилання';
+$_lang["webpwdreminder_message"] = 'Тут ви можете створити повідомлення, яке надсилатиметься користувачам, коли вони запитують нагадування пароля. Лист повинен містити ім\'я користувача та пароль.Примітка: наступні \'поля виведення\' відобразять відповідні дані при відправленні листа: [+sname+] - назва сайту , [+saddr+] - e-mail адреса сайту, [+surl+] - адреса (URL) сайту, [+uid+] - ім\'я користувача або id користувача, [+pwd+] - пароль користувача, [+ufn+] - повне ім\'я користувача. Переконайтеся, що в повідомленні присутні поля [+uid+] та [+pwd+], інакше користувач не дізнається свої ім\'я користувача та пароль ';
+$_lang["webpwdreminder_title"] = 'Нагадування пароля:';
+$_lang["websignupemail_message"] = 'Тут ви можете створити повідомлення, яке надсилатиметься веб-користувачам, коли створюється обліковий запис нового веб-користувача. Лист повинен містити ім\'я користувача та пароль.Примітка: наступні \'поля виведення\' відобразять відповідні дані при відправленні листа: [+sname+] - назва сайту , [+saddr+] - e-mail адреса сайту, [+surl+] - URL сайту, [+uid+] - ім\'я користувача або id користувача, [+pwd+ ] - пароль користувача, [+ufn+] - повне ім\'я користувача. Переконайтеся, що в повідомленні присутні поля [+uid+] та [+pwd+], інакше користувач не дізнається про своє ім\'я користувача та пароль ';
+$_lang["websignupemail_title"] = 'Реєстрація веб-користувача:';
+$_lang["allow_multiple_emails_title"] = 'Повторювані e-mail у веб-користувачів';
+$_lang["allow_multiple_emails_message"] = 'Дозволяє веб-користувачам використовувати ту саму адресу електронної пошти для ситуацій, коли у користувача може бути відсутня власна адреса електронної пошти або є тільки єдина адреса електронної пошти для сімейства. Примітка: Будь-які нагадування про паролі та логіку реєстрації повинні враховувати цей параметр, якщо він встановлений на «Так».';
+$_lang["wednesday"] = 'Середа';
+$_lang["welcome_messages"] = 'У вашій скриньці %d повідомлень, з яких %s не прочитані.';
+$_lang["welcome_title"] = 'Ласкаво просимо до системи керування сайтом';
+$_lang["which_editor_message"] = 'Виберіть HTML-редактор. Ви також можете завантажити та встановити редактори зі списку, доступних на сайті EVO.';
+$_lang["which_editor_title"] = 'Редактор:';
+$_lang["working"] = 'Обробка даних...';
+$_lang["wrap_lines"] = 'Переносити рядки по ширині вікна';
+$_lang["xhtml_urls_message"] = 'Якщо цей параметр увімкнено, всі амперсанди (&) у посиланнях будуть замінені на конструкцію & відповідно до формату XHTML.';
+$_lang["xhtml_urls_title"] = 'Посилання у форматі XHTML:';
+$_lang["yes"] = 'Так';
+$_lang["you_got_mail"] = 'Нове повідомлення';
+$_lang["yourinfo_message"] = 'Цей розділ містить деякі дані про вас:';
+$_lang["yourinfo_previous_login"] = 'Остання авторизація:';
+$_lang["yourinfo_role"] = 'Ваша роль:';
+$_lang["yourinfo_title"] = 'Інформація про вас';
+$_lang["yourinfo_total_logins"] = 'Всього авторизацій:';
+$_lang["yourinfo_username"] = 'Ви авторизовані як:';
+
+$_lang["a17_error_reporting_title"] = 'Виявлення рівня помилки РНР';
+$_lang["a17_error_reporting_msg"] = 'Набір виявлення рівня помилок РНР';
+$_lang["a17_error_reporting_opt0"] = 'Ігнорувати все';
+$_lang["a17_error_reporting_opt1"] = 'Ігнорувати попередження про незначні помилки(E_ALL & ~E_NOTICE & ~ E_DEPRECATED & ~E_STRICT )';
+$_lang["a17_error_reporting_opt2"] = 'Виявити всі помилки, крім E_NOTICE';
+$_lang["a17_error_reporting_opt99"] = 'Виявити все';
+
+$_lang["pwd_hash_algo_title"] = 'Алгоритм шифрування';
+$_lang["pwd_hash_algo_message"] = 'Алгоритм шифрування паролів.';
+
+$_lang["enable_bindings_title"] = 'Дозволити @-прив\'язки';
+$_lang["enable_bindings_message"] = 'Запобігає виконанню PHP-коду за допомогою @-прив\'язок у TV-параметрах. Потрібно, якщо у вас є користувачі, які не повинні мати можливість створювати PHP-код, але можуть створювати або редагувати TV-параметри. Виведення будь-якого TV-параметра @-прив\'язкою буде \'@-прив\'язки заборонені\'.';
+$_lang["enable_filter_title"] = 'Включити фільтри';
+$_lang["enable_filter_message"] = 'Фільтри дозволяють керувати вихідними даними, перетворюючи їх прямо в тег всередині шаблону. Аналог PHx. Більше інформації '; // todo: change link to documentation
+$_lang["enable_filter_phx_warning"] = 'Коли плагін PHx увімкнено, вбудовані фільтри відключені за замовчуванням';
+
+$_lang["enable_at_syntax_title"] = 'Включити <@SYNTAX>';
+$_lang["enable_at_syntax_message"] = '<@SYNTAX>(не рекомендований до використання синтаксис). Додає підтримку умовних операторів у HTML коді';
+
+$_lang["bkmgr_alert_mkdir"] = 'Файл не може бути створений. Перевірте права на папку assets/backup';
+$_lang["bkmgr_restore_msg"] = '
Сайт може бути відновлений за допомогою файлу SQL.
';
+$_lang["bkmgr_restore_title"] = 'Відновити';
+$_lang["bkmgr_import_ok"] = 'SQL відновлення було виконано нормально.';
+$_lang["bkmgr_snapshot_ok"] = 'Резервну копію було збережено.';
+$_lang["bkmgr_run_sql_file_label"] = 'Виконати SQL файл';
+$_lang["bkmgr_run_sql_direct_label"] = 'Виконати довільну команду SQL';
+$_lang["bkmgr_run_sql_submit"] = 'Надіслати';
+$_lang["bkmgr_run_sql_result"] = 'Результат';
+$_lang["bkmgr_snapshot_title"] = 'Резервне копіювання';
+$_lang["bkmgr_snapshot_msg"] = 'Резервні копії зберігаються та відновлюються на сервер. Шлях для резервних копій: /assets/backup/';
+$_lang["bkmgr_snapshot_submit"] = 'Створити резервну копію';
+$_lang["bkmgr_snapshot_list_title"] = 'Список резервних копій';
+$_lang["bkmgr_restore_submit"] = 'Відновити резервну копію';
+$_lang["bkmgr_restore_confirm"] = 'Ви впевнені, що хочете відновити резервну копію\n[+filename+]. ?';
+$_lang["bkmgr_snapshot_nothing"] = 'Немає резервних копій';
+
+$_lang["files.dynamic.php1"] = 'Створити файл';
+$_lang["files.dynamic.php2"] = 'files.dynamic.php2';
+$_lang["files.dynamic.php3"] = 'files.dynamic.php3';
+$_lang["files.dynamic.php4"] = 'files.dynamic.php4';
+$_lang["files.dynamic.php5"] = 'Файл не може бути дубльований.';
+$_lang["files.dynamic.php6"] = 'Файл або директорія не можуть бути перейменовані.';
+$_lang["files_dynamic_new_folder_name"] = 'Вкажіть нове ім\'я для папки:';
+$_lang["files_dynamic_new_file_name"] = 'Вкажіть нове ім\'я для файлу:';
+$_lang["not_readable_dir"] = 'Директорія недоступна для запису';
+$_lang["confirm_delete_dir"] = 'Ви впевнені, що хочете видалити папку? \n\nЦе може спричинити проблеми з роботою сайту. Видаляйте папку, якщо ви на 100% впевнені, що робота сайту не постраждає.';
+$_lang["confirm_delete_dir_recursive"] = 'Ви впевнені, що хочете видалити папку з усім вмістом? \n\nЦе може спричинити проблеми з роботою сайту. Видаляйте папку, якщо ви на 100% впевнені, що робота сайту не постраждає.';
+
+$_lang["make_folders_title"] = 'Додавати слеш до контейнера';
+$_lang["make_folders_message"] = 'При використанні дружніх URL-адрес до ресурсу, який є контейнером, додається слеш.';
+
+$_lang["check_files_onlogin_title"] = 'Перевіряти системні файли на наявність змін';
+$_lang["check_files_onlogin_message"] = 'При використанні цієї опції важливі системні файли будуть перевірятися на наявність змін, типових для зламаних сайтів. Це не гарантує повного захисту, але може допомогти у запобіганні злому.';
+
+$_lang["configcheck_sysfiles_mod"] = 'Системні файли були змінені.';
+$_lang["configcheck_sysfiles_mod_msg"] = 'Ви підключили перевірку системних файлів на наявність змін, характерних для зламаних сайтів. Це не означає, що сайт був зламаний, але бажано переглянути змінені файли.(index.php, .htaccess, [+MGR_DIR+]/index.php, [+MGR_DIR+]/includes/config.inc.php)';
+
+$_lang['email_method_title'] = 'Метод надсилання листів';
+$_lang['email_method_mail'] = 'MAIL - повідомлення надсилаються за допомогою функції mail().';
+$_lang['email_method_smtp'] = 'Через SMTP-сервер';
+$_lang['smtp_auth_title'] = 'SMTP авторизація';
+$_lang['smtp_host_title'] = 'Адреса SMTP-сервера';
+$_lang['smtp_secure_title'] = 'Захист SMTP';
+$_lang['smtp_username_title'] = 'SMTP пошта';
+$_lang['smtp_password_title'] = 'SMTP пароль';
+$_lang['smtp_port_title'] = 'SMTP порт';
+
+$_lang["setting_resource_tree_node_name"] = 'Назва ресурсу в дереві';
+$_lang["setting_resource_tree_node_name_desc"] = 'Виберіть поле ресурсу, яке буде використовуватися як назва ресурсу в дереві. За замовчуванням використовується поле "заголовок"; можна використовувати будь-яке інше поле, наприклад, \'пункт меню\', \'псевдонім\'.';
+$_lang["setting_resource_tree_node_name_desc_add"] = 'Примітка: Починаючи з версії MODX Evolution 1.1, Ви можете змінити відображене ім\'я ресурсу через опцію \'Сортувати дерево\'. Цей параметр використовується, якщо ім\'я, що відображається в дереві ресурсів, встановлюється на \'За замовчуванням\'.';
+
+$_lang["resource_opt_alvisibled"] = 'Бере участь в URL';
+$_lang["resource_opt_alvisibled_help"] = 'Для участі даного документа в адресному рядку поставте галку, і навпаки - зніміть, якщо псевдонім цього документа потрібно забрати з URL.';
+$_lang['resource_opt_is_published'] = 'Опубліковано';
+$_lang["docid_incrmnt_method_title"] = 'Спосіб додавання Resource ID';
+$_lang["docid_incrmnt_method_0"] = 'DB автоінкримент';
+$_lang["docid_incrmnt_method_1"] = 'Мінімальний пропущений ID';
+$_lang["docid_incrmnt_method_2"] = 'Максимальний ID+1';
+
+$_lang["enable_cache_title"] = 'Спосіб кешування';
+$_lang["disable_chunk_cache_title"] = 'Вимкнути кешування чанків';
+$_lang["disable_snippet_cache_title"] = 'Вимкнути кешування сніпетів';
+$_lang["disable_plugins_cache_title"] = 'Вимкнути кешування плагіни';
+$_lang["disabled_at_login"] = 'Вимкнути для адміністраторів';
+
+$_lang["cache_type_title"] = 'Спосіб кешування сторінок';
+$_lang["cache_type_1"] = 'Тільки з урахуванням ID (стандартний метод)';
+$_lang["cache_type_2"] = 'З урахуванням ID та $_GET';
+$_lang["seostrict_title"] = 'Використовувати SEO Strict URLs';
+$_lang["seostrict_message"] = 'використання strict URLs видаляє дублі сторінок за різними посиланнями';
+$_lang["aliaslistingfolder_title"] = 'Використовувати AliasListing тільки для папок';
+$_lang["full_aliaslisting_title"] = 'Вимкнути AliasListing для всіх ресурсів';
+$_lang["aliaslistingfolder_message"] = 'Зменшує споживання пам\'яті та прискорює роботу сайту при великій кількості документів';
+
+$_lang["settings_friendlyurls_alert"] = 'Для використання дружніх URL необхідно змінити ім\'я файлу ht.access у папці, в яку встановлено EVO, на .htaccess.';
+$_lang["settings_friendlyurls_alert2"] = 'При встановленні EVO в підпапку необхідно внести зміни до файлу .htaccess.';
+
+$_lang["user_street"] = 'Вулиця';
+$_lang["user_city"] = 'Місто';
+$_lang["user_other"] = 'Інше';
+
+$_lang["import_site.static.php1"] = 'Скинути дерево ресурсів';
+$_lang["import_site.static.php2"] = 'Скинути дерево ресурсів та ініціалізувати всі ідентифікатори ресурсів.';
+$_lang["import_site.static.php3"] = 'Мета';
+$_lang["import_site.static.php4"] = 'Тільки те, що в <body></body> ';
+$_lang["import_site.static.php5"] = 'Весь вміст файлу';
+
+$_lang["a83_ignore_ids_title"] = 'Ігноровані ID (через кому)';
+$_lang["export_site.static.php1"] = 'Мета';
+$_lang["export_site.static.php2"] = 'Тільки відредаговані ресурси';
+$_lang["export_site.static.php3"] = 'Всі ресурси';
+$_lang["export_site.static.php4"] = 'Знайти';
+$_lang["export_site.static.php5"] = 'Замінити';
+$_lang["export_site.static.php6"] = 'Мета';
+$_lang["export_site.static.php7"] = 'Файл не може бути збережений у [+rb_base_url+]';
+
+$_lang["mutate_settings.dynamic.php6"] = 'Повідомлення про системні помилки';
+$_lang["mutate_settings.dynamic.php7"] = 'Не повідомляти';
+$_lang["mutate_settings.dynamic.php8"] = 'Повідомлення надходять на [+emailsender+] (задається налаштуванням [(emailsender)]) в момент генерації помилки. Деталі можна побачити у журналі помилок.';
+
+$_lang["error_no_privileges"] = "У вас немає відповідних прав для виконання цієї дії.";
+$_lang["error_no_optimise_tablename"] = "Немає таблиць, які потребують оптимізації!";
+$_lang["error_no_truncate_tablename"] = "Таблиця для очищення не знайдена!";
+$_lang["error_double_action"] = "Подвійна дія (GET & POST) надіслана!";
+$_lang["error_no_id"] = "Не вказано ID у вашому запиті!";
+$_lang["error_id_nan"] = "ID переданого запиту порожній!";
+$_lang["error_no_parent"] = "Не вдалося знайти ім'я батьківського документа!";
+$_lang["error_parent_deleted"] = "Не вдалося виконати, бо батько відзначень як віддалень!";
+$_lang["error_many_results"] = "Занадто багато результатів повертається з бази даних!";
+$_lang["error_no_results"] = "Результати з бази даних не повернулися або повернулися не повністю!";
+$_lang["error_no_user_selected"] = "Не вказано отримувача цього повідомлення!";
+$_lang["error_no_group_selected"] = "Не вказано групу одержувачів для цього повідомлення!";
+$_lang["error_movedocument1"] = "Документ не може бути своїм батьком!";
+$_lang["error_movedocument2"] = "ID документа не пройшов у запиті!";
+$_lang["error_movedocument3"] = "Новий батько не вказаний!";
+$_lang["error_internet_connection"] = "Сервер недоступний, перевірте підключення до інтернету!";
+
+$_lang["login_processor_unknown_user"] = "Невірно вказано логін або пароль!";
+$_lang["login_processor_wrong_password"] = "Невірно вказано логін або пароль!";
+$_lang["login_processor_many_failed_logins"] = "Дуже багато невдалих спроб увійти, ви заблоковані!";
+$_lang["login_processor_blocked1"] = "Ви заблоковані та не можете увійти!";
+$_lang["login_processor_blocked2"] = "Ви заблоковані та не можете увійти! Спробуйте увійти пізніше.";
+$_lang["login_processor_blocked3"] = "Ви заблоковані автоматично після вказаної дати, і ви не можете увійти!";
+$_lang["login_processor_bad_code"] = "Перевірний код введений неправильно! Спробуйте ще раз!";
+$_lang["login_processor_remotehost_ip"] = "Ваше ім'я хоста не вказує на ваш IP!";
+$_lang["login_processor_remote_ip"] = "Ви не можете увійти до системи з цього місця.";
+$_lang["login_processor_date"] = "Ви не можете зараз увійти. Будь ласка, повторіть спробу пізніше.";
+$_lang["login_processor_captcha_config"] = "Капча не настроєна належним чином.";
+
+$_lang["dp_dayNames"] = "['Неділя', 'Понеділок', 'Вівторок', 'Середа', 'Четвер', 'П'ятниця', 'Субота']";
+$_lang["dp_monthNames"] = "['Січень', 'Лютий', 'Березень', 'Квітень', 'Май', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'] ";
+$_lang["dp_startDay"] = "1";
+
+$_lang["check_all"] = "Включити усі";
+$_lang["check_none"] = "Вимкнути все";
+$_lang["check_toggle"] = "Перемкнути";
+
+$_lang["version_notices"] = "Повідомлення про версії";
+
+$_lang["em_button_shift"] = "(Shift + клік, щоб відкрити кілька вікон)";
+
+$_lang["reset_sysfiles_checksum_button"] = "Оновити контрольну суму";
+$_lang["reset_sysfiles_checksum_alert"] = "Ви впевнені, що хочете скинути контрольну суму системних файлів?";
+
+$_lang["file_browser_disabled_msg"] = "Файл-браузер вимкнено.";
+$_lang["which_browser_default_title"]= "Файл-браузер за замовчуванням";
+$_lang["which_browser_default_msg"]= "Вкажіть Файл-браузер за замовчуванням. У налаштуваннях менеджерів ви можете вказати файл-браузер відмінний від системного.";
+$_lang["which_browser_title"]= "Файл-браузер";
+$_lang["which_browser_msg"]= "Ви можете вибрати файл-браузер для цього користувача. Або залиште за замовчуванням";
+$_lang["option_default"] = "За замовчуванням";
+$_lang["position"] = "Позиція";
+$_lang["are_you_sure"] = "Ви впевнені?";
+
+$_lang['evo_downloads_title'] = "Evolution Downloads";
+$_lang['help_translating_title'] ="Допомога з перекладом Evolution CMS";
+$_lang['download'] = "Скачати";
+$_lang['downloads'] = "Завантаження";
+$_lang["previous_releases"] = "Попередній реліз";
+$_lang["extras"] = "Extras";
+
+$_lang["display_locks"] = "Відображати блокування";
+$_lang["role_display_locks"] = "Відображати блокування";
+$_lang["session_timeout"] = "Тайм-аут сесії";
+$_lang["session_timeout_msg"] = "EVO пінгуватиме сервер раз на хвилину, щоб оновити сеанс (сесію). Якщо останній пінг перевищує цей параметр, пов'язаний з ним сеанс буде вважатися недійсним, і всі пов'язані з ним блокування будуть автоматично видалені. Встановлене значення в хвилинах (> 2хв, за замовчуванням 15хв).";
+$_lang["unlock_element_id_warning"] = "Ви впевнені, що хочете розблокувати [+element_type+] (ID [+id+])?";
+$_lang["lock_element_type_1"] = "Шаблон";
+$_lang["lock_element_type_2"] = "Template-Variable";
+$_lang["lock_element_type_3"] = "Чанк";
+$_lang["lock_element_type_4"] = "Сніппет";
+$_lang["lock_element_type_5"] = "Плагін";
+$_lang["lock_element_type_6"] = "Модуль";
+$_lang["lock_element_type_7"] = "Ресурс";
+$_lang["lock_element_type_8"] = "Роль";
+$_lang["lock_element_editing"] = "Ви редагуєте [+element_type+] з \n[+lasthit_df+]";
+$_lang["lock_element_locked_by"] = "Цей [+element_type+] заблокований користувачем [+username+], з ";
+
+$_lang["minifyphp_incache_title"] = 'Стиснути код php у файлі кеша';
+$_lang["minifyphp_incache_message"] = 'Стиск PHP коду(сніпетів та плагінів) та збереження у файл кешу, реф: #938 ';
+
+$_lang["logout_reminder_msg"] ="Нагадування: Схоже [+date+] Ви забули вийти із системи. Будь ласка, зверніть увагу в майбутньому, потрібно виходити із системи після того, як закінчили роботу.";
+
+$_lang["allow_eval_title"] = "Використання функції EVAL";
+$_lang["allow_eval_msg"] = "Для розробників: використовуйте \$modx->safeEval().";
+$_lang["allow_eval_with_scan"] = "Виконувати лише дозволені функції наведені нижче";
+$_lang["allow_eval_with_scan_at_post"] = "Дозволено всі. Але при POST тільки вказані нижче";
+$_lang["allow_eval_everytime_eval"] = "Дозволено всі (використовувати тільки для налагодження)";
+$_lang["allow_eval_dont_eval"] = "Не відображати всі функції";
+
+$_lang["safe_functions_at_eval_title"] = "Дозволені функції в EVAL";
+$_lang["safe_functions_at_eval_msg"] = "Список розділений комами";
+
+$_lang["multiple_sessions_msg"] = "Інформація: Кілька активних сесій (всього [+total+]) знайдено для користувача [+username+] .";
+$_lang["iconv_not_available"] = "Важливо встановити/увімкнути розширення iconv. Будь ласка, зв'яжіться зі своїм провайдером, якщо Ви не знаєте, як його увімкнути.";
+
+$_lang["cm_create_new_category"] = "Створити нову категорію";
+$_lang["cm_category_name"] = "Назва категорії";
+$_lang["cm_category_position"] = "Позиція категорії";
+$_lang["cm_no_x_assigned"] = "
+Чи не %s присвоєно";
+$_lang["cm_save_categorization"] = "Зберегти список категорій";
+$_lang["cm_update_categories"] = "Оновити категорії";
+$_lang["cm_assigned_elements"] = "Призначені елементи";
+$_lang["cm_edit_name"] = "Редагувати ім'я";
+$_lang["cm_mark_for_deletion"] = "Відзначити для видалення";
+$_lang["cm_delete_now"] = "Видалити негайно";
+$_lang["cm_delete_element_x_now"] = "
+Видалити %s негайно";
+$_lang["cm_select_element_group"] = "Вибрати елемент групи";
+$_lang["cm_global_messages"] = "Глобальні повідомлення";
+$_lang["cm_add_new_category"] = "Додати нову категорію";
+$_lang["cm_edit_categories"] = "Редагувати категорії";
+$_lang["cm_sort_categories"] = "Сортувати категорії";
+$_lang["cm_categorize_elements"] = "Класифікувати елементи";
+$_lang["cm_translation"] = "Переклад";
+$_lang["cm_translations"] = "Переклади";
+$_lang["cm_categorize_x"] = "Класифікувати %s ";
+$_lang["cm_unknown_error"] = "Щось пішло не так...";
+$_lang["cm_x_assigned_to_category_y"] = "%s (%s) присвоєно категорії %s (%s) ";
+$_lang["cm_no_categorization"] = "Класифікація не проводилася.";
+$_lang["cm_no_changes"] = "Нічого міняти, тому змін не було.";
+$_lang["cm_x_changes_made"] = "%s змін зроблено";
+$_lang["cm_enter_name_for_category"] = "Будь ласка, введіть ім'я для нової категорії";
+$_lang["cm_category_x_exists"] = "Категорія %s вже існує.";
+$_lang["cm_category_x_saved_at_position_y"] = "Нова категорія %s збережена на позиції %s .";
+$_lang["cm_category_x_moved_to_position_y"] = "Категорія %s переміщена до позиції %s ";
+$_lang["cm_category_x_deleted"] = "Категорія %s видалена";
+$_lang["cm_category_x_renamed_to_y"] = "Категорія %s перейменована на %s ";
+$_lang["cm_translation_for_x_empty"] = "Переклад для %s порожній";
+$_lang["cm_translation_for_x_to_y_success"] = "Переклад для %s до %s успішно збережений";
+$_lang["cm_save_new_sorting"] = "Зберегти нове сортування";
+$_lang["cm_translate_phrases"] = "Перекласти фрази";
+$_lang["cm_translate_module_phrases"] = "Перекласти фрази модуля";
+$_lang["cm_native_phrase"] = "Рідна фраза";
+
+$_lang["btn_view_options"] = 'Показати параметри';
+$_lang["view_options_msg"] = 'Відображення та перерахування елементів можна налаштувати за допомогою кнопки \'Перегляд параметрів\'. Налаштування зберігаються та відновлюються у кожному браузері за допомогою локального сховища HTML5.';
+$_lang["viewopts_title"] = 'Показати параметри';
+$_lang["viewopts_cb_buttons"] = 'Кнопки';
+$_lang["viewopts_cb_descriptions"] = 'Описи';
+$_lang["viewopts_cb_icons"] = 'Іконки';
+$_lang["viewopts_radio_list"] = 'Список';
+$_lang["viewopts_radio_inline"] = 'Інлайн';
+$_lang["viewopts_radio_flex"] = 'Флекс';
+$_lang["viewopts_fontsize"] = 'Розмір шрифту';
+$_lang["viewopts_cb_alltabs"] = 'Всі таби';
+
+$_lang['email_sender_method'] = 'Відправник листалиста';
+$_lang['auto'] = 'Автовизначення';
+$_lang['use_emailsender'] = 'Використовуйте значення [(emailsender)]';
+$_lang['email_sender_method_message'] = 'Відправник листа. Це зазвичай перетворюється одержувачем на заголовок Return-Path, і це адреса, на яку буде надіслано відповідь. Автоматичне визначення спрацює в більшості випадків.';
+
+$_lang['login_form_position_title'] = 'Положення форми авторизації';
+$_lang['login_form_position_left'] = 'ліворуч';
+$_lang['login_form_position_center'] = 'по центру';
+$_lang['login_form_position_right'] = 'праворуч';
+$_lang['login_form_style'] = 'Стиль форми авторизації:';
+$_lang['login_form_style_dark'] = 'Темний';
+$_lang['login_form_style_light'] = 'Світлий';
+$_lang['login_logo_title'] = 'Логотип на сторінці авторизації';
+$_lang['login_logo_message'] = 'Рекомендований розмір логотипу за шириною: 360px, тип .png';
+$_lang['login_bg_title'] = 'Фонове зображення на сторінці авторизації';
+$_lang['login_bg_message'] = 'Рекомендований розмір фонового зображення за шириною: 1920px';
+
+$_lang['manager_menu_position_title'] = 'Розташування основного меню';
+$_lang['manager_menu_position_top'] = 'нагорі';
+$_lang['manager_menu_position_left'] = 'ліворуч';
+
+$_lang['invalid_event_response'] = 'Подія %s повернула неправильний результат';
\ No newline at end of file
diff --git a/manager/includes/mutate_settings.ajax.php b/manager/includes/mutate_settings.ajax.php
index caee7e9249..40935a4ed6 100755
--- a/manager/includes/mutate_settings.ajax.php
+++ b/manager/includes/mutate_settings.ajax.php
@@ -11,7 +11,7 @@
$action = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['action']);
$lang = preg_replace('/[^A-Za-z0-9_\s\+\-\.\/]/', '', $_POST['lang']);
$key = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['key']);
-$value = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['value']);
+$value = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['value'] ?? '');
$action = $modx->db->escape($action);
$lang = $modx->db->escape($lang);
diff --git a/manager/includes/rss.inc.php b/manager/includes/rss.inc.php
index c3328894a0..9ee9ec5933 100755
--- a/manager/includes/rss.inc.php
+++ b/manager/includes/rss.inc.php
@@ -26,66 +26,32 @@
NO NEED TO EDIT BELOW THIS LINE
---------------------------------------------- */
-// include MagPieRSS
-require_once(MODX_MANAGER_PATH . 'media/rss/rss_fetch.inc');
-/**
- * Convert relative path into absolute url
- *
- * @param string $rel
- * @param string $base
- * @return string
- */
-function rel2abs($rel, $base)
-{
- // parse base URL and convert to local variables: $scheme, $host, $path
- $tmp = parse_url($base);
- extract($tmp);
- if (strpos($rel, "//") === 0) {
- return $scheme . ':' . $rel;
- }
- // return if already absolute URL
- if (parse_url($rel, PHP_URL_SCHEME) != '') {
- return $rel;
- }
- // queries and anchors
- if ($rel[0] == '#' || $rel[0] == '?') {
- return $base . $rel;
- }
- // remove non-directory element from path
- $path = preg_replace('#/[^/]*$#', '', $path);
- // destroy path if relative url points to root
- if ($rel[0] == '/') {
- $path = '';
- }
- // dirty absolute URL
- $abs = $host . $path . "/" . $rel;
- // replace '//' or '/./' or '/foo/../' with '/'
- $abs = preg_replace("/(\/\.?\/)/", "/", $abs);
- $abs = preg_replace("/\/(?!\.\.)[^\/]+\/\.\.\//", "/", $abs);
-
- // absolute URL is ready!
- return $scheme . '://' . $abs;
+if (!class_exists('SimplePie\SimplePie')) {
+ require_once(MODX_MANAGER_PATH . 'media/rss/vendor/autoload.php');
}
-
-$feedData = array();
-
+$feed = new SimplePie\SimplePie();
+$feedCache = MODX_BASE_PATH . 'assets/cache/rss';
+if (!is_dir($feedCache)) {
+ @mkdir($feedCache, intval($modx->getConfig('new_folder_permissions'), 8), true);
+}
+$feed->set_cache_location($feedCache);
// create Feed
foreach ($urls as $section => $url) {
$output = '';
- $rss = @fetch_rss($url);
- if (!$rss) {
+ $feed->set_feed_url($url);
+ $feed->init();
+ $items = $feed->get_items(0, $itemsNumber);
+ if (empty($items)) {
$feedData[$section] = 'Failed to retrieve ' . $url;
continue;
}
$output .= '';
-
- $items = array_slice($rss->items, 0, $itemsNumber);
foreach ($items as $item) {
- $href = rel2abs($item['link'], 'https://github.com');
- $title = $item['title'];
- $pubdate = $item['pubdate'];
+ $href = $item->get_link();
+ $title = $item->get_title();
+ $pubdate = $item->get_date();
$pubdate = $modx->toDateFormat(strtotime($pubdate));
- $description = strip_tags($item['description']);
+ $description = strip_tags($item->get_content());
if (strlen($description) > 199) {
$description = substr($description, 0, 200);
$description .= '... Read more .';
diff --git a/manager/includes/tmplvars.commands.inc.php b/manager/includes/tmplvars.commands.inc.php
index 8137692b9d..8bf4a81879 100755
--- a/manager/includes/tmplvars.commands.inc.php
+++ b/manager/includes/tmplvars.commands.inc.php
@@ -73,22 +73,22 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA
case "INHERIT" :
$output = $param; // Default to param value if no content from parents
- $doc = $modx->getPageInfo($docid, 0, 'id,parent');
+ $doc = $modx->getPageInfo($docid, 0, 'id,parent', false);
while ($doc['parent'] != 0) {
$parent_id = $doc['parent'];
// Grab document regardless of publish status
- $doc = $modx->getPageInfo($parent_id, 0, 'id,parent,published');
+ $doc = $modx->getPageInfo($parent_id, 0, 'id,parent,published', false);
if ($doc['parent'] != 0 && !$doc['published'])
continue; // hide unpublished docs if we're not at the top
- $tv = $modx->getTemplateVar($name, '*', $doc['id'], $doc['published']);
+ $tv = $modx->getTemplateVar($name, '*', $doc['id'], $doc['published'], false);
// if an inherited value is found and if there is content following the @INHERIT binding
// remove @INHERIT and output that following content. This content could contain other
// @ bindings, that are processed in the next step
- if ((string) $tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) {
+ if (!empty($tv) && $tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) {
$output = trim(str_replace('@INHERIT', '', (string) $tv['value']));
break 2;
}
diff --git a/manager/includes/tmplvars.format.inc.php b/manager/includes/tmplvars.format.inc.php
index 862e00e76a..978f4e0064 100755
--- a/manager/includes/tmplvars.format.inc.php
+++ b/manager/includes/tmplvars.format.inc.php
@@ -101,8 +101,8 @@ function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype =
$value = 'now';
}
$timestamp = getUnixtimeFromDateString($value);
- $p = $params['format'] ? $params['format'] : "%A %d, %B %Y";
- $o = strftime($p, $timestamp);
+ $p = $params['format'] ? $params['format'] : "l d, F Y";
+ $o = date($p, $timestamp);
} else {
$value = '';
}
@@ -113,7 +113,7 @@ function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype =
$o = '';
$countValue = count($value);
for($i = 0; $i < $countValue; $i++) {
- list($name, $url) = is_array($value[$i]) ? $value[$i] : explode("==", $value[$i]);
+ list($name, $url) = is_array($value[$i]) ? $value[$i] : array_merge(explode("==", $value[$i]), ['']);
if(!$url) {
$url = $name;
}
diff --git a/manager/includes/tmplvars.inc.php b/manager/includes/tmplvars.inc.php
index 82116c8aad..6dd0d093f5 100755
--- a/manager/includes/tmplvars.inc.php
+++ b/manager/includes/tmplvars.inc.php
@@ -65,7 +65,7 @@ function renderFormElement($field_type, $field_id, $default_text = '', $field_el
$field_html .= '';
$index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray));
foreach($index_list as $item => $itemvalue) {
- list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue);
+ list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : array_merge(explode("==", $itemvalue), ['']);
if(strlen($itemvalue) == 0) {
$itemvalue = $item;
}
@@ -77,7 +77,7 @@ function renderFormElement($field_type, $field_id, $default_text = '', $field_el
$field_html .= '';
$index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray));
foreach($index_list as $item => $itemvalue) {
- list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue);
+ list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : array_merge(explode("==", $itemvalue), ['']);
if(strlen($itemvalue) == 0) {
$itemvalue = $item;
}
@@ -90,7 +90,7 @@ function renderFormElement($field_type, $field_id, $default_text = '', $field_el
$field_html .= '';
$index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray));
foreach($index_list as $item => $itemvalue) {
- list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue);
+ list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : array_merge(explode("==", $itemvalue), ['']);
if(strlen($itemvalue) == 0) {
$itemvalue = $item;
}
@@ -152,7 +152,7 @@ function renderFormElement($field_type, $field_id, $default_text = '', $field_el
$index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray));
static $i = 0;
foreach($index_list as $item => $itemvalue) {
- list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue);
+ list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : array_merge(explode("==", $itemvalue), ['']);
if(strlen($itemvalue) == 0) {
$itemvalue = $item;
}
diff --git a/manager/media/browser/mcpuk/core/browser.php b/manager/media/browser/mcpuk/core/browser.php
index def5b14149..f6a34c6483 100755
--- a/manager/media/browser/mcpuk/core/browser.php
+++ b/manager/media/browser/mcpuk/core/browser.php
@@ -988,7 +988,7 @@ protected function getFiles($dir)
'name' => stripcslashes($name),
'size' => $stat['size'],
'mtime' => $stat['mtime'],
- 'date' => @strftime($this->dateTimeSmall, $stat['mtime']),
+ 'date' => date($this->dateTimeSmall, $stat['mtime']),
'readable' => is_readable($file),
'writable' => file::isWritable($file),
'bigIcon' => $bigIcon,
diff --git a/manager/media/browser/mcpuk/core/uploader.php b/manager/media/browser/mcpuk/core/uploader.php
index aa2492e090..f8950278b2 100755
--- a/manager/media/browser/mcpuk/core/uploader.php
+++ b/manager/media/browser/mcpuk/core/uploader.php
@@ -658,9 +658,9 @@ protected function localize($langCode) {
require "lang/{$langCode}.php";
setlocale(LC_ALL, $lang['_locale']);
$this->charset = $lang['_charset'];
- $this->dateTimeFull = $lang['_dateTimeFull'];
- $this->dateTimeMid = $lang['_dateTimeMid'];
- $this->dateTimeSmall = $lang['_dateTimeSmall'];
+ $this->dateTimeFull = $this->convertDateFormat($lang['_dateTimeFull']);
+ $this->dateTimeMid = $this->convertDateFormat($lang['_dateTimeMid']);
+ $this->dateTimeSmall = $this->convertDateFormat($lang['_dateTimeSmall']);
unset($lang['_locale']);
unset($lang['_charset']);
unset($lang['_dateTimeFull']);
@@ -669,6 +669,20 @@ protected function localize($langCode) {
$this->labels = $lang;
}
+ protected function convertDateFormat($format)
+ {
+ $replace = [
+ '%d' => 'd', '%a' => 'D', '%e' => 'j', '%A' => 'l', '%u' => 'N', '%w' => 'w', '%j' => 'z',
+ '%V' => 'W',
+ '%B' => 'F', '%m' => 'm', '%b' => 'M',
+ '%G' => 'o', '%Y' => 'Y', '%y' => 'y',
+ '%P' => 'a', '%p' => 'A', '%l' => 'g', '%I' => 'h', '%H' => 'H', '%M' => 'i', '%S' => 's',
+ '%z' => 'O', '%Z' => 'T',
+ '%s' => 'U'
+ ];
+ return strtr((string)$format, $replace);
+ }
+
/**
* @param $string
* @param array|null $data
diff --git a/manager/media/rss/composer.json b/manager/media/rss/composer.json
new file mode 100644
index 0000000000..a3e69a983e
--- /dev/null
+++ b/manager/media/rss/composer.json
@@ -0,0 +1,5 @@
+{
+ "require": {
+ "simplepie/simplepie": "^1.6"
+ }
+}
diff --git a/manager/media/rss/composer.lock b/manager/media/rss/composer.lock
new file mode 100644
index 0000000000..c1ce3ef442
--- /dev/null
+++ b/manager/media/rss/composer.lock
@@ -0,0 +1,93 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "a6f0b30f92b72ba72252d4ed18102da2",
+ "packages": [
+ {
+ "name": "simplepie/simplepie",
+ "version": "1.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/simplepie/simplepie.git",
+ "reference": "2bdbc51ed1010941c9c5f2cddca433e79665bfe1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/simplepie/simplepie/zipball/2bdbc51ed1010941c9c5f2cddca433e79665bfe1",
+ "reference": "2bdbc51ed1010941c9c5f2cddca433e79665bfe1",
+ "shasum": ""
+ },
+ "require": {
+ "ext-pcre": "*",
+ "ext-xml": "*",
+ "ext-xmlreader": "*",
+ "php": ">=5.6.0"
+ },
+ "require-dev": {
+ "yoast/phpunit-polyfills": "^1.0.1"
+ },
+ "suggest": {
+ "ext-curl": "",
+ "ext-iconv": "",
+ "ext-intl": "",
+ "ext-mbstring": "",
+ "mf2/mf2": "Microformat module that allows for parsing HTML for microformats"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "SimplePie": "library"
+ },
+ "psr-4": {
+ "SimplePie\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Ryan Parman",
+ "homepage": "http://ryanparman.com/",
+ "role": "Creator, alumnus developer"
+ },
+ {
+ "name": "Sam Sneddon",
+ "homepage": "https://gsnedders.com/",
+ "role": "Alumnus developer"
+ },
+ {
+ "name": "Ryan McCue",
+ "email": "me@ryanmccue.info",
+ "homepage": "http://ryanmccue.info/",
+ "role": "Developer"
+ }
+ ],
+ "description": "A simple Atom/RSS parsing library for PHP",
+ "homepage": "http://simplepie.org/",
+ "keywords": [
+ "atom",
+ "feeds",
+ "rss"
+ ],
+ "support": {
+ "issues": "https://github.com/simplepie/simplepie/issues",
+ "source": "https://github.com/simplepie/simplepie/tree/1.6.0"
+ },
+ "time": "2022-04-21T11:05:19+00:00"
+ }
+ ],
+ "packages-dev": [],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": [],
+ "plugin-api-version": "2.3.0"
+}
diff --git a/manager/media/rss/extlib/Snoopy.class.inc b/manager/media/rss/extlib/Snoopy.class.inc
deleted file mode 100755
index 9bf7e493f9..0000000000
--- a/manager/media/rss/extlib/Snoopy.class.inc
+++ /dev/null
@@ -1,1000 +0,0 @@
-
- * Copyright (c): 1999-2014, all rights reserved
- * Version: 2.0.0
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * You may contact the author of Snoopy by e-mail at:
- * monte@ohrt.com
- *
- * The latest version of Snoopy can be obtained from:
- * http://snoopy.sourceforge.net/
- *************************************************/
-class Snoopy
-{
- /**** Public variables ****/
-
- /* user definable vars */
-
- var $scheme = 'http'; // http or https
- var $host = "www.php.net"; // host name we are connecting to
- var $port = 80; // port we are connecting to
- var $proxy_host = ""; // proxy host to use
- var $proxy_port = ""; // proxy port to use
- var $proxy_user = ""; // proxy user to use
- var $proxy_pass = ""; // proxy password to use
-
- var $agent = "Snoopy v2.0.0"; // agent we masquerade as
- var $referer = ""; // referer info to pass
- var $cookies = array(); // array of cookies to pass
- // $cookies["username"]="joe";
- var $rawheaders = array(); // array of raw headers to send
- // $rawheaders["Content-type"]="text/html";
-
- var $maxredirs = 5; // http redirection depth maximum. 0 = disallow
- var $lastredirectaddr = ""; // contains address of last redirected address
- var $offsiteok = true; // allows redirection off-site
- var $maxframes = 0; // frame content depth maximum. 0 = disallow
- var $expandlinks = true; // expand links to fully qualified URLs.
- // this only applies to fetchlinks()
- // submitlinks(), and submittext()
- var $passcookies = true; // pass set cookies back through redirects
- // NOTE: this currently does not respect
- // dates, domains or paths.
-
- var $user = ""; // user for http authentication
- var $pass = ""; // password for http authentication
-
- // http accept types
- var $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
-
- var $results = ""; // where the content is put
-
- var $error = ""; // error messages sent here
- var $response_code = ""; // response code returned from server
- var $headers = array(); // headers returned from server sent here
- var $maxlength = 500000; // max return data length (body)
- var $read_timeout = 0; // timeout on read operations, in seconds
- // supported only since PHP 4 Beta 4
- // set to 0 to disallow timeouts
- var $timed_out = false; // if a read operation timed out
- var $status = 0; // http request status
-
- var $temp_dir = "/tmp"; // temporary directory that the webserver
- // has permission to write to.
- // under Windows, this should be C:\temp
-
- var $curl_path = false;
- // deprecated, snoopy no longer uses curl for https requests,
- // but instead requires the openssl extension.
-
- // send Accept-encoding: gzip?
- var $use_gzip = true;
-
- // file or directory with CA certificates to verify remote host with
- var $cafile;
- var $capath;
-
- /**** Private variables ****/
-
- var $_maxlinelen = 4096; // max line length (headers)
-
- var $_httpmethod = "GET"; // default http request method
- var $_httpversion = "HTTP/1.0"; // default http request version
- var $_submit_method = "POST"; // default submit method
- var $_submit_type = "application/x-www-form-urlencoded"; // default submit type
- var $_mime_boundary = ""; // MIME boundary for multipart/form-data submit type
- var $_redirectaddr = false; // will be set if page fetched is a redirect
- var $_redirectdepth = 0; // increments on an http redirect
- var $_frameurls = array(); // frame src urls
- var $_framedepth = 0; // increments on frame depth
-
- var $_isproxy = false; // set if using a proxy server
- var $_fp_timeout = 30; // timeout for socket connection
-
- /*======================================================================*\
- Function: fetch
- Purpose: fetch the contents of a web page
- (and possibly other protocols in the
- future like ftp, nntp, gopher, etc.)
- Input: $URI the location of the page to fetch
- Output: $this->results the output text from the fetch
- \*======================================================================*/
-
- function fetch($URI)
- {
-
- $URI_PARTS = parse_url($URI);
- if (!empty($URI_PARTS["user"]))
- $this->user = $URI_PARTS["user"];
- if (!empty($URI_PARTS["pass"]))
- $this->pass = $URI_PARTS["pass"];
- if (empty($URI_PARTS["query"]))
- $URI_PARTS["query"] = '';
- if (empty($URI_PARTS["path"]))
- $URI_PARTS["path"] = '';
-
- $fp = null;
-
- switch (strtolower($URI_PARTS["scheme"])) {
- case "https":
- if (!extension_loaded('openssl')) {
- trigger_error("openssl extension required for HTTPS", E_USER_ERROR);
- exit;
- }
- $this->port = 443;
- case "http":
- $this->scheme = strtolower($URI_PARTS["scheme"]);
- $this->host = $URI_PARTS["host"];
- if (!empty($URI_PARTS["port"]))
- $this->port = $URI_PARTS["port"];
- if ($this->_connect($fp)) {
- if ($this->_isproxy) {
- // using proxy, send entire URI
- $this->_httprequest($URI, $fp, $URI, $this->_httpmethod);
- } else {
- $path = $URI_PARTS["path"] . ($URI_PARTS["query"] ? "?" . $URI_PARTS["query"] : "");
- // no proxy, send only the path
- $this->_httprequest($path, $fp, $URI, $this->_httpmethod);
- }
-
- $this->_disconnect($fp);
-
- if ($this->_redirectaddr) {
- /* url was redirected, check if we've hit the max depth */
- if ($this->maxredirs > $this->_redirectdepth) {
- // only follow redirect if it's on this site, or offsiteok is true
- if (preg_match("|^https?://" . preg_quote($this->host) . "|i", $this->_redirectaddr) || $this->offsiteok) {
- /* follow the redirect */
- $this->_redirectdepth++;
- $this->lastredirectaddr = $this->_redirectaddr;
- $this->fetch($this->_redirectaddr);
- }
- }
- }
-
- if ($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) {
- $frameurls = $this->_frameurls;
- $this->_frameurls = array();
-
- foreach ($frameurls as $frameurl) {
- if ($this->_framedepth < $this->maxframes) {
- $this->fetch($frameurl);
- $this->_framedepth++;
- } else
- break;
- }
- }
- } else {
- return false;
- }
- return $this;
- break;
- default:
- // not a valid protocol
- $this->error = 'Invalid protocol "' . $URI_PARTS["scheme"] . '"\n';
- return false;
- break;
- }
- return $this;
- }
-
- /*======================================================================*\
- Function: submit
- Purpose: submit an http(s) form
- Input: $URI the location to post the data
- $formvars the formvars to use.
- format: $formvars["var"] = "val";
- $formfiles an array of files to submit
- format: $formfiles["var"] = "/dir/filename.ext";
- Output: $this->results the text output from the post
- \*======================================================================*/
-
- function submit($URI, $formvars = "", $formfiles = "")
- {
- unset($postdata);
-
- $postdata = $this->_prepare_post_body($formvars, $formfiles);
-
- $URI_PARTS = parse_url($URI);
- if (!empty($URI_PARTS["user"]))
- $this->user = $URI_PARTS["user"];
- if (!empty($URI_PARTS["pass"]))
- $this->pass = $URI_PARTS["pass"];
- if (empty($URI_PARTS["query"]))
- $URI_PARTS["query"] = '';
- if (empty($URI_PARTS["path"]))
- $URI_PARTS["path"] = '';
-
- switch (strtolower($URI_PARTS["scheme"])) {
- case "https":
- if (!extension_loaded('openssl')) {
- trigger_error("openssl extension required for HTTPS", E_USER_ERROR);
- exit;
- }
- $this->port = 443;
- case "http":
- $this->scheme = strtolower($URI_PARTS["scheme"]);
- $this->host = $URI_PARTS["host"];
- if (!empty($URI_PARTS["port"]))
- $this->port = $URI_PARTS["port"];
- if ($this->_connect($fp)) {
- if ($this->_isproxy) {
- // using proxy, send entire URI
- $this->_httprequest($URI, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata);
- } else {
- $path = $URI_PARTS["path"] . ($URI_PARTS["query"] ? "?" . $URI_PARTS["query"] : "");
- // no proxy, send only the path
- $this->_httprequest($path, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata);
- }
-
- $this->_disconnect($fp);
-
- if ($this->_redirectaddr) {
- /* url was redirected, check if we've hit the max depth */
- if ($this->maxredirs > $this->_redirectdepth) {
- if (!preg_match("|^" . $URI_PARTS["scheme"] . "://|", $this->_redirectaddr))
- $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr, $URI_PARTS["scheme"] . "://" . $URI_PARTS["host"]);
-
- // only follow redirect if it's on this site, or offsiteok is true
- if (preg_match("|^https?://" . preg_quote($this->host) . "|i", $this->_redirectaddr) || $this->offsiteok) {
- /* follow the redirect */
- $this->_redirectdepth++;
- $this->lastredirectaddr = $this->_redirectaddr;
- if (strpos($this->_redirectaddr, "?") > 0)
- $this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get
- else
- $this->submit($this->_redirectaddr, $formvars, $formfiles);
- }
- }
- }
-
- if ($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) {
- $frameurls = $this->_frameurls;
- $this->_frameurls = array();
-
- foreach ($frameurls as $frameurl) {
- if ($this->_framedepth < $this->maxframes) {
- $this->fetch($frameurl);
- $this->_framedepth++;
- } else
- break;
- }
- }
-
- } else {
- return false;
- }
- return $this;
- break;
- default:
- // not a valid protocol
- $this->error = 'Invalid protocol "' . $URI_PARTS["scheme"] . '"\n';
- return false;
- break;
- }
- return $this;
- }
-
- /*======================================================================*\
- Function: fetchlinks
- Purpose: fetch the links from a web page
- Input: $URI where you are fetching from
- Output: $this->results an array of the URLs
- \*======================================================================*/
-
- function fetchlinks($URI)
- {
- if ($this->fetch($URI) !== false) {
- if ($this->lastredirectaddr)
- $URI = $this->lastredirectaddr;
- if (is_array($this->results)) {
- for ($x = 0; $x < count($this->results); $x++)
- $this->results[$x] = $this->_striplinks($this->results[$x]);
- } else
- $this->results = $this->_striplinks($this->results);
-
- if ($this->expandlinks)
- $this->results = $this->_expandlinks($this->results, $URI);
- return $this;
- } else
- return false;
- }
-
- /*======================================================================*\
- Function: fetchform
- Purpose: fetch the form elements from a web page
- Input: $URI where you are fetching from
- Output: $this->results the resulting html form
- \*======================================================================*/
-
- function fetchform($URI)
- {
-
- if ($this->fetch($URI) !== false) {
-
- if (is_array($this->results)) {
- for ($x = 0; $x < count($this->results); $x++)
- $this->results[$x] = $this->_stripform($this->results[$x]);
- } else
- $this->results = $this->_stripform($this->results);
-
- return $this;
- } else
- return false;
- }
-
-
- /*======================================================================*\
- Function: fetchtext
- Purpose: fetch the text from a web page, stripping the links
- Input: $URI where you are fetching from
- Output: $this->results the text from the web page
- \*======================================================================*/
-
- function fetchtext($URI)
- {
- if ($this->fetch($URI) !== false) {
- if (is_array($this->results)) {
- for ($x = 0; $x < count($this->results); $x++)
- $this->results[$x] = $this->_striptext($this->results[$x]);
- } else
- $this->results = $this->_striptext($this->results);
- return $this;
- } else
- return false;
- }
-
- /*======================================================================*\
- Function: submitlinks
- Purpose: grab links from a form submission
- Input: $URI where you are submitting from
- Output: $this->results an array of the links from the post
- \*======================================================================*/
-
- function submitlinks($URI, $formvars = "", $formfiles = "")
- {
- if ($this->submit($URI, $formvars, $formfiles) !== false) {
- if ($this->lastredirectaddr)
- $URI = $this->lastredirectaddr;
- if (is_array($this->results)) {
- for ($x = 0; $x < count($this->results); $x++) {
- $this->results[$x] = $this->_striplinks($this->results[$x]);
- if ($this->expandlinks)
- $this->results[$x] = $this->_expandlinks($this->results[$x], $URI);
- }
- } else {
- $this->results = $this->_striplinks($this->results);
- if ($this->expandlinks)
- $this->results = $this->_expandlinks($this->results, $URI);
- }
- return $this;
- } else
- return false;
- }
-
- /*======================================================================*\
- Function: submittext
- Purpose: grab text from a form submission
- Input: $URI where you are submitting from
- Output: $this->results the text from the web page
- \*======================================================================*/
-
- function submittext($URI, $formvars = "", $formfiles = "")
- {
- if ($this->submit($URI, $formvars, $formfiles) !== false) {
- if ($this->lastredirectaddr)
- $URI = $this->lastredirectaddr;
- if (is_array($this->results)) {
- for ($x = 0; $x < count($this->results); $x++) {
- $this->results[$x] = $this->_striptext($this->results[$x]);
- if ($this->expandlinks)
- $this->results[$x] = $this->_expandlinks($this->results[$x], $URI);
- }
- } else {
- $this->results = $this->_striptext($this->results);
- if ($this->expandlinks)
- $this->results = $this->_expandlinks($this->results, $URI);
- }
- return $this;
- } else
- return false;
- }
-
-
- /*======================================================================*\
- Function: set_submit_multipart
- Purpose: Set the form submission content type to
- multipart/form-data
- \*======================================================================*/
- function set_submit_multipart()
- {
- $this->_submit_type = "multipart/form-data";
- return $this;
- }
-
-
- /*======================================================================*\
- Function: set_submit_normal
- Purpose: Set the form submission content type to
- application/x-www-form-urlencoded
- \*======================================================================*/
- function set_submit_normal()
- {
- $this->_submit_type = "application/x-www-form-urlencoded";
- return $this;
- }
-
-
-
-
- /*======================================================================*\
- Private functions
- \*======================================================================*/
-
-
- /*======================================================================*\
- Function: _striplinks
- Purpose: strip the hyperlinks from an html document
- Input: $document document to strip.
- Output: $match an array of the links
- \*======================================================================*/
-
- function _striplinks($document)
- {
- preg_match_all("'<\s*a\s.*?href\s*=\s* # find ]+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space
- 'isx", $document, $links);
-
-
- // catenate the non-empty matches from the conditional subpattern
-
- foreach ($links[2] as $key => $val) {
- if (!empty($val))
- $match[] = $val;
- }
-
- foreach ($links[3] as $key => $val) {
- if (!empty($val))
- $match[] = $val;
- }
-
- // return the links
- return $match;
- }
-
- /*======================================================================*\
- Function: _stripform
- Purpose: strip the form elements from an html document
- Input: $document document to strip.
- Output: $match an array of the links
- \*======================================================================*/
-
- function _stripform($document)
- {
- preg_match_all("'<\/?(FORM|INPUT|SELECT|TEXTAREA|(OPTION))[^<>]*>(?(2)(.*(?=<\/?(option|select)[^<>]*>[\r\n]*)|(?=[\r\n]*))|(?=[\r\n]*))'Usi", $document, $elements);
-
- // catenate the matches
- $match = implode("\r\n", $elements[0]);
-
- // return the links
- return $match;
- }
-
-
- /*======================================================================*\
- Function: _striptext
- Purpose: strip the text from an html document
- Input: $document document to strip.
- Output: $text the resulting text
- \*======================================================================*/
-
- function _striptext($document)
- {
-
- // I didn't use preg eval (//e) since that is only available in PHP 4.0.
- // so, list your entities one by one here. I included some of the
- // more common ones.
-
- $search = array("''si", // strip out javascript
- "'<[\/\!]*?[^<>]*?>'si", // strip out html tags
- "'([\r\n])[\s]+'", // strip out white space
- "'&(quot|#34|#034|#x22);'i", // replace html entities
- "'&(amp|#38|#038|#x26);'i", // added hexadecimal values
- "'&(lt|#60|#060|#x3c);'i",
- "'&(gt|#62|#062|#x3e);'i",
- "'&(nbsp|#160|#xa0);'i",
- "'&(iexcl|#161);'i",
- "'&(cent|#162);'i",
- "'&(pound|#163);'i",
- "'&(copy|#169);'i",
- "'&(reg|#174);'i",
- "'&(deg|#176);'i",
- "'&(#39|#039|#x27);'",
- "'&(euro|#8364);'i", // europe
- "'&a(uml|UML);'", // german
- "'&o(uml|UML);'",
- "'&u(uml|UML);'",
- "'&A(uml|UML);'",
- "'&O(uml|UML);'",
- "'&U(uml|UML);'",
- "'ß'i",
- );
- $replace = array("",
- "",
- "\\1",
- "\"",
- "&",
- "<",
- ">",
- " ",
- chr(161),
- chr(162),
- chr(163),
- chr(169),
- chr(174),
- chr(176),
- chr(39),
- chr(128),
- "ä",
- "ö",
- "ü",
- "Ä",
- "Ö",
- "Ü",
- "ß",
- );
-
- $text = preg_replace($search, $replace, $document);
-
- return $text;
- }
-
- /*======================================================================*\
- Function: _expandlinks
- Purpose: expand each link into a fully qualified URL
- Input: $links the links to qualify
- $URI the full URI to get the base from
- Output: $expandedLinks the expanded links
- \*======================================================================*/
-
- function _expandlinks($links, $URI)
- {
-
- preg_match("/^[^\?]+/", $URI, $match);
-
- $match = preg_replace("|/[^\/\.]+\.[^\/\.]+$|", "", $match[0]);
- $match = preg_replace("|/$|", "", $match);
- $match_part = parse_url($match);
- $match_root =
- $match_part["scheme"] . "://" . $match_part["host"];
-
- $search = array("|^http://" . preg_quote($this->host) . "|i",
- "|^(\/)|i",
- "|^(?!http://)(?!mailto:)|i",
- "|/\./|",
- "|/[^\/]+/\.\./|"
- );
-
- $replace = array("",
- $match_root . "/",
- $match . "/",
- "/",
- "/"
- );
-
- $expandedLinks = preg_replace($search, $replace, $links);
-
- return $expandedLinks;
- }
-
- /*======================================================================*\
- Function: _httprequest
- Purpose: go get the http(s) data from the server
- Input: $url the url to fetch
- $fp the current open file pointer
- $URI the full URI
- $body body contents to send if any (POST)
- Output:
- \*======================================================================*/
-
- function _httprequest($url, $fp, $URI, $http_method, $content_type = "", $body = "")
- {
- $cookie_headers = '';
- if ($this->passcookies && $this->_redirectaddr)
- $this->setcookies();
-
- $URI_PARTS = parse_url($URI);
- if (empty($url))
- $url = "/";
- $headers = $http_method . " " . $url . " " . $this->_httpversion . "\r\n";
- if (!empty($this->host) && !isset($this->rawheaders['Host'])) {
- $headers .= "Host: " . $this->host;
- if (!empty($this->port) && $this->port != '80')
- $headers .= ":" . $this->port;
- $headers .= "\r\n";
- }
- if (!empty($this->agent))
- $headers .= "User-Agent: " . $this->agent . "\r\n";
- if (!empty($this->accept))
- $headers .= "Accept: " . $this->accept . "\r\n";
- if ($this->use_gzip) {
- // make sure PHP was built with --with-zlib
- // and we can handle gzipp'ed data
- if (function_exists('gzinflate')) {
- $headers .= "Accept-encoding: gzip\r\n";
- } else {
- trigger_error(
- "use_gzip is on, but PHP was built without zlib support." .
- " Requesting file(s) without gzip encoding.",
- E_USER_NOTICE);
- }
- }
- if (!empty($this->referer))
- $headers .= "Referer: " . $this->referer . "\r\n";
- if (!empty($this->cookies)) {
- if (!is_array($this->cookies))
- $this->cookies = (array)$this->cookies;
-
- reset($this->cookies);
- if (count($this->cookies) > 0) {
- $cookie_headers .= 'Cookie: ';
- foreach ($this->cookies as $cookieKey => $cookieVal) {
- $cookie_headers .= $cookieKey . "=" . urlencode($cookieVal) . "; ";
- }
- $headers .= substr($cookie_headers, 0, -2) . "\r\n";
- }
- }
- if (!empty($this->rawheaders)) {
- if (!is_array($this->rawheaders))
- $this->rawheaders = (array)$this->rawheaders;
- foreach ($this->rawheaders as $headerKey => $headerVal) {
- $headers .= $headerKey . ": " . $headerVal . "\r\n";
- }
- }
- if (!empty($content_type)) {
- $headers .= "Content-type: $content_type";
- if ($content_type == "multipart/form-data")
- $headers .= "; boundary=" . $this->_mime_boundary;
- $headers .= "\r\n";
- }
- if (!empty($body))
- $headers .= "Content-length: " . strlen($body) . "\r\n";
- if (!empty($this->user) || !empty($this->pass))
- $headers .= "Authorization: Basic " . base64_encode($this->user . ":" . $this->pass) . "\r\n";
-
- //add proxy auth headers
- if (!empty($this->proxy_user))
- $headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass) . "\r\n";
-
-
- $headers .= "\r\n";
-
- // set the read timeout if needed
- if ($this->read_timeout > 0)
- socket_set_timeout($fp, $this->read_timeout);
- $this->timed_out = false;
-
- fwrite($fp, $headers . $body, strlen($headers . $body));
-
- $this->_redirectaddr = false;
- unset($this->headers);
-
- // content was returned gzip encoded?
- $is_gzipped = false;
-
- while ($currentHeader = fgets($fp, $this->_maxlinelen)) {
- if ($this->read_timeout > 0 && $this->_check_timeout($fp)) {
- $this->status = -100;
- return false;
- }
-
- if ($currentHeader == "\r\n")
- break;
-
- // if a header begins with Location: or URI:, set the redirect
- if (preg_match("/^(Location:|URI:)/i", $currentHeader)) {
- // get URL portion of the redirect
- preg_match("/^(Location:|URI:)[ ]+(.*)/i", chop($currentHeader), $matches);
- // look for :// in the Location header to see if hostname is included
- if (!preg_match("|\:\/\/|", $matches[2])) {
- // no host in the path, so prepend
- $this->_redirectaddr = $URI_PARTS["scheme"] . "://" . $this->host . ":" . $this->port;
- // eliminate double slash
- if (!preg_match("|^/|", $matches[2]))
- $this->_redirectaddr .= "/" . $matches[2];
- else
- $this->_redirectaddr .= $matches[2];
- } else
- $this->_redirectaddr = $matches[2];
- }
-
- if (preg_match("|^HTTP/|", $currentHeader)) {
- if (preg_match("|^HTTP/[^\s]*\s(.*?)\s|", $currentHeader, $status)) {
- $this->status = $status[1];
- }
- $this->response_code = $currentHeader;
- }
-
- if (preg_match("/Content-Encoding: gzip/", $currentHeader)) {
- $is_gzipped = true;
- }
-
- $this->headers[] = $currentHeader;
- }
-
- $results = '';
- do {
- $_data = fread($fp, $this->maxlength);
- if (strlen($_data) == 0) {
- break;
- }
- $results .= $_data;
- } while (true);
-
- // gunzip
- if ($is_gzipped) {
- // per http://www.php.net/manual/en/function.gzencode.php
- $results = substr($results, 10);
- $results = gzinflate($results);
- }
-
- if ($this->read_timeout > 0 && $this->_check_timeout($fp)) {
- $this->status = -100;
- return false;
- }
-
- // check if there is a a redirect meta tag
-
- if (preg_match("' ]*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i", $results, $match)) {
- $this->_redirectaddr = $this->_expandlinks($match[1], $URI);
- }
-
- // have we hit our frame depth and is there frame src to fetch?
- if (($this->_framedepth < $this->maxframes) && preg_match_all("' ]+)'i", $results, $match)) {
- $this->results[] = $results;
- for ($x = 0; $x < count($match[1]); $x++)
- $this->_frameurls[] = $this->_expandlinks($match[1][$x], $URI_PARTS["scheme"] . "://" . $this->host);
- } // have we already fetched framed content?
- elseif (is_array($this->results))
- $this->results[] = $results;
- // no framed content
- else
- $this->results = $results;
-
- return $this;
- }
-
- /*======================================================================*\
- Function: setcookies()
- Purpose: set cookies for a redirection
- \*======================================================================*/
-
- function setcookies()
- {
- for ($x = 0; $x < count($this->headers); $x++) {
- if (preg_match('/^set-cookie:[\s]+([^=]+)=([^;]+)/i', $this->headers[$x], $match))
- $this->cookies[$match[1]] = urldecode($match[2]);
- }
- return $this;
- }
-
-
- /*======================================================================*\
- Function: _check_timeout
- Purpose: checks whether timeout has occurred
- Input: $fp file pointer
- \*======================================================================*/
-
- function _check_timeout($fp)
- {
- if ($this->read_timeout > 0) {
- $fp_status = socket_get_status($fp);
- if ($fp_status["timed_out"]) {
- $this->timed_out = true;
- return true;
- }
- }
- return false;
- }
-
- /*======================================================================*\
- Function: _connect
- Purpose: make a socket connection
- Input: $fp file pointer
- \*======================================================================*/
-
- function _connect(&$fp)
- {
- if (!empty($this->proxy_host) && !empty($this->proxy_port)) {
- $this->_isproxy = true;
-
- $host = $this->proxy_host;
- $port = $this->proxy_port;
-
- if ($this->scheme == 'https') {
- trigger_error("HTTPS connections over proxy are currently not supported", E_USER_ERROR);
- exit;
- }
- } else {
- $host = $this->host;
- $port = $this->port;
- }
-
- $this->status = 0;
-
- $context_opts = array();
-
- if ($this->scheme == 'https') {
- // if cafile or capath is specified, enable certificate
- // verification (including name checks)
- if (isset($this->cafile) || isset($this->capath)) {
- $context_opts['ssl'] = array(
- 'verify_peer' => true,
- 'CN_match' => $this->host,
- 'disable_compression' => true,
- );
-
- if (isset($this->cafile))
- $context_opts['ssl']['cafile'] = $this->cafile;
- if (isset($this->capath))
- $context_opts['ssl']['capath'] = $this->capath;
- }
-
- $host = 'ssl://' . $host;
- }
-
- $context = stream_context_create($context_opts);
-
- if (version_compare(PHP_VERSION, '5.0.0', '>')) {
- if($this->scheme == 'http')
- $host = "tcp://" . $host;
- $fp = stream_socket_client(
- "$host:$port",
- $errno,
- $errmsg,
- $this->_fp_timeout,
- STREAM_CLIENT_CONNECT,
- $context);
- } else {
- $fp = fsockopen(
- $host,
- $port,
- $errno,
- $errstr,
- $this->_fp_timeout,
- $context);
- }
-
- if ($fp) {
- // socket connection succeeded
- return true;
- } else {
- // socket connection failed
- $this->status = $errno;
- switch ($errno) {
- case -3:
- $this->error = "socket creation failed (-3)";
- case -4:
- $this->error = "dns lookup failure (-4)";
- case -5:
- $this->error = "connection refused or timed out (-5)";
- default:
- $this->error = "connection failed (" . $errno . ")";
- }
- return false;
- }
- }
-
- /*======================================================================*\
- Function: _disconnect
- Purpose: disconnect a socket connection
- Input: $fp file pointer
- \*======================================================================*/
-
- function _disconnect($fp)
- {
- return (fclose($fp));
- }
-
-
- /*======================================================================*\
- Function: _prepare_post_body
- Purpose: Prepare post body according to encoding type
- Input: $formvars - form variables
- $formfiles - form upload files
- Output: post body
- \*======================================================================*/
-
- function _prepare_post_body($formvars, $formfiles)
- {
- settype($formvars, "array");
- settype($formfiles, "array");
- $postdata = '';
-
- if (count($formvars) == 0 && count($formfiles) == 0)
- return;
-
- switch ($this->_submit_type) {
- case "application/x-www-form-urlencoded":
- reset($formvars);
- foreach($formvars as $key => $val) {
- if (is_array($val) || is_object($val)) {
- foreach($val as $cur_key => $cur_val) {
- $postdata .= urlencode($key) . "[]=" . urlencode($cur_val) . "&";
- }
- } else
- $postdata .= urlencode($key) . "=" . urlencode($val) . "&";
- }
- break;
-
- case "multipart/form-data":
- $this->_mime_boundary = "Snoopy" . md5(uniqid(microtime()));
-
- reset($formvars);
- foreach ($formvars as $key => $val) {
- if (is_array($val) || is_object($val)) {
- foreach ($val as $cur_key => $cur_val) {
- $postdata .= "--" . $this->_mime_boundary . "\r\n";
- $postdata .= "Content-Disposition: form-data; name=\"$key\[\]\"\r\n\r\n";
- $postdata .= "$cur_val\r\n";
- }
- } else {
- $postdata .= "--" . $this->_mime_boundary . "\r\n";
- $postdata .= "Content-Disposition: form-data; name=\"$key\"\r\n\r\n";
- $postdata .= "$val\r\n";
- }
- }
-
- reset($formfiles);
- foreach ($formfiles as $field_name => $file_names) {
- $file_names = (array)$file_names;
- foreach($file_names as $file_name) {
- if (!is_readable($file_name)) continue;
-
- $fp = fopen($file_name, "r");
- $file_content = fread($fp, filesize($file_name));
- fclose($fp);
- $base_name = basename($file_name);
-
- $postdata .= "--" . $this->_mime_boundary . "\r\n";
- $postdata .= "Content-Disposition: form-data; name=\"$field_name\"; filename=\"$base_name\"\r\n\r\n";
- $postdata .= "$file_content\r\n";
- }
- }
- $postdata .= "--" . $this->_mime_boundary . "--\r\n";
- break;
- }
-
- return $postdata;
- }
-
- /*======================================================================*\
- Function: getResults
- Purpose: return the results of a request
- Output: string results
- \*======================================================================*/
-
- function getResults()
- {
- return $this->results;
- }
-}
diff --git a/manager/media/rss/rss_cache.inc b/manager/media/rss/rss_cache.inc
index e8d96c87ad..9e6824aeea 100755
--- a/manager/media/rss/rss_cache.inc
+++ b/manager/media/rss/rss_cache.inc
@@ -16,25 +16,31 @@
*
*/
-class RSSCache {
+if ( !defined('MAGPIE_DEBUG') ) {
+ define('MAGPIE_DEBUG', 0);
+}
+
+class RSSCache
+{
var $BASE_CACHE = './cache'; // where the cache files are stored
- var $MAX_AGE = 3600; // when are files stale, default one hour
- var $ERROR = ""; // accumulate error messages
+ var $MAX_AGE = 3600; // when are files stale, default one hour
+ var $ERROR = ""; // accumulate error messages
- function __construct($base='', $age='') {
- if ( $base ) {
+ public function __construct($base = '', $age = '')
+ {
+ if ($base) {
$this->BASE_CACHE = $base;
}
- if ( $age ) {
+ if ($age) {
$this->MAX_AGE = $age;
}
// attempt to make the cache directory
- if ( ! file_exists( $this->BASE_CACHE ) ) {
- $status = @mkdir( $this->BASE_CACHE, 0755 );
+ if (!file_exists($this->BASE_CACHE)) {
+ $status = @mkdir($this->BASE_CACHE, 0755);
// if make failed
- if ( ! $status ) {
+ if (!$status) {
$this->error(
"Cache couldn't make dir '" . $this->BASE_CACHE . "'."
);
@@ -42,18 +48,19 @@ class RSSCache {
}
}
-/*=======================================================================*\
- Function: set
- Purpose: add an item to the cache, keyed on url
- Input: url from wich the rss file was fetched
- Output: true on sucess
-\*=======================================================================*/
- function set ($url, $rss) {
+ /*=======================================================================*\
+ Function: set
+ Purpose: add an item to the cache, keyed on url
+ Input: url from wich the rss file was fetched
+ Output: true on sucess
+ \*=======================================================================*/
+ public function set($url, $rss)
+ {
$this->ERROR = "";
- $cache_file = $this->file_name( $url );
- $fp = @fopen( $cache_file, 'w' );
+ $cache_file = $this->file_name($url);
+ $fp = @fopen($cache_file, 'w');
- if ( ! $fp ) {
+ if (!$fp) {
$this->error(
"Cache unable to open file for writing: $cache_file"
);
@@ -61,24 +68,25 @@ class RSSCache {
}
- $data = $this->serialize( $rss );
- fwrite( $fp, $data );
- fclose( $fp );
+ $data = serialize($rss);
+ fwrite($fp, $data);
+ fclose($fp);
return $cache_file;
}
-/*=======================================================================*\
- Function: get
- Purpose: fetch an item from the cache
- Input: url from wich the rss file was fetched
- Output: cached object on HIT, false on MISS
-\*=======================================================================*/
- function get ($url) {
+ /*=======================================================================*\
+ Function: get
+ Purpose: fetch an item from the cache
+ Input: url from wich the rss file was fetched
+ Output: cached object on HIT, false on MISS
+ \*=======================================================================*/
+ public function get($url)
+ {
$this->ERROR = "";
- $cache_file = $this->file_name( $url );
+ $cache_file = $this->file_name($url);
- if ( ! file_exists( $cache_file ) ) {
+ if (!file_exists($cache_file)) {
$this->debug(
"Cache doesn't contain: $url (cache file: $cache_file)"
);
@@ -86,111 +94,98 @@ class RSSCache {
}
$fp = @fopen($cache_file, 'r');
- if ( ! $fp ) {
+ if (!$fp) {
$this->error(
"Failed to open cache file for reading: $cache_file"
);
return 0;
}
- if ($filesize = filesize($cache_file) ) {
- $data = fread( $fp, filesize($cache_file) );
- $rss = $this->unserialize( $data );
+ if ($filesize = filesize($cache_file)) {
+ $data = fread($fp, filesize($cache_file));
+ $rss = unserialize($data);
- return $rss;
- }
+ return $rss;
+ }
- return 0;
+ return 0;
}
-/*=======================================================================*\
- Function: check_cache
- Purpose: check a url for membership in the cache
- and whether the object is older then MAX_AGE (ie. STALE)
- Input: url from wich the rss file was fetched
- Output: cached object on HIT, false on MISS
-\*=======================================================================*/
- function check_cache ( $url ) {
+ /*=======================================================================*\
+ Function: check_cache
+ Purpose: check a url for membership in the cache
+ and whether the object is older then MAX_AGE (ie. STALE)
+ Input: url from wich the rss file was fetched
+ Output: cached object on HIT, false on MISS
+ \*=======================================================================*/
+ public function check_cache($url)
+ {
$this->ERROR = "";
- $filename = $this->file_name( $url );
+ $filename = $this->file_name($url);
- if ( file_exists( $filename ) ) {
+ if (file_exists($filename)) {
// find how long ago the file was added to the cache
// and whether that is longer then MAX_AGE
- $mtime = filemtime( $filename );
+ $mtime = filemtime($filename);
$age = time() - $mtime;
- if ( $this->MAX_AGE > $age ) {
+ if ($this->MAX_AGE > $age) {
// object exists and is current
return 'HIT';
- }
- else {
+ } else {
// object exists but is old
return 'STALE';
}
- }
- else {
+ } else {
// object does not exist
return 'MISS';
}
}
- function cache_age( $cache_key ) {
- $filename = $this->file_name( $url );
- if ( file_exists( $filename ) ) {
- $mtime = filemtime( $filename );
+ public function cache_age($cache_key)
+ {
+ $filename = $this->file_name($cache_key);
+ if (file_exists($filename)) {
+ $mtime = filemtime($filename);
$age = time() - $mtime;
- return $age;
- }
- else {
- return -1;
- }
- }
-
-/*=======================================================================*\
- Function: serialize
-\*=======================================================================*/
- function serialize ( $rss ) {
- return serialize( $rss );
- }
-
-/*=======================================================================*\
- Function: unserialize
-\*=======================================================================*/
- function unserialize ( $data ) {
- return unserialize( $data );
+ return $age;
+ } else {
+ return -1;
+ }
}
-/*=======================================================================*\
- Function: file_name
- Purpose: map url to location in cache
- Input: url from wich the rss file was fetched
- Output: a file name
-\*=======================================================================*/
- function file_name ($url) {
- $filename = md5( $url );
- return implode( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename ) );
+ /*=======================================================================*\
+ Function: file_name
+ Purpose: map url to location in cache
+ Input: url from wich the rss file was fetched
+ Output: a file name
+ \*=======================================================================*/
+ public function file_name($url)
+ {
+ $filename = md5($url);
+ return implode(DIRECTORY_SEPARATOR, [$this->BASE_CACHE, $filename]);
}
-/*=======================================================================*\
- Function: error
- Purpose: register error
-\*=======================================================================*/
- function error ($errormsg, $lvl=E_USER_WARNING) {
+ /*=======================================================================*\
+ Function: error
+ Purpose: register error
+ \*=======================================================================*/
+ public function error($errormsg, $lvl = E_USER_WARNING)
+ {
// append PHP's error message if track_errors enabled
- if ( isset($php_errormsg) ) {
+ if (isset($php_errormsg)) {
$errormsg .= " ($php_errormsg)";
}
$this->ERROR = $errormsg;
- if ( MAGPIE_DEBUG ) {
- trigger_error( $errormsg, $lvl);
- }
- else {
- error_log( $errormsg, 0);
+ if (MAGPIE_DEBUG) {
+ trigger_error($errormsg, $lvl);
+ } else {
+ error_log($errormsg, 0);
}
}
- function debug ($debugmsg, $lvl=E_USER_NOTICE) {
- if ( MAGPIE_DEBUG ) {
+ public function debug($debugmsg, $lvl = E_USER_NOTICE)
+ {
+ if (MAGPIE_DEBUG) {
$this->error("MagpieRSS [debug] $debugmsg", $lvl);
}
}
diff --git a/manager/media/rss/rss_fetch.inc b/manager/media/rss/rss_fetch.inc
deleted file mode 100755
index 8593d8f806..0000000000
--- a/manager/media/rss/rss_fetch.inc
+++ /dev/null
@@ -1,462 +0,0 @@
-
- * License: GPL
- *
- * The lastest version of MagpieRSS can be obtained from:
- * http://magpierss.sourceforge.net
- *
- * For questions, help, comments, discussion, etc., please join the
- * Magpie mailing list:
- * magpierss-general@lists.sourceforge.net
- *
- */
-
-// Setup MAGPIE_DIR for use on hosts that don't include
-// the current path in include_path.
-// with thanks to rajiv and smarty
-if (!defined('DIR_SEP')) {
- define('DIR_SEP', DIRECTORY_SEPARATOR);
-}
-
-if (!defined('MAGPIE_DIR')) {
- define('MAGPIE_DIR', dirname(__FILE__) . DIR_SEP);
-}
-
-if (!defined('MAGPIE_CACHE_DIR')) {
- define('MAGPIE_CACHE_DIR', MODX_BASE_PATH . 'assets/cache/rss');
-}
-
-require_once( MAGPIE_DIR . 'rss_parse.inc' );
-require_once( MAGPIE_DIR . 'rss_cache.inc' );
-
-// for including 3rd party libraries
-define('MAGPIE_EXTLIB', MAGPIE_DIR . 'extlib' . DIR_SEP);
-require_once( MAGPIE_EXTLIB . 'Snoopy.class.inc');
-
-
-/*
- * CONSTANTS - redefine these in your script to change the
- * behaviour of fetch_rss() currently, most options effect the cache
- *
- * MAGPIE_CACHE_ON - Should Magpie cache parsed RSS objects?
- * For me a built in cache was essential to creating a "PHP-like"
- * feel to Magpie, see rss_cache.inc for rationale
- *
- *
- * MAGPIE_CACHE_DIR - Where should Magpie cache parsed RSS objects?
- * This should be a location that the webserver can write to. If this
- * directory does not already exist Mapie will try to be smart and create
- * it. This will often fail for permissions reasons.
- *
- *
- * MAGPIE_CACHE_AGE - How long to store cached RSS objects? In seconds.
- *
- *
- * MAGPIE_CACHE_FRESH_ONLY - If remote fetch fails, throw error
- * instead of returning stale object?
- *
- * MAGPIE_DEBUG - Display debugging notices?
- *
-*/
-
-
-/*=======================================================================*\
- Function: fetch_rss:
- Purpose: return RSS object for the give url
- maintain the cache
- Input: url of RSS file
- Output: parsed RSS object (see rss_parse.inc)
-
- NOTES ON CACHEING:
- If caching is on (MAGPIE_CACHE_ON) fetch_rss will first check the cache.
-
- NOTES ON RETRIEVING REMOTE FILES:
- If conditional gets are on (MAGPIE_CONDITIONAL_GET_ON) fetch_rss will
- return a cached object, and touch the cache object upon recieving a
- 304.
-
- NOTES ON FAILED REQUESTS:
- If there is an HTTP error while fetching an RSS object, the cached
- version will be return, if it exists (and if MAGPIE_CACHE_FRESH_ONLY is off)
-\*=======================================================================*/
-
-define('MAGPIE_VERSION', '0.72');
-
-$MAGPIE_ERROR = "";
-
-function fetch_rss ($url) {
- // initialize constants
- init();
-
- if ( !isset($url) ) {
- error("fetch_rss called without a url");
- return false;
- }
-
- // if cache is disabled
- if ( !MAGPIE_CACHE_ON ) {
- // fetch file, and parse it
- $resp = _fetch_remote_file( $url );
- if ( is_success( $resp->status ) ) {
- return _response_to_rss( $resp );
- }
- else {
- error("Failed to fetch $url and cache is off");
- return false;
- }
- }
- // else cache is ON
- else {
- // Flow
- // 1. check cache
- // 2. if there is a hit, make sure its fresh
- // 3. if cached obj fails freshness check, fetch remote
- // 4. if remote fails, return stale object, or error
-
- $cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE );
-
- if (MAGPIE_DEBUG and $cache->ERROR) {
- debug($cache->ERROR, E_USER_WARNING);
- }
-
-
- $cache_status = 0; // response of check_cache
- $request_headers = array(); // HTTP headers to send with fetch
- $rss = 0; // parsed RSS object
- $errormsg = 0; // errors, if any
-
- // store parsed XML by desired output encoding
- // as character munging happens at parse time
- $cache_key = $url . MAGPIE_OUTPUT_ENCODING;
-
- if (!$cache->ERROR) {
- // return cache HIT, MISS, or STALE
- $cache_status = $cache->check_cache( $cache_key);
- }
-
- // if object cached, and cache is fresh, return cached obj
- if ( $cache_status == 'HIT' ) {
- $rss = $cache->get( $cache_key );
- if ( isset($rss) and $rss ) {
- // should be cache age
- $rss->from_cache = 1;
- if ( MAGPIE_DEBUG > 1) {
- debug("MagpieRSS: Cache HIT", E_USER_NOTICE);
- }
- return $rss;
- }
- }
-
- // else attempt a conditional get
-
- // setup headers
- if ( $cache_status == 'STALE' ) {
- $rss = $cache->get( $cache_key );
- if ( $rss and $rss->etag and $rss->last_modified ) {
- $request_headers['If-None-Match'] = $rss->etag;
- $request_headers['If-Last-Modified'] = $rss->last_modified;
- }
- }
-
- $resp = _fetch_remote_file( $url, $request_headers );
-
- if (isset($resp) and $resp) {
- if ($resp->status == '304' ) {
- // we have the most current copy
- if ( MAGPIE_DEBUG > 1) {
- debug("Got 304 for $url");
- }
- // reset cache on 304 (at minutillo insistent prodding)
- $cache->set($cache_key, $rss);
- return $rss;
- }
- elseif ( is_success( $resp->status ) ) {
- $rss = _response_to_rss( $resp );
- if ( $rss ) {
- if (MAGPIE_DEBUG > 1) {
- debug("Fetch successful");
- }
- // add object to cache
- $cache->set( $cache_key, $rss );
- return $rss;
- }
- }
- else {
- $errormsg = "Failed to fetch $url ";
- if ( $resp->status == '-100' ) {
- $errormsg .= "(Request timed out after " . MAGPIE_FETCH_TIME_OUT . " seconds)";
- }
- elseif ( $resp->error ) {
- # compensate for Snoopy's annoying habbit to tacking
- # on '\n'
- $http_error = substr($resp->error, 0, -2);
- $errormsg .= "(HTTP Error: $http_error)";
- }
- else {
- $errormsg .= "(HTTP Response: " . $resp->response_code .')';
- }
- }
- }
- else {
- $errormsg = "Unable to retrieve RSS file for unknown reasons.";
- }
-
- // else fetch failed
-
- // attempt to return cached object
- if ($rss) {
- if ( MAGPIE_DEBUG ) {
- debug("Returning STALE object for $url");
- }
- return $rss;
- }
-
- // else we totally failed
- error( $errormsg );
-
- return false;
-
- } // end if ( !MAGPIE_CACHE_ON ) {
-} // end fetch_rss()
-
-/*=======================================================================*\
- Function: error
- Purpose: set MAGPIE_ERROR, and trigger error
-\*=======================================================================*/
-
-function error ($errormsg, $lvl=E_USER_WARNING) {
- global $MAGPIE_ERROR;
-
- // append PHP's error message if track_errors enabled
- if ( isset($php_errormsg) ) {
- $errormsg .= " ($php_errormsg)";
- }
- if ( $errormsg ) {
- $errormsg = "MagpieRSS: $errormsg";
- $MAGPIE_ERROR = $errormsg;
- error_log( $errormsg, $lvl);
- }
-}
-
-function debug ($debugmsg, $lvl=E_USER_NOTICE) {
- trigger_error("MagpieRSS [debug] $debugmsg", $lvl);
-}
-
-/*=======================================================================*\
- Function: magpie_error
- Purpose: accessor for the magpie error variable
-\*=======================================================================*/
-function magpie_error ($errormsg="") {
- global $MAGPIE_ERROR;
-
- if ( isset($errormsg) and $errormsg ) {
- $MAGPIE_ERROR = $errormsg;
- }
-
- return $MAGPIE_ERROR;
-}
-
-/*=======================================================================*\
- Function: _fetch_remote_file
- Purpose: retrieve an arbitrary remote file
- Input: url of the remote file
- headers to send along with the request (optional)
- Output: an HTTP response object (see Snoopy.class.inc)
-\*=======================================================================*/
-function _fetch_remote_file ($url, $headers = "" ) {
- // Snoopy is an HTTP client in PHP
- $client = new Snoopy();
- $client->agent = MAGPIE_USER_AGENT;
- $client->read_timeout = MAGPIE_FETCH_TIME_OUT;
- $client->use_gzip = MAGPIE_USE_GZIP;
- if (is_array($headers) ) {
- $client->rawheaders = $headers;
- }
-
- @$client->fetch($url);
- return $client;
-
-}
-
-/*=======================================================================*\
- Function: _response_to_rss
- Purpose: parse an HTTP response object into an RSS object
- Input: an HTTP response object (see Snoopy)
- Output: parsed RSS object (see rss_parse)
-\*=======================================================================*/
-function _response_to_rss ($resp) {
- $rss = new MagpieRSS( $resp->results, MAGPIE_OUTPUT_ENCODING, MAGPIE_INPUT_ENCODING, MAGPIE_DETECT_ENCODING );
-
- // if RSS parsed successfully
- if ( $rss and !$rss->ERROR) {
-
- // find Etag, and Last-Modified
- foreach($resp->headers as $h) {
- // 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug "Undefined offset: 1"
- if (strpos($h, ": ")) {
- list($field, $val) = explode(": ", $h, 2);
- }
- else {
- $field = $h;
- $val = "";
- }
-
- if ( $field == 'ETag' ) {
- $rss->etag = $val;
- }
-
- if ( $field == 'Last-Modified' ) {
- $rss->last_modified = $val;
- }
- }
-
- return $rss;
- } // else construct error message
- else {
- $errormsg = "Failed to parse RSS file.";
-
- if ($rss) {
- $errormsg .= " (" . $rss->ERROR . ")";
- }
- error($errormsg);
-
- return false;
- } // end if ($rss and !$rss->error)
-}
-
-/*=======================================================================*\
- Function: init
- Purpose: setup constants with default values
- check for user overrides
-\*=======================================================================*/
-function init () {
- if ( defined('MAGPIE_INITALIZED') ) {
- return;
- }
- else {
- define('MAGPIE_INITALIZED', true);
- }
-
- if ( !defined('MAGPIE_CACHE_ON') ) {
- define('MAGPIE_CACHE_ON', true);
- }
-
- if ( !defined('MAGPIE_CACHE_DIR') ) {
- define('MAGPIE_CACHE_DIR', './cache');
- }
-
- if ( !defined('MAGPIE_CACHE_AGE') ) {
- define('MAGPIE_CACHE_AGE', 60*60); // one hour
- }
-
- if ( !defined('MAGPIE_CACHE_FRESH_ONLY') ) {
- define('MAGPIE_CACHE_FRESH_ONLY', false);
- }
-
- if ( !defined('MAGPIE_OUTPUT_ENCODING') ) {
- global $modx_manager_charset;
- if(empty($modx_manager_charset)) $modx_manager_charset = 'ISO-8859-1';
- define('MAGPIE_OUTPUT_ENCODING', $modx_manager_charset);
- }
-
- if ( !defined('MAGPIE_INPUT_ENCODING') ) {
- define('MAGPIE_INPUT_ENCODING', null);
- }
-
- if ( !defined('MAGPIE_DETECT_ENCODING') ) {
- define('MAGPIE_DETECT_ENCODING', true);
- }
-
- if ( !defined('MAGPIE_DEBUG') ) {
- define('MAGPIE_DEBUG', 0);
- }
-
- if ( !defined('MAGPIE_USER_AGENT') ) {
- $ua = 'MagpieRSS/'. MAGPIE_VERSION . ' (+http://magpierss.sf.net';
-
- if ( MAGPIE_CACHE_ON ) {
- $ua = $ua . ')';
- }
- else {
- $ua = $ua . '; No cache)';
- }
-
- define('MAGPIE_USER_AGENT', $ua);
- }
-
- if ( !defined('MAGPIE_FETCH_TIME_OUT') ) {
- define('MAGPIE_FETCH_TIME_OUT', 5); // 5 second timeout
- }
-
- // use gzip encoding to fetch rss files if supported?
- if ( !defined('MAGPIE_USE_GZIP') ) {
- define('MAGPIE_USE_GZIP', true);
- }
-}
-
-// NOTE: the following code should really be in Snoopy, or at least
-// somewhere other then rss_fetch!
-
-/*=======================================================================*\
- HTTP STATUS CODE PREDICATES
- These functions attempt to classify an HTTP status code
- based on RFC 2616 and RFC 2518.
-
- All of them take an HTTP status code as input, and return true or false
-
- All this code is adapted from LWP's HTTP::Status.
-\*=======================================================================*/
-
-
-/*=======================================================================*\
- Function: is_info
- Purpose: return true if Informational status code
-\*=======================================================================*/
-function is_info ($sc) {
- return $sc >= 100 && $sc < 200;
-}
-
-/*=======================================================================*\
- Function: is_success
- Purpose: return true if Successful status code
-\*=======================================================================*/
-function is_success ($sc) {
- return $sc >= 200 && $sc < 300;
-}
-
-/*=======================================================================*\
- Function: is_redirect
- Purpose: return true if Redirection status code
-\*=======================================================================*/
-function is_redirect ($sc) {
- return $sc >= 300 && $sc < 400;
-}
-
-/*=======================================================================*\
- Function: is_error
- Purpose: return true if Error status code
-\*=======================================================================*/
-function is_error ($sc) {
- return $sc >= 400 && $sc < 600;
-}
-
-/*=======================================================================*\
- Function: is_client_error
- Purpose: return true if Error status code, and its a client error
-\*=======================================================================*/
-function is_client_error ($sc) {
- return $sc >= 400 && $sc < 500;
-}
-
-/*=======================================================================*\
- Function: is_client_error
- Purpose: return true if Error status code, and its a server error
-\*=======================================================================*/
-function is_server_error ($sc) {
- return $sc >= 500 && $sc < 600;
-}
diff --git a/manager/media/rss/rss_parse.inc b/manager/media/rss/rss_parse.inc
deleted file mode 100755
index cecb504707..0000000000
--- a/manager/media/rss/rss_parse.inc
+++ /dev/null
@@ -1,616 +0,0 @@
-
-* @version 0.7a
-* @license GPL
-*
-*/
-
-define('RSS', 'RSS');
-define('ATOM', 'Atom');
-
-require_once (MAGPIE_DIR . 'rss_utils.inc');
-
-/**
-* Hybrid parser, and object, takes RSS as a string and returns a simple object.
-*
-* see: rss_fetch.inc for a simpler interface with integrated caching support
-*
-*/
-class MagpieRSS {
- var $parser;
-
- var $current_item = array(); // item currently being parsed
- var $items = array(); // collection of parsed items
- var $channel = array(); // hash of channel fields
- var $textinput = array();
- var $image = array();
- var $feed_type;
- var $feed_version;
- var $encoding = ''; // output encoding of parsed rss
-
- var $_source_encoding = ''; // only set if we have to parse xml prolog
-
- var $ERROR = "";
- var $WARNING = "";
-
- // define some constants
-
- var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright');
- var $_KNOWN_ENCODINGS = array('UTF-8', 'US-ASCII', 'ISO-8859-1');
-
- // parser variables, useless if you're not a parser, treat as private
- var $stack = array(); // parser stack
- var $inchannel = false;
- var $initem = false;
- var $incontent = false; // if in Atom field
- var $intextinput = false;
- var $inimage = false;
- var $current_namespace = false;
-
-
- /**
- * Set up XML parser, parse source, and return populated RSS object..
- *
- * @param string $source string containing the RSS to be parsed
- *
- * NOTE: Probably a good idea to leave the encoding options alone unless
- * you know what you're doing as PHP's character set support is
- * a little weird.
- *
- * NOTE: A lot of this is unnecessary but harmless with PHP5
- *
- *
- * @param string $output_encoding output the parsed RSS in this character
- * set defaults to ISO-8859-1 as this is PHP's
- * default.
- *
- * NOTE: might be changed to UTF-8 in future
- * versions.
- *
- * @param string $input_encoding the character set of the incoming RSS source.
- * Leave blank and Magpie will try to figure it
- * out.
- *
- *
- * @param bool $detect_encoding if false Magpie won't attempt to detect
- * source encoding. (caveat emptor)
- *
- */
- function __construct($source, $output_encoding='ISO-8859-1',
- $input_encoding=null, $detect_encoding=true)
- {
- # if PHP xml isn't compiled in, die
- #
- if (!function_exists('xml_parser_create')) {
- $this->error( "Failed to load PHP's XML Extension. " .
- "http://www.php.net/manual/en/ref.xml.php",
- E_USER_ERROR );
-
- return false;
- }
-
- list($parser, $source) = $this->create_parser($source,
- $output_encoding, $input_encoding, $detect_encoding);
-
-
- if (!is_resource($parser)) {
- $this->error( "Failed to create an instance of PHP's XML parser. " .
- "http://www.php.net/manual/en/ref.xml.php",
- E_USER_ERROR );
-
- return false;
- }
-
-
- $this->parser = $parser;
-
- # pass in parser, and a reference to this object
- # setup handlers
- #
- xml_set_object( $this->parser, $this );
- xml_set_element_handler($this->parser,
- 'feed_start_element', 'feed_end_element' );
-
- xml_set_character_data_handler( $this->parser, 'feed_cdata' );
-
- $status = xml_parse( $this->parser, $source );
-
- if (! $status ) {
- $errorcode = xml_get_error_code( $this->parser );
- if ( $errorcode != XML_ERROR_NONE ) {
- $xml_error = xml_error_string( $errorcode );
- $error_line = xml_get_current_line_number($this->parser);
- $error_col = xml_get_current_column_number($this->parser);
- $errormsg = "$xml_error at line $error_line, column $error_col";
-
- $this->error( $errormsg );
- }
- }
-
- xml_parser_free( $this->parser );
-
- $this->normalize();
- }
-
- function feed_start_element($p, $element, &$attrs) {
- $el = $element = strtolower($element);
- $attrs = array_change_key_case($attrs, CASE_LOWER);
-
- // check for a namespace, and split if found
- $ns = false;
- if ( strpos( $element, ':' ) ) {
- list($ns, $el) = explode( ':', $element, 2);
- }
- if ( $ns and $ns != 'rdf' ) {
- $this->current_namespace = $ns;
- }
-
- # if feed type isn't set, then this is first element of feed
- # identify feed from root element
- #
- if (!isset($this->feed_type) ) {
- if ( $el == 'rdf' ) {
- $this->feed_type = RSS;
- $this->feed_version = '1.0';
- }
- elseif ( $el == 'rss' ) {
- $this->feed_type = RSS;
- $this->feed_version = $attrs['version'];
- }
- elseif ( $el == 'feed' ) {
- $this->feed_type = ATOM;
- $this->feed_version = $attrs['version'];
- $this->inchannel = true;
- }
- return;
- }
-
- if ( $el == 'channel' )
- {
- $this->inchannel = true;
- }
- elseif ($el == 'item' or $el == 'entry' )
- {
- $this->initem = true;
- if ( isset($attrs['rdf:about']) ) {
- $this->current_item['about'] = $attrs['rdf:about'];
- }
- }
-
- // if we're in the default namespace of an RSS feed,
- // record textinput or image fields
- elseif (
- $this->feed_type == RSS and
- $this->current_namespace == '' and
- $el == 'textinput' )
- {
- $this->intextinput = true;
- }
-
- elseif (
- $this->feed_type == RSS and
- $this->current_namespace == '' and
- $el == 'image' )
- {
- $this->inimage = true;
- }
-
- # handle atom content constructs
- elseif ( $this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
- {
- // avoid clashing w/ RSS mod_content
- if ($el == 'content' ) {
- $el = 'atom_content';
- }
-
- $this->incontent = $el;
-
-
- }
-
- // if inside an Atom content construct (e.g. content or summary) field treat tags as text
- elseif ($this->feed_type == ATOM and $this->incontent )
- {
- // if tags are inlined, then flatten
- $attrs_str = implode(' ',
- array_map('map_attrs',
- array_keys($attrs),
- array_values($attrs) ) );
-
- $this->append_content( "<$element $attrs_str>" );
-
- array_unshift( $this->stack, $el );
- }
-
- // Atom support many links per containging element.
- // Magpie treats link elements of type rel='alternate'
- // as being equivalent to RSS's simple link element.
- //
- elseif ($this->feed_type == ATOM and $el == 'link' )
- {
- if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' )
- {
- $link_el = 'link';
- }
- else {
- $link_el = 'link_' . $attrs['rel'];
- }
-
- $this->append($link_el, $attrs['href']);
- }
- // set stack[0] to current element
- else {
- array_unshift($this->stack, $el);
- }
- }
-
-
-
- function feed_cdata ($p, $text) {
- if ($this->feed_type == ATOM and $this->incontent)
- {
- $this->append_content( $text );
- }
- else {
- $current_el = implode('_', array_reverse($this->stack));
- $this->append($current_el, $text);
- }
- }
-
- function feed_end_element ($p, $el) {
- $el = strtolower($el);
-
- if ( $el == 'item' or $el == 'entry' )
- {
- $this->items[] = $this->current_item;
- $this->current_item = array();
- $this->initem = false;
- }
- elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' )
- {
- $this->intextinput = false;
- }
- elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' )
- {
- $this->inimage = false;
- }
- elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
- {
- $this->incontent = false;
- }
- elseif ($el == 'channel' or $el == 'feed' )
- {
- $this->inchannel = false;
- }
- elseif ($this->feed_type == ATOM and $this->incontent ) {
- // balance tags properly
- // note: i don't think this is actually neccessary
- if ( $this->stack[0] == $el )
- {
- $this->append_content("$el>");
- }
- else {
- $this->append_content("<$el />");
- }
-
- array_shift( $this->stack );
- }
- else {
- array_shift( $this->stack );
- }
-
- $this->current_namespace = false;
- }
-
- function concat (&$str1, $str2="") {
- if (!isset($str1) ) {
- $str1="";
- }
- $str1 .= $str2;
- }
-
-
-
- function append_content($text) {
- if ( $this->initem ) {
- $this->concat( $this->current_item[ $this->incontent ], $text );
- }
- elseif ( $this->inchannel ) {
- $this->concat( $this->channel[ $this->incontent ], $text );
- }
- }
-
- // smart append - field and namespace aware
- function append($el, $text) {
- if (!$el) {
- return;
- }
- if ( $this->current_namespace )
- {
- if ( $this->initem ) {
- $this->concat(
- $this->current_item[ $this->current_namespace ][ $el ], $text);
- }
- elseif ($this->inchannel) {
- $this->concat(
- $this->channel[ $this->current_namespace][ $el ], $text );
- }
- elseif ($this->intextinput) {
- $this->concat(
- $this->textinput[ $this->current_namespace][ $el ], $text );
- }
- elseif ($this->inimage) {
- $this->concat(
- $this->image[ $this->current_namespace ][ $el ], $text );
- }
- }
- else {
- if ( $this->initem ) {
- $this->concat(
- $this->current_item[ $el ], $text);
- }
- elseif ($this->intextinput) {
- $this->concat(
- $this->textinput[ $el ], $text );
- }
- elseif ($this->inimage) {
- $this->concat(
- $this->image[ $el ], $text );
- }
- elseif ($this->inchannel) {
- $this->concat(
- $this->channel[ $el ], $text );
- }
-
- }
- }
-
- function normalize () {
- // if atom populate rss fields
- if ( $this->is_atom() ) {
- $this->channel['description'] = $this->channel['tagline'];
- for ( $i = 0; $i < count($this->items); $i++) {
- $item = $this->items[$i];
- if ( isset($item['summary']) )
- $item['description'] = $item['summary'];
- if ( isset($item['atom_content']))
- $item['content']['encoded'] = $item['atom_content'];
-
- $atom_date = (isset($item['issued']) ) ? $item['issued'] : $item['modified'];
- if ( $atom_date ) {
- $epoch = @parse_w3cdtf($atom_date);
- if ($epoch and $epoch > 0) {
- $item['date_timestamp'] = $epoch;
- }
- }
-
- $this->items[$i] = $item;
- }
- }
- elseif ( $this->is_rss() ) {
- $this->channel['tagline'] = $this->channel['description'];
- for ( $i = 0; $i < count($this->items); $i++) {
- $item = $this->items[$i];
- if ( isset($item['description']))
- $item['summary'] = $item['description'];
- if ( isset($item['content']['encoded'] ) )
- $item['atom_content'] = $item['content']['encoded'];
-
- if ( $this->is_rss() == '1.0' and isset($item['dc']['date']) ) {
- $epoch = @parse_w3cdtf($item['dc']['date']);
- if ($epoch and $epoch > 0) {
- $item['date_timestamp'] = $epoch;
- }
- }
- elseif ( isset($item['pubdate']) ) {
- $epoch = @strtotime($item['pubdate']);
- if ($epoch > 0) {
- $item['date_timestamp'] = $epoch;
- }
- }
-
- $this->items[$i] = $item;
- }
- }
- }
-
-
- function is_rss () {
- if ( $this->feed_type == RSS ) {
- return $this->feed_version;
- }
- else {
- return false;
- }
- }
-
- function is_atom() {
- if ( $this->feed_type == ATOM ) {
- return $this->feed_version;
- }
- else {
- return false;
- }
- }
-
- /**
- * return XML parser, and possibly re-encoded source
- *
- */
- function create_parser($source, $out_enc, $in_enc, $detect) {
- if ( substr(phpversion(),0,1) == 5) {
- $parser = $this->php5_create_parser($in_enc, $detect);
- }
- else {
- list($parser, $source) = $this->php4_create_parser($source, $in_enc, $detect);
- }
- if ($out_enc) {
- $this->encoding = $out_enc;
- xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $out_enc);
- }
-
- return array($parser, $source);
- }
-
- /**
- * Instantiate an XML parser under PHP5
- *
- * PHP5 will do a fine job of detecting input encoding
- * if passed an empty string as the encoding.
- *
- * All hail libxml2!
- *
- */
- function php5_create_parser($in_enc, $detect) {
- // by default php5 does a fine job of detecting input encodings
- if(!$detect && $in_enc) {
- return xml_parser_create($in_enc);
- }
- else {
- return xml_parser_create('');
- }
- }
-
- /**
- * Instaniate an XML parser under PHP4
- *
- * Unfortunately PHP4's support for character encodings
- * and especially XML and character encodings sucks. As
- * long as the documents you parse only contain characters
- * from the ISO-8859-1 character set (a superset of ASCII,
- * and a subset of UTF-8) you're fine. However once you
- * step out of that comfy little world things get mad, bad,
- * and dangerous to know.
- *
- * The following code is based on SJM's work with FoF
- * @see http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss
- *
- */
- function php4_create_parser($source, $in_enc, $detect) {
- if ( !$detect ) {
- return array(xml_parser_create($in_enc), $source);
- }
-
- if (!$in_enc) {
- if (preg_match('//m', $source, $m)) {
- $in_enc = strtoupper($m[1]);
- $this->source_encoding = $in_enc;
- }
- else {
- $in_enc = 'UTF-8';
- }
- }
-
- if ($this->known_encoding($in_enc)) {
- return array(xml_parser_create($in_enc), $source);
- }
-
- // the dectected encoding is not one of the simple encodings PHP knows
-
- // attempt to use the iconv extension to
- // cast the XML to a known encoding
- // @see http://php.net/iconv
-
- if (function_exists('iconv')) {
- $encoded_source = iconv($in_enc,'UTF-8', $source);
- if ($encoded_source) {
- return array(xml_parser_create('UTF-8'), $encoded_source);
- }
- }
-
- // iconv didn't work, try mb_convert_encoding
- // @see http://php.net/mbstring
- if(function_exists('mb_convert_encoding')) {
- $encoded_source = mb_convert_encoding($source, 'UTF-8', $in_enc );
- if ($encoded_source) {
- return array(xml_parser_create('UTF-8'), $encoded_source);
- }
- }
-
- // else
- $this->error("Feed is in an unsupported character encoding. ($in_enc) " .
- "You may see strange artifacts, and mangled characters.",
- E_USER_NOTICE);
-
- return array(xml_parser_create(), $source);
- }
-
- function known_encoding($enc) {
- $enc = strtoupper($enc);
- if ( in_array($enc, $this->_KNOWN_ENCODINGS) ) {
- return $enc;
- }
- else {
- return false;
- }
- }
-
- function error ($errormsg, $lvl=E_USER_WARNING) {
- // append PHP's error message if track_errors enabled
- if ( isset($php_errormsg) ) {
- $errormsg .= " ($php_errormsg)";
- }
- if ( MAGPIE_DEBUG ) {
- trigger_error( $errormsg, $lvl);
- }
- else {
- error_log( $errormsg, 0);
- }
-
- $notices = E_USER_NOTICE|E_NOTICE;
- if ( $lvl&$notices ) {
- $this->WARNING = $errormsg;
- } else {
- $this->ERROR = $errormsg;
- }
- }
-
-
-} // end class RSS
-
-function map_attrs($k, $v) {
- return "$k=\"$v\"";
-}
-
-// patch to support medieval versions of PHP4.1.x,
-// courtesy, Ryan Currie, ryan@digibliss.com
-
-if (!function_exists('array_change_key_case')) {
- define('CASE_UPPER', 1);
- define('CASE_LOWER', 0);
-
-
- function array_change_key_case($array, $case=CASE_LOWER) {
- $output = array();
- switch($case){
- case CASE_LOWER:
- $cmd='strtolower';
- break;
- case CASE_UPPER:
- $cmd='strtoupper';
- break;
- default:
- $cmd = '';
- }
- foreach($array as $key=>$value) {
- $output[empty($cmd) ? $key : $cmd($key)] = $value;
- }
- return $output;
- }
-
-}
diff --git a/manager/media/rss/rss_utils.inc b/manager/media/rss/rss_utils.inc
deleted file mode 100755
index 9dc9702cb5..0000000000
--- a/manager/media/rss/rss_utils.inc
+++ /dev/null
@@ -1,65 +0,0 @@
-
- * Version: 0.51
- * License: GPL
- *
- * The lastest version of MagpieRSS can be obtained from:
- * http://magpierss.sourceforge.net
- *
- * For questions, help, comments, discussion, etc., please join the
- * Magpie mailing list:
- * magpierss-general@lists.sourceforge.net
- */
-
-
-/*======================================================================*\
- Function: parse_w3cdtf
- Purpose: parse a W3CDTF date into unix epoch
-
- NOTE: http://www.w3.org/TR/NOTE-datetime
-\*======================================================================*/
-
-function parse_w3cdtf ( $date_str ) {
-
- # regex to match wc3dtf
- $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/";
-
- if ( preg_match( $pat, $date_str, $match ) ) {
- list( $year, $month, $day, $hours, $minutes, $seconds) =
- array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[6]);
-
- # calc epoch for current date assuming GMT
- $epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year);
-
- $offset = 0;
- if ( $match[10] == 'Z' ) {
- # zulu time, aka GMT
- }
- else {
- list( $tz_mod, $tz_hour, $tz_min ) =
- array( $match[8], $match[9], $match[10]);
-
- # zero out the variables
- if ( ! $tz_hour ) { $tz_hour = 0; }
- if ( ! $tz_min ) { $tz_min = 0; }
-
- $offset_secs = (($tz_hour*60)+$tz_min)*60;
-
- # is timezone ahead of GMT? then subtract offset
- #
- if ( $tz_mod == '+' ) {
- $offset_secs = $offset_secs * -1;
- }
-
- $offset = $offset_secs;
- }
- $epoch = $epoch + $offset;
- return $epoch;
- }
- else {
- return -1;
- }
-}
diff --git a/manager/media/rss/vendor/autoload.php b/manager/media/rss/vendor/autoload.php
new file mode 100644
index 0000000000..d784a94293
--- /dev/null
+++ b/manager/media/rss/vendor/autoload.php
@@ -0,0 +1,12 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
+ *
+ * $loader = new \Composer\Autoload\ClassLoader();
+ *
+ * // register classes with namespaces
+ * $loader->add('Symfony\Component', __DIR__.'/component');
+ * $loader->add('Symfony', __DIR__.'/framework');
+ *
+ * // activate the autoloader
+ * $loader->register();
+ *
+ * // to enable searching the include path (eg. for PEAR packages)
+ * $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier
+ * @author Jordi Boggiano
+ * @see https://www.php-fig.org/psr/psr-0/
+ * @see https://www.php-fig.org/psr/psr-4/
+ */
+class ClassLoader
+{
+ /** @var ?string */
+ private $vendorDir;
+
+ // PSR-4
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
+ private $prefixLengthsPsr4 = array();
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
+ private $prefixDirsPsr4 = array();
+ /**
+ * @var array[]
+ * @psalm-var array
+ */
+ private $fallbackDirsPsr4 = array();
+
+ // PSR-0
+ /**
+ * @var array[]
+ * @psalm-var array>
+ */
+ private $prefixesPsr0 = array();
+ /**
+ * @var array[]
+ * @psalm-var array
+ */
+ private $fallbackDirsPsr0 = array();
+
+ /** @var bool */
+ private $useIncludePath = false;
+
+ /**
+ * @var string[]
+ * @psalm-var array
+ */
+ private $classMap = array();
+
+ /** @var bool */
+ private $classMapAuthoritative = false;
+
+ /**
+ * @var bool[]
+ * @psalm-var array
+ */
+ private $missingClasses = array();
+
+ /** @var ?string */
+ private $apcuPrefix;
+
+ /**
+ * @var self[]
+ */
+ private static $registeredLoaders = array();
+
+ /**
+ * @param ?string $vendorDir
+ */
+ public function __construct($vendorDir = null)
+ {
+ $this->vendorDir = $vendorDir;
+ }
+
+ /**
+ * @return string[]
+ */
+ public function getPrefixes()
+ {
+ if (!empty($this->prefixesPsr0)) {
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
+ }
+
+ return array();
+ }
+
+ /**
+ * @return array[]
+ * @psalm-return array>
+ */
+ public function getPrefixesPsr4()
+ {
+ return $this->prefixDirsPsr4;
+ }
+
+ /**
+ * @return array[]
+ * @psalm-return array
+ */
+ public function getFallbackDirs()
+ {
+ return $this->fallbackDirsPsr0;
+ }
+
+ /**
+ * @return array[]
+ * @psalm-return array
+ */
+ public function getFallbackDirsPsr4()
+ {
+ return $this->fallbackDirsPsr4;
+ }
+
+ /**
+ * @return string[] Array of classname => path
+ * @psalm-return array
+ */
+ public function getClassMap()
+ {
+ return $this->classMap;
+ }
+
+ /**
+ * @param string[] $classMap Class to filename map
+ * @psalm-param array $classMap
+ *
+ * @return void
+ */
+ public function addClassMap(array $classMap)
+ {
+ if ($this->classMap) {
+ $this->classMap = array_merge($this->classMap, $classMap);
+ } else {
+ $this->classMap = $classMap;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix, either
+ * appending or prepending to the ones previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param string[]|string $paths The PSR-0 root directories
+ * @param bool $prepend Whether to prepend the directories
+ *
+ * @return void
+ */
+ public function add($prefix, $paths, $prepend = false)
+ {
+ if (!$prefix) {
+ if ($prepend) {
+ $this->fallbackDirsPsr0 = array_merge(
+ (array) $paths,
+ $this->fallbackDirsPsr0
+ );
+ } else {
+ $this->fallbackDirsPsr0 = array_merge(
+ $this->fallbackDirsPsr0,
+ (array) $paths
+ );
+ }
+
+ return;
+ }
+
+ $first = $prefix[0];
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
+
+ return;
+ }
+ if ($prepend) {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ (array) $paths,
+ $this->prefixesPsr0[$first][$prefix]
+ );
+ } else {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ $this->prefixesPsr0[$first][$prefix],
+ (array) $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace, either
+ * appending or prepending to the ones previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param string[]|string $paths The PSR-4 base directories
+ * @param bool $prepend Whether to prepend the directories
+ *
+ * @throws \InvalidArgumentException
+ *
+ * @return void
+ */
+ public function addPsr4($prefix, $paths, $prepend = false)
+ {
+ if (!$prefix) {
+ // Register directories for the root namespace.
+ if ($prepend) {
+ $this->fallbackDirsPsr4 = array_merge(
+ (array) $paths,
+ $this->fallbackDirsPsr4
+ );
+ } else {
+ $this->fallbackDirsPsr4 = array_merge(
+ $this->fallbackDirsPsr4,
+ (array) $paths
+ );
+ }
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+ // Register directories for a new namespace.
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
+ } elseif ($prepend) {
+ // Prepend directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ (array) $paths,
+ $this->prefixDirsPsr4[$prefix]
+ );
+ } else {
+ // Append directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ $this->prefixDirsPsr4[$prefix],
+ (array) $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix,
+ * replacing any others previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param string[]|string $paths The PSR-0 base directories
+ *
+ * @return void
+ */
+ public function set($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr0 = (array) $paths;
+ } else {
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace,
+ * replacing any others previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param string[]|string $paths The PSR-4 base directories
+ *
+ * @throws \InvalidArgumentException
+ *
+ * @return void
+ */
+ public function setPsr4($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr4 = (array) $paths;
+ } else {
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Turns on searching the include path for class files.
+ *
+ * @param bool $useIncludePath
+ *
+ * @return void
+ */
+ public function setUseIncludePath($useIncludePath)
+ {
+ $this->useIncludePath = $useIncludePath;
+ }
+
+ /**
+ * Can be used to check if the autoloader uses the include path to check
+ * for classes.
+ *
+ * @return bool
+ */
+ public function getUseIncludePath()
+ {
+ return $this->useIncludePath;
+ }
+
+ /**
+ * Turns off searching the prefix and fallback directories for classes
+ * that have not been registered with the class map.
+ *
+ * @param bool $classMapAuthoritative
+ *
+ * @return void
+ */
+ public function setClassMapAuthoritative($classMapAuthoritative)
+ {
+ $this->classMapAuthoritative = $classMapAuthoritative;
+ }
+
+ /**
+ * Should class lookup fail if not found in the current class map?
+ *
+ * @return bool
+ */
+ public function isClassMapAuthoritative()
+ {
+ return $this->classMapAuthoritative;
+ }
+
+ /**
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
+ *
+ * @param string|null $apcuPrefix
+ *
+ * @return void
+ */
+ public function setApcuPrefix($apcuPrefix)
+ {
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
+ }
+
+ /**
+ * The APCu prefix in use, or null if APCu caching is not enabled.
+ *
+ * @return string|null
+ */
+ public function getApcuPrefix()
+ {
+ return $this->apcuPrefix;
+ }
+
+ /**
+ * Registers this instance as an autoloader.
+ *
+ * @param bool $prepend Whether to prepend the autoloader or not
+ *
+ * @return void
+ */
+ public function register($prepend = false)
+ {
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+
+ if (null === $this->vendorDir) {
+ return;
+ }
+
+ if ($prepend) {
+ self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
+ } else {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ self::$registeredLoaders[$this->vendorDir] = $this;
+ }
+ }
+
+ /**
+ * Unregisters this instance as an autoloader.
+ *
+ * @return void
+ */
+ public function unregister()
+ {
+ spl_autoload_unregister(array($this, 'loadClass'));
+
+ if (null !== $this->vendorDir) {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ }
+ }
+
+ /**
+ * Loads the given class or interface.
+ *
+ * @param string $class The name of the class
+ * @return true|null True if loaded, null otherwise
+ */
+ public function loadClass($class)
+ {
+ if ($file = $this->findFile($class)) {
+ includeFile($file);
+
+ return true;
+ }
+
+ return null;
+ }
+
+ /**
+ * Finds the path to the file where the class is defined.
+ *
+ * @param string $class The name of the class
+ *
+ * @return string|false The path if found, false otherwise
+ */
+ public function findFile($class)
+ {
+ // class map lookup
+ if (isset($this->classMap[$class])) {
+ return $this->classMap[$class];
+ }
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+ return false;
+ }
+ if (null !== $this->apcuPrefix) {
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+ if ($hit) {
+ return $file;
+ }
+ }
+
+ $file = $this->findFileWithExtension($class, '.php');
+
+ // Search for Hack files if we are running on HHVM
+ if (false === $file && defined('HHVM_VERSION')) {
+ $file = $this->findFileWithExtension($class, '.hh');
+ }
+
+ if (null !== $this->apcuPrefix) {
+ apcu_add($this->apcuPrefix.$class, $file);
+ }
+
+ if (false === $file) {
+ // Remember that this class does not exist.
+ $this->missingClasses[$class] = true;
+ }
+
+ return $file;
+ }
+
+ /**
+ * Returns the currently registered loaders indexed by their corresponding vendor directories.
+ *
+ * @return self[]
+ */
+ public static function getRegisteredLoaders()
+ {
+ return self::$registeredLoaders;
+ }
+
+ /**
+ * @param string $class
+ * @param string $ext
+ * @return string|false
+ */
+ private function findFileWithExtension($class, $ext)
+ {
+ // PSR-4 lookup
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+
+ $first = $class[0];
+ if (isset($this->prefixLengthsPsr4[$first])) {
+ $subPath = $class;
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
+ $subPath = substr($subPath, 0, $lastPos);
+ $search = $subPath . '\\';
+ if (isset($this->prefixDirsPsr4[$search])) {
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
+ if (file_exists($file = $dir . $pathEnd)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-4 fallback dirs
+ foreach ($this->fallbackDirsPsr4 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 lookup
+ if (false !== $pos = strrpos($class, '\\')) {
+ // namespaced class name
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+ } else {
+ // PEAR-like class name
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+ }
+
+ if (isset($this->prefixesPsr0[$first])) {
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+ if (0 === strpos($class, $prefix)) {
+ foreach ($dirs as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-0 fallback dirs
+ foreach ($this->fallbackDirsPsr0 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 include paths.
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+ return $file;
+ }
+
+ return false;
+ }
+}
+
+/**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ *
+ * @param string $file
+ * @return void
+ * @private
+ */
+function includeFile($file)
+{
+ include $file;
+}
diff --git a/manager/media/rss/vendor/composer/InstalledVersions.php b/manager/media/rss/vendor/composer/InstalledVersions.php
new file mode 100644
index 0000000000..41bc143c11
--- /dev/null
+++ b/manager/media/rss/vendor/composer/InstalledVersions.php
@@ -0,0 +1,352 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer;
+
+use Composer\Autoload\ClassLoader;
+use Composer\Semver\VersionParser;
+
+/**
+ * This class is copied in every Composer installed project and available to all
+ *
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
+ *
+ * To require its presence, you can require `composer-runtime-api ^2.0`
+ *
+ * @final
+ */
+class InstalledVersions
+{
+ /**
+ * @var mixed[]|null
+ * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null
+ */
+ private static $installed;
+
+ /**
+ * @var bool|null
+ */
+ private static $canGetVendors;
+
+ /**
+ * @var array[]
+ * @psalm-var array}>
+ */
+ private static $installedByVendor = array();
+
+ /**
+ * Returns a list of all package names which are present, either by being installed, replaced or provided
+ *
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackages()
+ {
+ $packages = array();
+ foreach (self::getInstalled() as $installed) {
+ $packages[] = array_keys($installed['versions']);
+ }
+
+ if (1 === \count($packages)) {
+ return $packages[0];
+ }
+
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
+ }
+
+ /**
+ * Returns a list of all package names with a specific type e.g. 'library'
+ *
+ * @param string $type
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackagesByType($type)
+ {
+ $packagesByType = array();
+
+ foreach (self::getInstalled() as $installed) {
+ foreach ($installed['versions'] as $name => $package) {
+ if (isset($package['type']) && $package['type'] === $type) {
+ $packagesByType[] = $name;
+ }
+ }
+ }
+
+ return $packagesByType;
+ }
+
+ /**
+ * Checks whether the given package is installed
+ *
+ * This also returns true if the package name is provided or replaced by another package
+ *
+ * @param string $packageName
+ * @param bool $includeDevRequirements
+ * @return bool
+ */
+ public static function isInstalled($packageName, $includeDevRequirements = true)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (isset($installed['versions'][$packageName])) {
+ return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks whether the given package satisfies a version constraint
+ *
+ * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
+ *
+ * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
+ *
+ * @param VersionParser $parser Install composer/semver to have access to this class and functionality
+ * @param string $packageName
+ * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
+ * @return bool
+ */
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
+ {
+ $constraint = $parser->parseConstraints($constraint);
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
+
+ return $provided->matches($constraint);
+ }
+
+ /**
+ * Returns a version constraint representing all the range(s) which are installed for a given package
+ *
+ * It is easier to use this via isInstalled() with the $constraint argument if you need to check
+ * whether a given version of a package is installed, and not just whether it exists
+ *
+ * @param string $packageName
+ * @return string Version constraint usable with composer/semver
+ */
+ public static function getVersionRanges($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ $ranges = array();
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
+ }
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
+ }
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
+ }
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
+ }
+
+ return implode(' || ', $ranges);
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getVersion($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['version'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getPrettyVersion($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['pretty_version'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
+ */
+ public static function getReference($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['reference'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['reference'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
+ */
+ public static function getInstallPath($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @return array
+ * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
+ */
+ public static function getRootPackage()
+ {
+ $installed = self::getInstalled();
+
+ return $installed[0]['root'];
+ }
+
+ /**
+ * Returns the raw installed.php data for custom implementations
+ *
+ * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
+ * @return array[]
+ * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}
+ */
+ public static function getRawData()
+ {
+ @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C') {
+ self::$installed = include __DIR__ . '/installed.php';
+ } else {
+ self::$installed = array();
+ }
+ }
+
+ return self::$installed;
+ }
+
+ /**
+ * Returns the raw data of all installed.php which are currently loaded for custom implementations
+ *
+ * @return array[]
+ * @psalm-return list}>
+ */
+ public static function getAllRawData()
+ {
+ return self::getInstalled();
+ }
+
+ /**
+ * Lets you reload the static array from another file
+ *
+ * This is only useful for complex integrations in which a project needs to use
+ * this class but then also needs to execute another project's autoloader in process,
+ * and wants to ensure both projects have access to their version of installed.php.
+ *
+ * A typical case would be PHPUnit, where it would need to make sure it reads all
+ * the data it needs from this class, then call reload() with
+ * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
+ * the project in which it runs can then also use this class safely, without
+ * interference between PHPUnit's dependencies and the project's dependencies.
+ *
+ * @param array[] $data A vendor/composer/installed.php data set
+ * @return void
+ *
+ * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data
+ */
+ public static function reload($data)
+ {
+ self::$installed = $data;
+ self::$installedByVendor = array();
+ }
+
+ /**
+ * @return array[]
+ * @psalm-return list}>
+ */
+ private static function getInstalled()
+ {
+ if (null === self::$canGetVendors) {
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
+ }
+
+ $installed = array();
+
+ if (self::$canGetVendors) {
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
+ if (isset(self::$installedByVendor[$vendorDir])) {
+ $installed[] = self::$installedByVendor[$vendorDir];
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
+ $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
+ if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
+ self::$installed = $installed[count($installed) - 1];
+ }
+ }
+ }
+ }
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C') {
+ self::$installed = require __DIR__ . '/installed.php';
+ } else {
+ self::$installed = array();
+ }
+ }
+ $installed[] = self::$installed;
+
+ return $installed;
+ }
+}
diff --git a/manager/media/rss/vendor/composer/LICENSE b/manager/media/rss/vendor/composer/LICENSE
new file mode 100644
index 0000000000..f27399a042
--- /dev/null
+++ b/manager/media/rss/vendor/composer/LICENSE
@@ -0,0 +1,21 @@
+
+Copyright (c) Nils Adermann, Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/manager/media/rss/vendor/composer/autoload_classmap.php b/manager/media/rss/vendor/composer/autoload_classmap.php
new file mode 100644
index 0000000000..0fb0a2c194
--- /dev/null
+++ b/manager/media/rss/vendor/composer/autoload_classmap.php
@@ -0,0 +1,10 @@
+ $vendorDir . '/composer/InstalledVersions.php',
+);
diff --git a/manager/media/rss/vendor/composer/autoload_namespaces.php b/manager/media/rss/vendor/composer/autoload_namespaces.php
new file mode 100644
index 0000000000..b031e00bec
--- /dev/null
+++ b/manager/media/rss/vendor/composer/autoload_namespaces.php
@@ -0,0 +1,10 @@
+ array($vendorDir . '/simplepie/simplepie/library'),
+);
diff --git a/manager/media/rss/vendor/composer/autoload_psr4.php b/manager/media/rss/vendor/composer/autoload_psr4.php
new file mode 100644
index 0000000000..669b3fb8a8
--- /dev/null
+++ b/manager/media/rss/vendor/composer/autoload_psr4.php
@@ -0,0 +1,10 @@
+ array($vendorDir . '/simplepie/simplepie/src'),
+);
diff --git a/manager/media/rss/vendor/composer/autoload_real.php b/manager/media/rss/vendor/composer/autoload_real.php
new file mode 100644
index 0000000000..7b2567d68f
--- /dev/null
+++ b/manager/media/rss/vendor/composer/autoload_real.php
@@ -0,0 +1,38 @@
+register(true);
+
+ return $loader;
+ }
+}
diff --git a/manager/media/rss/vendor/composer/autoload_static.php b/manager/media/rss/vendor/composer/autoload_static.php
new file mode 100644
index 0000000000..71456b2f07
--- /dev/null
+++ b/manager/media/rss/vendor/composer/autoload_static.php
@@ -0,0 +1,47 @@
+
+ array (
+ 'SimplePie\\' => 10,
+ ),
+ );
+
+ public static $prefixDirsPsr4 = array (
+ 'SimplePie\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/simplepie/simplepie/src',
+ ),
+ );
+
+ public static $prefixesPsr0 = array (
+ 'S' =>
+ array (
+ 'SimplePie' =>
+ array (
+ 0 => __DIR__ . '/..' . '/simplepie/simplepie/library',
+ ),
+ ),
+ );
+
+ public static $classMap = array (
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
+ );
+
+ public static function getInitializer(ClassLoader $loader)
+ {
+ return \Closure::bind(function () use ($loader) {
+ $loader->prefixLengthsPsr4 = ComposerStaticInit18405f17305dd156bb6ad26393203206::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInit18405f17305dd156bb6ad26393203206::$prefixDirsPsr4;
+ $loader->prefixesPsr0 = ComposerStaticInit18405f17305dd156bb6ad26393203206::$prefixesPsr0;
+ $loader->classMap = ComposerStaticInit18405f17305dd156bb6ad26393203206::$classMap;
+
+ }, null, ClassLoader::class);
+ }
+}
diff --git a/manager/media/rss/vendor/composer/installed.json b/manager/media/rss/vendor/composer/installed.json
new file mode 100644
index 0000000000..830cbc7f38
--- /dev/null
+++ b/manager/media/rss/vendor/composer/installed.json
@@ -0,0 +1,83 @@
+{
+ "packages": [
+ {
+ "name": "simplepie/simplepie",
+ "version": "1.6.0",
+ "version_normalized": "1.6.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/simplepie/simplepie.git",
+ "reference": "2bdbc51ed1010941c9c5f2cddca433e79665bfe1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/simplepie/simplepie/zipball/2bdbc51ed1010941c9c5f2cddca433e79665bfe1",
+ "reference": "2bdbc51ed1010941c9c5f2cddca433e79665bfe1",
+ "shasum": ""
+ },
+ "require": {
+ "ext-pcre": "*",
+ "ext-xml": "*",
+ "ext-xmlreader": "*",
+ "php": ">=5.6.0"
+ },
+ "require-dev": {
+ "yoast/phpunit-polyfills": "^1.0.1"
+ },
+ "suggest": {
+ "ext-curl": "",
+ "ext-iconv": "",
+ "ext-intl": "",
+ "ext-mbstring": "",
+ "mf2/mf2": "Microformat module that allows for parsing HTML for microformats"
+ },
+ "time": "2022-04-21T11:05:19+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "SimplePie": "library"
+ },
+ "psr-4": {
+ "SimplePie\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Ryan Parman",
+ "homepage": "http://ryanparman.com/",
+ "role": "Creator, alumnus developer"
+ },
+ {
+ "name": "Sam Sneddon",
+ "homepage": "https://gsnedders.com/",
+ "role": "Alumnus developer"
+ },
+ {
+ "name": "Ryan McCue",
+ "email": "me@ryanmccue.info",
+ "homepage": "http://ryanmccue.info/",
+ "role": "Developer"
+ }
+ ],
+ "description": "A simple Atom/RSS parsing library for PHP",
+ "homepage": "http://simplepie.org/",
+ "keywords": [
+ "atom",
+ "feeds",
+ "rss"
+ ],
+ "support": {
+ "issues": "https://github.com/simplepie/simplepie/issues",
+ "source": "https://github.com/simplepie/simplepie/tree/1.6.0"
+ },
+ "install-path": "../simplepie/simplepie"
+ }
+ ],
+ "dev": true,
+ "dev-package-names": []
+}
diff --git a/manager/media/rss/vendor/composer/installed.php b/manager/media/rss/vendor/composer/installed.php
new file mode 100644
index 0000000000..0e1b1358c3
--- /dev/null
+++ b/manager/media/rss/vendor/composer/installed.php
@@ -0,0 +1,32 @@
+ array(
+ 'pretty_version' => '1.0.0+no-version-set',
+ 'version' => '1.0.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'reference' => NULL,
+ 'name' => '__root__',
+ 'dev' => true,
+ ),
+ 'versions' => array(
+ '__root__' => array(
+ 'pretty_version' => '1.0.0+no-version-set',
+ 'version' => '1.0.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'reference' => NULL,
+ 'dev_requirement' => false,
+ ),
+ 'simplepie/simplepie' => array(
+ 'pretty_version' => '1.6.0',
+ 'version' => '1.6.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../simplepie/simplepie',
+ 'aliases' => array(),
+ 'reference' => '2bdbc51ed1010941c9c5f2cddca433e79665bfe1',
+ 'dev_requirement' => false,
+ ),
+ ),
+);
diff --git a/manager/media/rss/vendor/composer/platform_check.php b/manager/media/rss/vendor/composer/platform_check.php
new file mode 100644
index 0000000000..8b379f4469
--- /dev/null
+++ b/manager/media/rss/vendor/composer/platform_check.php
@@ -0,0 +1,26 @@
+= 50600)) {
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.';
+}
+
+if ($issues) {
+ if (!headers_sent()) {
+ header('HTTP/1.1 500 Internal Server Error');
+ }
+ if (!ini_get('display_errors')) {
+ if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
+ fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
+ } elseif (!headers_sent()) {
+ echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
+ }
+ }
+ trigger_error(
+ 'Composer detected issues in your platform: ' . implode(' ', $issues),
+ E_USER_ERROR
+ );
+}
diff --git a/manager/media/rss/vendor/simplepie/simplepie/.editorconfig b/manager/media/rss/vendor/simplepie/simplepie/.editorconfig
new file mode 100644
index 0000000000..ba48d7f1d3
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/.editorconfig
@@ -0,0 +1,20 @@
+# https://EditorConfig.org
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.{css,html,js,json,php,sql}]
+indent_style = tab
+
+[*.{markdown,md}]
+indent_size = 4
+indent_style = space
+max_line_length = off
+trim_trailing_whitespace = false
+
+[*.{yaml,yml}]
+indent_size = 2
+indent_style = space
diff --git a/manager/media/rss/vendor/simplepie/simplepie/CHANGELOG.md b/manager/media/rss/vendor/simplepie/simplepie/CHANGELOG.md
new file mode 100644
index 0000000000..800c8b385f
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/CHANGELOG.md
@@ -0,0 +1,209 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [Unreleased](https://github.com/simplepie/simplepie/compare/1.6.0...master)
+
+## [1.6.0](https://github.com/simplepie/simplepie/compare/1.5.8...1.6.0) - 2022-04-21
+
+### Added
+
+- New methods `SimplePie::rename_attributes()` and `SimplePie_Sanitize::rename_attributes()` allow renaming attributes by @math-GH in [#717](https://github.com/simplepie/simplepie/pull/717)
+- Add audio, video @src elements/attribute for URL resolution by @rdalverny in [#716](https://github.com/simplepie/simplepie/pull/716)
+- Added new namespaced aliases and PSR-4 support for every class by @Art4 in [#711](https://github.com/simplepie/simplepie/pull/711)
+- Add .editorconfig by @Alkarex in [#724](https://github.com/simplepie/simplepie/pull/724)
+- Upload compiled file as release asset by @Art4 in [#725](https://github.com/simplepie/simplepie/pull/725)
+
+### Changed
+
+- GH Actions: version update for ramsey/composer-install by @jrfnl in [#713](https://github.com/simplepie/simplepie/pull/713)
+
+### Fixed
+
+- Bugfix in MySQL cache by @Art4 in [#720](https://github.com/simplepie/simplepie/pull/720)
+- Re-enable xml:base for all supported RSS formats by @Alkarex in [#723](https://github.com/simplepie/simplepie/pull/723)
+
+## [1.5.8](https://github.com/simplepie/simplepie/compare/1.5.7...1.5.8) - 2021-12-24
+
+### Changed
+
+- Update CHANGELOG.md, follow keepachangelog format by @Art4 in [#709](https://github.com/simplepie/simplepie/pull/709)
+
+### Fixed
+
+- Fix a small typo in the error() function Docblock by @audrasjb in [#712](https://github.com/simplepie/simplepie/pull/712)
+- Fix/708 version bump for constant `SIMPLEPIE_VERSION` for 1.5.8 release by @faisal-alvi in [#710](https://github.com/simplepie/simplepie/pull/710)
+
+## [1.5.7](https://github.com/simplepie/simplepie/compare/1.5.6...1.5.7) - 2021-12-19
+
+* Fix PHP8 crash due to insufficient isset test by @Alkarex in [#670](https://github.com/simplepie/simplepie/pull/670)
+* gitignore tests by @Alkarex in [#671](https://github.com/simplepie/simplepie/pull/671)
+* Reduce memory when parsing large feeds by @Alkarex in [#672](https://github.com/simplepie/simplepie/pull/672)
+* PHP8 catch ValueError for loadHTML() by @Alkarex in [#673](https://github.com/simplepie/simplepie/pull/673)
+* Provide access to HTTP status code by @Alkarex in [#674](https://github.com/simplepie/simplepie/pull/674)
+* Fix wrong type hint by @Alkarex in [#678](https://github.com/simplepie/simplepie/pull/678)
+* Force HTTPS for selected domains by @Alkarex in [#676](https://github.com/simplepie/simplepie/pull/676)
+* Prevent cache polution by @Alkarex in [#675](https://github.com/simplepie/simplepie/pull/675)
+* Fix typo in comment by @Alkarex in [#680](https://github.com/simplepie/simplepie/pull/680)
+* Remove HTTP credentials in HTTP Referer by @Alkarex in [#681](https://github.com/simplepie/simplepie/pull/681)
+* CI: switch to GH Actions by @jrfnl in [#688](https://github.com/simplepie/simplepie/pull/688)
+* PHP 8.1: fix "passing null to non-nullable" deprecation notice by @jrfnl in [#689](https://github.com/simplepie/simplepie/pull/689)
+* Tests: PHPUnit cross-version compatibility by @jrfnl in [#690](https://github.com/simplepie/simplepie/pull/690)
+* Tests: use strict assertions by @jrfnl in [#692](https://github.com/simplepie/simplepie/pull/692)
+* CacheTest: handle different exceptions PHP cross-version by @jrfnl in [#691](https://github.com/simplepie/simplepie/pull/691)
+* GH Actions: don't allow builds to fail on PHP 8.0 or 8.1 by @jrfnl in [#693](https://github.com/simplepie/simplepie/pull/693)
+* Tests: use the correct parameter order by @jrfnl in [#694](https://github.com/simplepie/simplepie/pull/694)
+* PHPUnit: update configuration by @jrfnl in [#696](https://github.com/simplepie/simplepie/pull/696)
+* fix: better deal with proxy returning proxy headers (in response to cURL's Proxy-Connection header) by @shunf4 in [#698](https://github.com/simplepie/simplepie/pull/698)
+* Handle multiple Link headers by @voegelas in [#700](https://github.com/simplepie/simplepie/pull/700)
+* PHP 8.2: explicitly declare properties by @jrfnl in [#705](https://github.com/simplepie/simplepie/pull/705)
+* New Contributor: @shunf4 made their first contribution in [#698](https://github.com/simplepie/simplepie/pull/698)
+* New Contributor: @voegelas made their first contribution in [#700](https://github.com/simplepie/simplepie/pull/700)
+
+## [1.5.6](https://github.com/simplepie/simplepie/compare/1.5.5...1.5.6) - 2020-10-14
+
+* PHP 8.0: prevent ValueError for invalid encoding [#657](https://github.com/simplepie/simplepie/pull/657)
+* Travis: test against more recent PHP versions [#653](https://github.com/simplepie/simplepie/pull/653)
+* PHP 8.0: handle removal of get_magic_quotes_gpc() [#654](https://github.com/simplepie/simplepie/pull/654)
+* PHP 7.4/8.0: curly brace array access deprecated & removed [#655](https://github.com/simplepie/simplepie/pull/655)
+* PHP 8.0: required parameters are no longer allowed after optional parameters [#656](https://github.com/simplepie/simplepie/pull/656)
+* Fix permanent_url for HTTP 301 [#660](https://github.com/simplepie/simplepie/pull/660)
+* Fix typo in MIME type in Content_Type_Sniffer [#661](https://github.com/simplepie/simplepie/pull/661)
+
+## [1.5.5](https://github.com/simplepie/simplepie/compare/1.5.4...1.5.5) - 2020-05-01
+
+* Ensure that feeds retrieved with `force_feed` do not share the same cache as those retrieved without. [#643](https://github.com/simplepie/simplepie/pull/643)
+* Removed references to removed PHP directives and some PHP < 5.6 checks. [#645](https://github.com/simplepie/simplepie/pull/645)
+* Corrected incorrect alumni name. [#638](https://github.com/simplepie/simplepie/pull/638)
+
+## [1.5.4](https://github.com/simplepie/simplepie/compare/1.5.3...1.5.4) - 2019-12-17
+
+* PHP 5.6 or newer is now required. [#625](https://github.com/simplepie/simplepie/pull/625)
+* Fixed invalid docblock parameter types [#633](https://github.com/simplepie/simplepie/pull/633)
+* Added support for German short forms for weekdays and months. [#632](https://github.com/simplepie/simplepie/pull/632)
+* PHP 7.4 support: Fixed instances of accessing array offset on null type values. [#628](https://github.com/simplepie/simplepie/pull/628)
+* Return an effective feed URL when asking for non-permanent `subscribe_url`. [#627](https://github.com/simplepie/simplepie/pull/627)
+
+## [1.5.3](https://github.com/simplepie/simplepie/compare/1.5.2...1.5.3) - 2019-09-22
+
+* Replaced `pow()` call with `**` operator (micro performance optimization). [#622](https://github.com/simplepie/simplepie/pull/622)
+* Match links containing `feed` in the Locator class. [#621](https://github.com/simplepie/simplepie/pull/621)
+* PHP 7.4 support: Ensure the proper argument order for `implode()` calls. [#617](https://github.com/simplepie/simplepie/pull/617)
+* Added support for Russian dates. [#607](https://github.com/simplepie/simplepie/pull/607)
+* Preemptively changed `is_writeable()` calls to `is_writable()` in case the former is deprecated in PHP. [#604](https://github.com/simplepie/simplepie/pull/604)
+
+## [1.5.2](https://github.com/simplepie/simplepie/compare/1.5.1...1.5.2) - 2018-08-02
+
+* Added support for PHPUnit 6. [#565](https://github.com/simplepie/simplepie/pull/565)
+* Added PHP module requirements to Composer. [#590](https://github.com/simplepie/simplepie/pull/590)
+* Added support for Redis password and database. [#589](https://github.com/simplepie/simplepie/pull/589)
+* Changed the spelling of `writeable` to `writable` within inline documentation. [#586](https://github.com/simplepie/simplepie/pull/586)
+* Fixed various issues in the test suite and Travis. [#576](https://github.com/simplepie/simplepie/pull/576)
+* Removed ambiguous tests failing on `usort()` in PHP 7. [#578](https://github.com/simplepie/simplepie/pull/578)
+* Simplified logic for some function returns. [#573](https://github.com/simplepie/simplepie/pull/573)
+* Fixed inline documentation for return value types for accuracy. [#570](https://github.com/simplepie/simplepie/pull/570)
+* Fixed Travis to run `composer install`. [#567](https://github.com/simplepie/simplepie/pull/567)
+* Removed unnecessary `else`s when a value has already been returned. [#566](https://github.com/simplepie/simplepie/pull/566)
+* Fixed a bug where URL fragments are included when `SimplePie_File` normalizes URLs when really old versions of cURL are used. [#564](https://github.com/simplepie/simplepie/pull/564)
+* Updated `SimplePie_Locator` to respect cURL options specified. [#561](https://github.com/simplepie/simplepie/pull/561)
+
+## [1.5.1](https://github.com/simplepie/simplepie/compare/1.5...1.5.1) - 2017-11-17
+
+* Fixed photos so they are not added if the URL is empty. [#530](https://github.com/simplepie/simplepie/pull/530)
+* Fixed issues with retrieving feeds from behind a proxy. [#512](https://github.com/simplepie/simplepie/pull/512)/[#548](https://github.com/simplepie/simplepie/pull/548)
+* Updated favicon URL in `get_favicon()`. [#525](https://github.com/simplepie/simplepie/pull/525)
+* Fixed inline documentation typo. [#540](https://github.com/simplepie/simplepie/pull/540)
+* Removed extra closing `` tag. [#537](https://github.com/simplepie/simplepie/pull/537)
+* Removed and updated feed URLs in the demo. [#535](https://github.com/simplepie/simplepie/pull/535)
+* Improvements to microformat feed parsing. [#533](https://github.com/simplepie/simplepie/pull/533)
+* Switched from regex to xpath for microformats discovery. [#536](https://github.com/simplepie/simplepie/pull/536)
+* Update the registry if the Sanitize class has been changed. [#532](https://github.com/simplepie/simplepie/pull/532)
+* Changed the sanitization type for author and category back to text from HTML. [#531](https://github.com/simplepie/simplepie/pull/531)
+
+## [1.5](https://github.com/simplepie/simplepie/compare/1.4.3...1.5) - 2017-04-17
+
+* Introduced `SimplePie_Category->get_type()` for retrieving category type. [#492](https://github.com/simplepie/simplepie/pull/492)
+* Added `$enable_exceptions` to the class property declarations for `SimplePie` class. [#504](https://github.com/simplepie/simplepie/pull/504)
+* Titles are now parsed for ATOM10 enclosure links. [#507](https://github.com/simplepie/simplepie/pull/507)
+* `$item->get_id()` can now be forced to return the supplied ID instead of generating a new one. [#509](https://github.com/simplepie/simplepie/pull/509)
+
+## [1.4.3](https://github.com/simplepie/simplepie/compare/1.4.2...1.4.3) - 2016-11-26
+
+* Removed support for PHP 5.2. [#469](https://github.com/simplepie/simplepie/pull/469)
+* Added support for the PHP `UConverter` class. [#485](https://github.com/simplepie/simplepie/pull/485)
+* PHP 7.1 Support: Fixed PHP error when trying to use a non-numeric value in `round()`. [#458](https://github.com/simplepie/simplepie/pull/458)
+* PHP 7 Support: Fixed deprecated message for old style constructors. [#489](https://github.com/simplepie/simplepie/pull/489)
+* Fixed the error message shown when a feed has an empty body. [#487](https://github.com/simplepie/simplepie/pull/487)
+* Added an error message when the XML or PCRE PHP extensions are missing. [#468](https://github.com/simplepie/simplepie/pull/468)
+* Check the result of sanitize before returning in `get_content()` and `get_description()`. [#494](https://github.com/simplepie/simplepie/pull/494)
+* Use `saveHTML()` to fix issues with non UTF-8 characters. [#470](https://github.com/simplepie/simplepie/pull/470)
+* Stop passing compressed data through `trim()`. [#455](https://github.com/simplepie/simplepie/pull/455)
+* Refactored the UTF-8 conversion error message. [#467](https://github.com/simplepie/simplepie/pull/467)
+* Updated the readme file. [#486](https://github.com/simplepie/simplepie/pull/486)
+* Added command line support for compayibility test. [#481](https://github.com/simplepie/simplepie/pull/481)
+* Added PHP 7.1 to the testing matrix. [#462](https://github.com/simplepie/simplepie/pull/462)
+* Use the latest HHVM version in testing (3.15.2). [#480](https://github.com/simplepie/simplepie/pull/480)
+* Added PHPUnit as a `dev-dependency` in Composer. [#463](https://github.com/simplepie/simplepie/pull/463)
+* Added `mf2/mf2` as a suggestion in Composer for use with microformats. [#491](https://github.com/simplepie/simplepie/pull/491)
+* Fixed misspelled occurrences of "separated". [#459](https://github.com/simplepie/simplepie/pull/459)
+* Improvements to the compatibility test and error messages. [#488](https://github.com/simplepie/simplepie/pull/488)
+
+## [1.4.2](https://github.com/simplepie/simplepie/compare/1.4.1...1.4.2) - 2016-06-14
+
+* Fixed a bug with IRI parsing.
+* More cleanly separates discovery of microformats and parsing when php-mf2 is not present.
+
+## [1.4.1](https://github.com/simplepie/simplepie/compare/1.4.0...1.4.1) - 2016-06-02
+
+* Fixed inconsistent hash results in `SimplePie_Item->get_id()`.
+* Leading and trailing whitespace is now trimmed from XML feed content to prevent errors. [#445](https://github.com/simplepie/simplepie/pull/445)
+* Improved support for microformat feeds.
+
+## [1.4.0](https://github.com/simplepie/simplepie/compare/1.4-beta...1.4.0) - 2016-04-25
+
+* Dropped support for PHP 5.2. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Serialized data is now used for hashing in `SimplePie_Item->get_id()`. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Added support for PHP 5.5 and 5.6. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Added the `add_attributes()` method to `SimplePie`. [#394](https://github.com/simplepie/simplepie/pull/394)
+* Added the `force_cache_fallback()` method to `SimplePie` to allow an expired cache to be used when a feed is unavailable. [#389](https://github.com/simplepie/simplepie/pull/389)
+* Added Memcached. [#386](https://github.com/simplepie/simplepie/pull/386)
+* Added `set_curl_options()` method to `SimplePie` to allow custom options. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Added Redis Caching. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Added the CEST timezone. [#380](https://github.com/simplepie/simplepie/pull/380)
+* Added support for HTTP 301 Moved Permanently. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Added support for `application/x-rss+xml` in `SimplePie_Locator`. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Added photo de-duping in microformats. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Added decoding for special characters in MAYBE_HTML. [#400](https://github.com/simplepie/simplepie/pull/400)
+* Added `SimplePie_Exception` for internally reporting errors. Also, use this to show an error when trying to load the class instead of causing a failure. [#241](https://github.com/simplepie/simplepie/pull/241)
+* Added sanitization of the `` and `` tags. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Added support for media thumbnails through `SimplePie_Item->get_thumbnail()`. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Added the `feed_url` to a returned error message. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Added cache purging after a specified period of time when using MySQL cache. [#329](https://github.com/simplepie/simplepie/pull/329)
+* Added backwards compatibility for removed `subscribe_*()` and `enable_xml_dump()` methods. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Re-added the deprecated `get/set_favicon()` methods for backwards compatibility.
+* Charsets are now compared without case sensitivity to avoid duplicates. [#352](https://github.com/simplepie/simplepie/pull/352)
+* Fixed encoding of ampersands in `SimplePie->subscribe_url()`. [#348](https://github.com/simplepie/simplepie/pull/348)
+* The feed URL is now updated based on the URL returned by cURL. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Explicitly use UTF-8 in `SimplePie_Misc->get_element()` and `Simple_ie_Misc->element_implode()`. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Improved support, feed and authorship discovery, and parsing for microformats. [#348](https://github.com/simplepie/simplepie/pull/348)
+* `rss:pubDate` is now used over `atom:updated` when determining the posting date. [#288](https://github.com/simplepie/simplepie/pull/288)
+* Simplified the use of `mtime()` and `touch()`. [#403](https://github.com/simplepie/simplepie/pull/403)
+* All items are now forced to have a timestamp. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Fixed typo in the date parser that incorrectly identified September as month 8. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Fixed backwards compatibility with cache subclasses. [#243](https://github.com/simplepie/simplepie/pull/243)
+* Fixed a bug where the updated date was not fetched correctly. [#239](https://github.com/simplepie/simplepie/pull/239)
+* Fixed the datatype for `items.data` to be more appropriate in when using MySQL cache. [#302](https://github.com/simplepie/simplepie/pull/302)
+* Fixed cURL not failing when the server returns an error. [#425](https://github.com/simplepie/simplepie/pull/425)
+* Fixed an error caused when trying to instantiate a `SimplePie_File` object with a bad URI. [#272](https://github.com/simplepie/simplepie/pull/272)
+* Fixed a PHP notice that occurs when a date starts with `(`. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Fixed uninitialized string offeset PHP notices. [#353](https://github.com/simplepie/simplepie/pull/353)
+* Fixed call to non-existent property in Memcache. [#311](https://github.com/simplepie/simplepie/pull/311)
+* Fixed a bug where MySQL statements were not being passed thorugh `prepare()`. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Fixed an instance where an error message in `SimplePie` was not being triggered correctly. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Fixed a bug with Russian feeds. [#348](https://github.com/simplepie/simplepie/pull/348)
+* Fixed an issue with memory leaks. [#287](https://github.com/simplepie/simplepie/pull/287)
+* Fixed use of `DOMElement` as array. [#315](https://github.com/simplepie/simplepie/pull/315)
+* Improved the error message when a feed cannot be found. [#348](https://github.com/simplepie/simplepie/pull/348)
diff --git a/manager/media/rss/vendor/simplepie/simplepie/LICENSE.txt b/manager/media/rss/vendor/simplepie/simplepie/LICENSE.txt
new file mode 100644
index 0000000000..6503e83c13
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/LICENSE.txt
@@ -0,0 +1,26 @@
+Copyright (c) 2004-2007, Ryan Parman and Sam Sneddon.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are
+permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of
+ conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice, this list
+ of conditions and the following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ * Neither the name of the SimplePie Team nor the names of its contributors may be used
+ to endorse or promote products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
+AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/manager/media/rss/vendor/simplepie/simplepie/README.markdown b/manager/media/rss/vendor/simplepie/simplepie/README.markdown
new file mode 100644
index 0000000000..f54b077361
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/README.markdown
@@ -0,0 +1,112 @@
+SimplePie
+=========
+
+SimplePie is a very fast and easy-to-use class, written in PHP, that puts the
+'simple' back into 'really simple syndication'. Flexible enough to suit
+beginners and veterans alike, SimplePie is focused on [speed, ease of use,
+compatibility and standards compliance][what_is].
+
+[what_is]: http://simplepie.org/wiki/faq/what_is_simplepie
+
+
+Requirements
+------------
+* PHP 5.6+ (Required since SimplePie 1.5.3)
+* libxml2 (certain 2.7.x releases are too buggy for words, and will crash)
+* One of iconv, mbstring or intl extensions
+* cURL or fsockopen()
+* PCRE support
+
+
+What comes in the package?
+--------------------------
+1. `library/` - SimplePie classes for use with the autoloader
+2. `autoloader.php` - The SimplePie Autoloader if you want to use the separate
+ file version.
+3. `README.markdown` - This document.
+4. `LICENSE.txt` - A copy of the BSD license.
+5. `compatibility_test/` - The SimplePie compatibility test that checks your
+ server for required settings.
+6. `demo/` - A basic feed reader demo that shows off some of SimplePie's more
+ noticeable features.
+7. `idn/` - A third-party library that SimplePie can optionally use to
+ understand Internationalized Domain Names (IDNs).
+8. `build/` - Scripts related to generating pieces of SimplePie
+9. `test/` - SimplePie's unit test suite.
+
+### Where's `simplepie.inc`?
+Since SimplePie 1.3, we've split the classes into separate files to make it easier
+to maintain and use.
+
+If you'd like a single monolithic file, see the assets in the
+[releases](https://github.com/simplepie/simplepie/releases), or you can
+run `php build/compile.php` to generate `SimplePie.compiled.php` yourself.
+
+To start the demo
+-----------------
+1. Upload this package to your webserver.
+2. Make sure that the cache folder inside of the demo folder is server-writable.
+3. Navigate your browser to the demo folder.
+
+
+Need support?
+-------------
+For further setup and install documentation, function references, etc., visit
+[the wiki][wiki]. If you're using the latest version off GitHub, you can also
+check out the [API documentation][].
+
+If you can't find an answer to your question in the documentation, head on over
+to one of our [support channels][]. For bug reports and feature requests, visit
+the [issue tracker][].
+
+[API documentation]: http://dev.simplepie.org/api/
+[wiki]: http://simplepie.org/wiki/
+[support channels]: http://simplepie.org/support/
+[issue tracker]: http://github.com/simplepie/simplepie/issues
+
+
+Project status
+--------------
+SimplePie is currently maintained by Malcolm Blaney.
+
+As an open source project, SimplePie is maintained on a somewhat sporadic basis.
+This means that feature requests may not be fulfilled straight away, as time has
+to be prioritized.
+
+If you'd like to contribute to SimplePie, the best way to get started is to fork
+the project on GitHub and send pull requests for patches. When doing so, please
+be aware of our [coding standards][].
+
+[coding standards]: http://simplepie.org/wiki/misc/coding_standards
+
+
+Authors and contributors
+------------------------
+### Current
+* [Malcolm Blaney][] (Maintainer, support)
+
+### Alumni
+* [Ryan McCue][] (developer, support)
+* [Ryan Parman][] (Creator, developer, evangelism, support)
+* [Sam Sneddon][] (Lead developer)
+* [Michael Shipley][] (Submitter of patches, support)
+* [Steve Minutillo][] (Submitter of patches)
+
+[Malcolm Blaney]: https://mblaney.xyz
+[Ryan McCue]: http://ryanmccue.info
+[Ryan Parman]: http://ryanparman.com
+[Sam Sneddon]: https://gsnedders.com
+[Michael Shipley]: http://michaelpshipley.com
+[Steve Minutillo]: http://minutillo.com/steve/
+
+
+### Contributors
+For a complete list of contributors:
+
+1. Pull down the latest SimplePie code
+2. In the `simplepie` directory, run `git shortlog -ns`
+
+
+License
+-------
+[New BSD license](http://www.opensource.org/licenses/BSD-3-Clause)
diff --git a/manager/media/rss/vendor/simplepie/simplepie/autoloader.php b/manager/media/rss/vendor/simplepie/simplepie/autoloader.php
new file mode 100644
index 0000000000..bf34a70034
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/autoloader.php
@@ -0,0 +1,87 @@
+path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'library';
+ }
+
+ /**
+ * Autoloader
+ *
+ * @param string $class The name of the class to attempt to load.
+ */
+ public function autoload($class)
+ {
+ // Only load the class if it starts with "SimplePie"
+ if (strpos($class, 'SimplePie') !== 0)
+ {
+ return;
+ }
+
+ $filename = $this->path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
+ include $filename;
+ }
+}
\ No newline at end of file
diff --git a/manager/media/rss/vendor/simplepie/simplepie/composer.json b/manager/media/rss/vendor/simplepie/simplepie/composer.json
new file mode 100644
index 0000000000..ca9ec8363d
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/composer.json
@@ -0,0 +1,61 @@
+{
+ "name": "simplepie/simplepie",
+ "description": "A simple Atom/RSS parsing library for PHP",
+ "type": "library",
+ "keywords": ["rss", "atom", "feeds"],
+ "homepage": "http://simplepie.org/",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "Ryan Parman",
+ "homepage": "http://ryanparman.com/",
+ "role": "Creator, alumnus developer"
+ },
+ {
+ "name": "Sam Sneddon",
+ "homepage": "https://gsnedders.com/",
+ "role": "Alumnus developer"
+ },
+ {
+ "name": "Ryan McCue",
+ "email": "me@ryanmccue.info",
+ "homepage": "http://ryanmccue.info/",
+ "role": "Developer"
+ }
+ ],
+ "require": {
+ "php": ">=5.6.0",
+ "ext-pcre": "*",
+ "ext-xml": "*",
+ "ext-xmlreader": "*"
+ },
+ "require-dev": {
+ "yoast/phpunit-polyfills": "^1.0.1"
+ },
+ "suggest": {
+ "ext-curl": "",
+ "ext-iconv": "",
+ "ext-intl": "",
+ "ext-mbstring": "",
+ "mf2/mf2": "Microformat module that allows for parsing HTML for microformats"
+ },
+ "autoload": {
+ "psr-4": {
+ "SimplePie\\": "src"
+ },
+ "psr-0": {
+ "SimplePie": "library"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "SimplePie\\Tests\\Unit\\": "tests/Unit"
+ }
+ },
+ "config": {
+ "bin-dir": "bin"
+ },
+ "scripts": {
+ "test": "phpunit"
+ }
+}
diff --git a/manager/media/rss/vendor/simplepie/simplepie/db.sql b/manager/media/rss/vendor/simplepie/simplepie/db.sql
new file mode 100644
index 0000000000..8793829404
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/db.sql
@@ -0,0 +1,40 @@
+/* SQLite */
+CREATE TABLE cache_data (
+ id TEXT NOT NULL,
+ items SMALLINT NOT NULL DEFAULT 0,
+ data BLOB NOT NULL,
+ mtime INTEGER UNSIGNED NOT NULL
+);
+CREATE UNIQUE INDEX id ON cache_data(id);
+
+CREATE TABLE items (
+ feed_id TEXT NOT NULL,
+ id TEXT NOT NULL,
+ data TEXT NOT NULL,
+ posted INTEGER UNSIGNED NOT NULL
+);
+CREATE INDEX feed_id ON items(feed_id);
+
+
+/* MySQL */
+--- Don't paste this to create tables, since SimplePie will create
+--- tables by its own.
+CREATE TABLE `cache_data` (
+ `id` TEXT CHARACTER SET utf8 NOT NULL,
+ `items` SMALLINT NOT NULL DEFAULT 0,
+ `data` BLOB NOT NULL,
+ `mtime` INT UNSIGNED NOT NULL,
+ UNIQUE (
+ `id`(125)
+ )
+);
+
+CREATE TABLE `items` (
+ `feed_id` TEXT CHARACTER SET utf8 NOT NULL,
+ `id` TEXT CHARACTER SET utf8 NOT NULL,
+ `data` MEDIUMBLOB NOT NULL,
+ `posted` INT UNSIGNED NOT NULL,
+ INDEX `feed_id` (
+ `feed_id`(125)
+ )
+);
\ No newline at end of file
diff --git a/manager/media/rss/vendor/simplepie/simplepie/idn/LICENCE b/manager/media/rss/vendor/simplepie/simplepie/idn/LICENCE
new file mode 100644
index 0000000000..25a1d22dfe
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/idn/LICENCE
@@ -0,0 +1,502 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ , 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/manager/media/rss/vendor/simplepie/simplepie/idn/ReadMe.txt b/manager/media/rss/vendor/simplepie/simplepie/idn/ReadMe.txt
new file mode 100644
index 0000000000..7ca8c7e6de
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/idn/ReadMe.txt
@@ -0,0 +1,123 @@
+*******************************************************************************
+* *
+* IDNA Convert (idna_convert.class.php) *
+* *
+* http://idnaconv.phlymail.de mailto:phlymail@phlylabs.de *
+*******************************************************************************
+* (c) 2004-2007 phlyLabs, Berlin *
+* This file is encoded in UTF-8 *
+*******************************************************************************
+
+Introduction
+------------
+
+The class idna_convert allows to convert internationalized domain names
+(see RFC 3490, 3491, 3492 and 3454 for detials) as they can be used with various
+registries worldwide to be translated between their original (localized) form
+and their encoded form as it will be used in the DNS (Domain Name System).
+
+The class provides two public methods, encode() and decode(), which do exactly
+what you would expect them to do. You are allowed to use complete domain names,
+simple strings and complete email addresses as well. That means, that you might
+use any of the following notations:
+
+- www.nörgler.com
+- xn--nrgler-wxa
+- xn--brse-5qa.xn--knrz-1ra.info
+
+Errors, incorrectly encoded or invalid strings will lead to either a FALSE
+response (when in strict mode) or to only partially converted strings.
+You can query the occured error by calling the method get_last_error().
+
+Unicode strings are expected to be either UTF-8 strings, UCS-4 strings or UCS-4
+arrays. The default format is UTF-8. For setting different encodings, you can
+call the method setParams() - please see the inline documentation for details.
+ACE strings (the Punycode form) are always 7bit ASCII strings.
+
+ATTENTION: We no longer supply the PHP5 version of the class. It is not
+necessary for achieving a successfull conversion, since the supplied PHP code is
+compatible with both PHP4 and PHP5. We expect to see no compatibility issues
+with the upcoming PHP6, too.
+
+
+Files
+-----
+
+idna_convert.class.php - The actual class
+idna_convert.create.npdata.php - Useful for (re)creating the NPData file
+npdata.ser - Serialized data for NamePrep
+example.php - An example web page for converting
+ReadMe.txt - This file
+LICENCE - The LGPL licence file
+
+The class is contained in idna_convert.class.php.
+MAKE SURE to copy the npdata.ser file into the same folder as the class file
+itself!
+
+
+Examples
+--------
+
+1. Say we wish to encode the domain name nörgler.com:
+
+// Include the class
+include_once('idna_convert.class.php');
+// Instantiate it *
+$IDN = new idna_convert();
+// The input string, if input is not UTF-8 or UCS-4, it must be converted before
+$input = utf8_encode('nörgler.com');
+// Encode it to its punycode presentation
+$output = $IDN->encode($input);
+// Output, what we got now
+echo $output; // This will read: xn--nrgler-wxa.com
+
+
+2. We received an email from a punycoded domain and are willing to learn, how
+ the domain name reads originally
+
+// Include the class
+include_once('idna_convert.class.php');
+// Instantiate it (depending on the version you are using) with
+$IDN = new idna_convert();
+// The input string
+$input = 'andre@xn--brse-5qa.xn--knrz-1ra.info';
+// Encode it to its punycode presentation
+$output = $IDN->decode($input);
+// Output, what we got now, if output should be in a format different to UTF-8
+// or UCS-4, you will have to convert it before outputting it
+echo utf8_decode($output); // This will read: andre@börse.knörz.info
+
+
+3. The input is read from a UCS-4 coded file and encoded line by line. By
+ appending the optional second parameter we tell enode() about the input
+ format to be used
+
+// Include the class
+include_once('idna_convert.class.php');
+// Instantiate it
+$IDN = new dinca_convert();
+// Iterate through the input file line by line
+foreach (file('ucs4-domains.txt') as $line) {
+ echo $IDN->encode(trim($line), 'ucs4_string');
+ echo "\n";
+}
+
+
+NPData
+------
+
+Should you need to recreate the npdata.ser file, which holds all necessary translation
+tables in a serialized format, you can run the file idna_convert.create.npdata.php, which
+creates the file for you and stores it in the same folder, where it is placed.
+Should you need to do changes to the tables you can do so, but beware of the consequences.
+
+
+Contact us
+----------
+
+In case of errors, bugs, questions, wishes, please don't hesitate to contact us
+under the email address above.
+
+The team of phlyLabs
+http://phlylabs.de
+mailto:phlymail@phlylabs.de
\ No newline at end of file
diff --git a/manager/media/rss/vendor/simplepie/simplepie/idn/idna_convert.class.php b/manager/media/rss/vendor/simplepie/simplepie/idn/idna_convert.class.php
new file mode 100644
index 0000000000..1efeef9660
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/idn/idna_convert.class.php
@@ -0,0 +1,969 @@
+
+ * @copyright 2004-2007 phlyLabs Berlin, http://phlylabs.de
+ * @version 0.5.1
+ *
+ */
+class idna_convert
+{
+ /**
+ * Holds all relevant mapping tables, loaded from a seperate file on construct
+ * See RFC3454 for details
+ *
+ * @var array
+ * @access private
+ */
+ var $NP = array();
+
+ // Internal settings, do not mess with them
+ var $_punycode_prefix = 'xn--';
+ var $_invalid_ucs = 0x80000000;
+ var $_max_ucs = 0x10FFFF;
+ var $_base = 36;
+ var $_tmin = 1;
+ var $_tmax = 26;
+ var $_skew = 38;
+ var $_damp = 700;
+ var $_initial_bias = 72;
+ var $_initial_n = 0x80;
+ var $_sbase = 0xAC00;
+ var $_lbase = 0x1100;
+ var $_vbase = 0x1161;
+ var $_tbase = 0x11A7;
+ var $_lcount = 19;
+ var $_vcount = 21;
+ var $_tcount = 28;
+ var $_ncount = 588; // _vcount * _tcount
+ var $_scount = 11172; // _lcount * _tcount * _vcount
+ var $_error = false;
+
+ // See {@link set_paramter()} for details of how to change the following
+ // settings from within your script / application
+ var $_api_encoding = 'utf8'; // Default input charset is UTF-8
+ var $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden
+ var $_strict_mode = false; // Behave strict or not
+
+ // The constructor
+ function __construct($options = false)
+ {
+ $this->slast = $this->_sbase + $this->_lcount * $this->_vcount * $this->_tcount;
+ if (function_exists('file_get_contents')) {
+ $this->NP = unserialize(file_get_contents(dirname(__FILE__).'/npdata.ser'));
+ } else {
+ $this->NP = unserialize(join('', file(dirname(__FILE__).'/npdata.ser')));
+ }
+ // If parameters are given, pass these to the respective method
+ if (is_array($options)) {
+ return $this->set_parameter($options);
+ }
+ return true;
+ }
+
+ /**
+ * Sets a new option value. Available options and values:
+ * [encoding - Use either UTF-8, UCS4 as array or UCS4 as string as input ('utf8' for UTF-8,
+ * 'ucs4_string' and 'ucs4_array' respectively for UCS4); The output is always UTF-8]
+ * [overlong - Unicode does not allow unnecessarily long encodings of chars,
+ * to allow this, set this parameter to true, else to false;
+ * default is false.]
+ * [strict - true: strict mode, good for registration purposes - Causes errors
+ * on failures; false: loose mode, ideal for "wildlife" applications
+ * by silently ignoring errors and returning the original input instead
+ *
+ * @param mixed Parameter to set (string: single parameter; array of Parameter => Value pairs)
+ * @param string Value to use (if parameter 1 is a string)
+ * @return boolean true on success, false otherwise
+ * @access public
+ */
+ function set_parameter($option, $value = false)
+ {
+ if (!is_array($option)) {
+ $option = array($option => $value);
+ }
+ foreach ($option as $k => $v) {
+ switch ($k) {
+ case 'encoding':
+ switch ($v) {
+ case 'utf8':
+ case 'ucs4_string':
+ case 'ucs4_array':
+ $this->_api_encoding = $v;
+ break;
+ default:
+ $this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k);
+ return false;
+ }
+ break;
+ case 'overlong':
+ $this->_allow_overlong = ($v) ? true : false;
+ break;
+ case 'strict':
+ $this->_strict_mode = ($v) ? true : false;
+ break;
+ default:
+ $this->_error('Set Parameter: Unknown option '.$k);
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Decode a given ACE domain name
+ * @param string Domain name (ACE string)
+ * [@param string Desired output encoding, see {@link set_parameter}]
+ * @return string Decoded Domain name (UTF-8 or UCS-4)
+ * @access public
+ */
+ function decode($input, $one_time_encoding = false)
+ {
+ // Optionally set
+ if ($one_time_encoding) {
+ switch ($one_time_encoding) {
+ case 'utf8':
+ case 'ucs4_string':
+ case 'ucs4_array':
+ break;
+ default:
+ $this->_error('Unknown encoding '.$one_time_encoding);
+ return false;
+ }
+ }
+ // Make sure to drop any newline characters around
+ $input = trim($input);
+
+ // Negotiate input and try to determine, whether it is a plain string,
+ // an email address or something like a complete URL
+ if (strpos($input, '@')) { // Maybe it is an email address
+ // No no in strict mode
+ if ($this->_strict_mode) {
+ $this->_error('Only simple domain name parts can be handled in strict mode');
+ return false;
+ }
+ list ($email_pref, $input) = explode('@', $input, 2);
+ $arr = explode('.', $input);
+ foreach ($arr as $k => $v) {
+ if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) {
+ $conv = $this->_decode($v);
+ if ($conv) $arr[$k] = $conv;
+ }
+ }
+ $input = join('.', $arr);
+ $arr = explode('.', $email_pref);
+ foreach ($arr as $k => $v) {
+ if (preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $v)) {
+ $conv = $this->_decode($v);
+ if ($conv) $arr[$k] = $conv;
+ }
+ }
+ $email_pref = join('.', $arr);
+ $return = $email_pref . '@' . $input;
+ } elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters)
+ // No no in strict mode
+ if ($this->_strict_mode) {
+ $this->_error('Only simple domain name parts can be handled in strict mode');
+ return false;
+ }
+ $parsed = parse_url($input);
+ if (isset($parsed['host'])) {
+ $arr = explode('.', $parsed['host']);
+ foreach ($arr as $k => $v) {
+ $conv = $this->_decode($v);
+ if ($conv) $arr[$k] = $conv;
+ }
+ $parsed['host'] = join('.', $arr);
+ $return =
+ (empty($parsed['scheme']) ? '' : $parsed['scheme'].(strtolower($parsed['scheme']) == 'mailto' ? ':' : '://'))
+ .(empty($parsed['user']) ? '' : $parsed['user'].(empty($parsed['pass']) ? '' : ':'.$parsed['pass']).'@')
+ .$parsed['host']
+ .(empty($parsed['port']) ? '' : ':'.$parsed['port'])
+ .(empty($parsed['path']) ? '' : $parsed['path'])
+ .(empty($parsed['query']) ? '' : '?'.$parsed['query'])
+ .(empty($parsed['fragment']) ? '' : '#'.$parsed['fragment']);
+ } else { // parse_url seems to have failed, try without it
+ $arr = explode('.', $input);
+ foreach ($arr as $k => $v) {
+ $conv = $this->_decode($v);
+ $arr[$k] = ($conv) ? $conv : $v;
+ }
+ $return = join('.', $arr);
+ }
+ } else { // Otherwise we consider it being a pure domain name string
+ $return = $this->_decode($input);
+ if (!$return) $return = $input;
+ }
+ // The output is UTF-8 by default, other output formats need conversion here
+ // If one time encoding is given, use this, else the objects property
+ switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) {
+ case 'utf8':
+ return $return;
+ break;
+ case 'ucs4_string':
+ return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return));
+ break;
+ case 'ucs4_array':
+ return $this->_utf8_to_ucs4($return);
+ break;
+ default:
+ $this->_error('Unsupported output format');
+ return false;
+ }
+ }
+
+ /**
+ * Encode a given UTF-8 domain name
+ * @param string Domain name (UTF-8 or UCS-4)
+ * [@param string Desired input encoding, see {@link set_parameter}]
+ * @return string Encoded Domain name (ACE string)
+ * @access public
+ */
+ function encode($decoded, $one_time_encoding = false)
+ {
+ // Forcing conversion of input to UCS4 array
+ // If one time encoding is given, use this, else the objects property
+ switch ($one_time_encoding ? $one_time_encoding : $this->_api_encoding) {
+ case 'utf8':
+ $decoded = $this->_utf8_to_ucs4($decoded);
+ break;
+ case 'ucs4_string':
+ $decoded = $this->_ucs4_string_to_ucs4($decoded);
+ case 'ucs4_array':
+ break;
+ default:
+ $this->_error('Unsupported input format: '.($one_time_encoding ? $one_time_encoding : $this->_api_encoding));
+ return false;
+ }
+
+ // No input, no output, what else did you expect?
+ if (empty($decoded)) return '';
+
+ // Anchors for iteration
+ $last_begin = 0;
+ // Output string
+ $output = '';
+ foreach ($decoded as $k => $v) {
+ // Make sure to use just the plain dot
+ switch($v) {
+ case 0x3002:
+ case 0xFF0E:
+ case 0xFF61:
+ $decoded[$k] = 0x2E;
+ // Right, no break here, the above are converted to dots anyway
+ // Stumbling across an anchoring character
+ case 0x2E:
+ case 0x2F:
+ case 0x3A:
+ case 0x3F:
+ case 0x40:
+ // Neither email addresses nor URLs allowed in strict mode
+ if ($this->_strict_mode) {
+ $this->_error('Neither email addresses nor URLs are allowed in strict mode.');
+ return false;
+ }
+
+ // Skip first char
+ if ($k) {
+ $encoded = '';
+ $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k)-$last_begin)));
+ if ($encoded) {
+ $output .= $encoded;
+ } else {
+ $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k)-$last_begin)));
+ }
+ $output .= chr($decoded[$k]);
+ }
+ $last_begin = $k + 1;
+ }
+ }
+ // Catch the rest of the string
+ if ($last_begin) {
+ $inp_len = sizeof($decoded);
+ $encoded = '';
+ $encoded = $this->_encode(array_slice($decoded, $last_begin, (($inp_len)-$last_begin)));
+ if ($encoded) {
+ $output .= $encoded;
+ } else {
+ $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($inp_len)-$last_begin)));
+ }
+ return $output;
+ }
+
+ if ($output = $this->_encode($decoded)) {
+ return $output;
+ }
+
+ return $this->_ucs4_to_utf8($decoded);
+ }
+
+ /**
+ * Use this method to get the last error ocurred
+ * @param void
+ * @return string The last error, that occured
+ * @access public
+ */
+ function get_last_error()
+ {
+ return $this->_error;
+ }
+
+ /**
+ * The actual decoding algorithm
+ * @access private
+ */
+ function _decode($encoded)
+ {
+ // We do need to find the Punycode prefix
+ if (!preg_match('!^'.preg_quote($this->_punycode_prefix, '!').'!', $encoded)) {
+ $this->_error('This is not a punycode string');
+ return false;
+ }
+ $encode_test = preg_replace('!^'.preg_quote($this->_punycode_prefix, '!').'!', '', $encoded);
+ // If nothing left after removing the prefix, it is hopeless
+ if (!$encode_test) {
+ $this->_error('The given encoded string was empty');
+ return false;
+ }
+ // Find last occurence of the delimiter
+ $delim_pos = strrpos($encoded, '-');
+ if ($delim_pos > strlen($this->_punycode_prefix)) {
+ for ($k = strlen($this->_punycode_prefix); $k < $delim_pos; ++$k) {
+ $decoded[] = ord($encoded[$k]);
+ }
+ } else {
+ $decoded = array();
+ }
+ $deco_len = count($decoded);
+ $enco_len = strlen($encoded);
+
+ // Wandering through the strings; init
+ $is_first = true;
+ $bias = $this->_initial_bias;
+ $idx = 0;
+ $char = $this->_initial_n;
+
+ for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) {
+ for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) {
+ $digit = $this->_decode_digit($encoded[$enco_idx++]);
+ $idx += $digit * $w;
+ $t = ($k <= $bias) ? $this->_tmin :
+ (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias));
+ if ($digit < $t) break;
+ $w = (int) ($w * ($this->_base - $t));
+ }
+ $bias = $this->_adapt($idx - $old_idx, $deco_len + 1, $is_first);
+ $is_first = false;
+ $char += (int) ($idx / ($deco_len + 1));
+ $idx %= ($deco_len + 1);
+ if ($deco_len > 0) {
+ // Make room for the decoded char
+ for ($i = $deco_len; $i > $idx; $i--) {
+ $decoded[$i] = $decoded[($i - 1)];
+ }
+ }
+ $decoded[$idx++] = $char;
+ }
+ return $this->_ucs4_to_utf8($decoded);
+ }
+
+ /**
+ * The actual encoding algorithm
+ * @access private
+ */
+ function _encode($decoded)
+ {
+ // We cannot encode a domain name containing the Punycode prefix
+ $extract = strlen($this->_punycode_prefix);
+ $check_pref = $this->_utf8_to_ucs4($this->_punycode_prefix);
+ $check_deco = array_slice($decoded, 0, $extract);
+
+ if ($check_pref == $check_deco) {
+ $this->_error('This is already a punycode string');
+ return false;
+ }
+ // We will not try to encode strings consisting of basic code points only
+ $encodable = false;
+ foreach ($decoded as $k => $v) {
+ if ($v > 0x7a) {
+ $encodable = true;
+ break;
+ }
+ }
+ if (!$encodable) {
+ $this->_error('The given string does not contain encodable chars');
+ return false;
+ }
+
+ // Do NAMEPREP
+ $decoded = $this->_nameprep($decoded);
+ if (!$decoded || !is_array($decoded)) return false; // NAMEPREP failed
+
+ $deco_len = count($decoded);
+ if (!$deco_len) return false; // Empty array
+
+ $codecount = 0; // How many chars have been consumed
+
+ $encoded = '';
+ // Copy all basic code points to output
+ for ($i = 0; $i < $deco_len; ++$i) {
+ $test = $decoded[$i];
+ // Will match [-0-9a-zA-Z]
+ if ((0x2F < $test && $test < 0x40) || (0x40 < $test && $test < 0x5B)
+ || (0x60 < $test && $test <= 0x7B) || (0x2D == $test)) {
+ $encoded .= chr($decoded[$i]);
+ $codecount++;
+ }
+ }
+ if ($codecount == $deco_len) return $encoded; // All codepoints were basic ones
+
+ // Start with the prefix; copy it to output
+ $encoded = $this->_punycode_prefix.$encoded;
+
+ // If we have basic code points in output, add an hyphen to the end
+ if ($codecount) $encoded .= '-';
+
+ // Now find and encode all non-basic code points
+ $is_first = true;
+ $cur_code = $this->_initial_n;
+ $bias = $this->_initial_bias;
+ $delta = 0;
+ while ($codecount < $deco_len) {
+ // Find the smallest code point >= the current code point and
+ // remember the last ouccrence of it in the input
+ for ($i = 0, $next_code = $this->_max_ucs; $i < $deco_len; $i++) {
+ if ($decoded[$i] >= $cur_code && $decoded[$i] <= $next_code) {
+ $next_code = $decoded[$i];
+ }
+ }
+
+ $delta += ($next_code - $cur_code) * ($codecount + 1);
+ $cur_code = $next_code;
+
+ // Scan input again and encode all characters whose code point is $cur_code
+ for ($i = 0; $i < $deco_len; $i++) {
+ if ($decoded[$i] < $cur_code) {
+ $delta++;
+ } elseif ($decoded[$i] == $cur_code) {
+ for ($q = $delta, $k = $this->_base; 1; $k += $this->_base) {
+ $t = ($k <= $bias) ? $this->_tmin :
+ (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias);
+ if ($q < $t) break;
+ $encoded .= $this->_encode_digit(intval($t + (($q - $t) % ($this->_base - $t)))); //v0.4.5 Changed from ceil() to intval()
+ $q = (int) (($q - $t) / ($this->_base - $t));
+ }
+ $encoded .= $this->_encode_digit($q);
+ $bias = $this->_adapt($delta, $codecount+1, $is_first);
+ $codecount++;
+ $delta = 0;
+ $is_first = false;
+ }
+ }
+ $delta++;
+ $cur_code++;
+ }
+ return $encoded;
+ }
+
+ /**
+ * Adapt the bias according to the current code point and position
+ * @access private
+ */
+ function _adapt($delta, $npoints, $is_first)
+ {
+ $delta = intval($is_first ? ($delta / $this->_damp) : ($delta / 2));
+ $delta += intval($delta / $npoints);
+ for ($k = 0; $delta > (($this->_base - $this->_tmin) * $this->_tmax) / 2; $k += $this->_base) {
+ $delta = intval($delta / ($this->_base - $this->_tmin));
+ }
+ return intval($k + ($this->_base - $this->_tmin + 1) * $delta / ($delta + $this->_skew));
+ }
+
+ /**
+ * Encoding a certain digit
+ * @access private
+ */
+ function _encode_digit($d)
+ {
+ return chr($d + 22 + 75 * ($d < 26));
+ }
+
+ /**
+ * Decode a certain digit
+ * @access private
+ */
+ function _decode_digit($cp)
+ {
+ $cp = ord($cp);
+ return ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $this->_base));
+ }
+
+ /**
+ * Internal error handling method
+ * @access private
+ */
+ function _error($error = '')
+ {
+ $this->_error = $error;
+ }
+
+ /**
+ * Do Nameprep according to RFC3491 and RFC3454
+ * @param array Unicode Characters
+ * @return string Unicode Characters, Nameprep'd
+ * @access private
+ */
+ function _nameprep($input)
+ {
+ $output = array();
+ $error = false;
+ //
+ // Mapping
+ // Walking through the input array, performing the required steps on each of
+ // the input chars and putting the result into the output array
+ // While mapping required chars we apply the cannonical ordering
+ foreach ($input as $v) {
+ // Map to nothing == skip that code point
+ if (in_array($v, $this->NP['map_nothing'])) continue;
+
+ // Try to find prohibited input
+ if (in_array($v, $this->NP['prohibit']) || in_array($v, $this->NP['general_prohibited'])) {
+ $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v));
+ return false;
+ }
+ foreach ($this->NP['prohibit_ranges'] as $range) {
+ if ($range[0] <= $v && $v <= $range[1]) {
+ $this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v));
+ return false;
+ }
+ }
+ //
+ // Hangul syllable decomposition
+ if (0xAC00 <= $v && $v <= 0xD7AF) {
+ foreach ($this->_hangul_decompose($v) as $out) {
+ $output[] = (int) $out;
+ }
+ // There's a decomposition mapping for that code point
+ } elseif (isset($this->NP['replacemaps'][$v])) {
+ foreach ($this->_apply_cannonical_ordering($this->NP['replacemaps'][$v]) as $out) {
+ $output[] = (int) $out;
+ }
+ } else {
+ $output[] = (int) $v;
+ }
+ }
+ // Before applying any Combining, try to rearrange any Hangul syllables
+ $output = $this->_hangul_compose($output);
+ //
+ // Combine code points
+ //
+ $last_class = 0;
+ $last_starter = 0;
+ $out_len = count($output);
+ for ($i = 0; $i < $out_len; ++$i) {
+ $class = $this->_get_combining_class($output[$i]);
+ if ((!$last_class || $last_class > $class) && $class) {
+ // Try to match
+ $seq_len = $i - $last_starter;
+ $out = $this->_combine(array_slice($output, $last_starter, $seq_len));
+ // On match: Replace the last starter with the composed character and remove
+ // the now redundant non-starter(s)
+ if ($out) {
+ $output[$last_starter] = $out;
+ if (count($out) != $seq_len) {
+ for ($j = $i+1; $j < $out_len; ++$j) {
+ $output[$j-1] = $output[$j];
+ }
+ unset($output[$out_len]);
+ }
+ // Rewind the for loop by one, since there can be more possible compositions
+ $i--;
+ $out_len--;
+ $last_class = ($i == $last_starter) ? 0 : $this->_get_combining_class($output[$i-1]);
+ continue;
+ }
+ }
+ // The current class is 0
+ if (!$class) $last_starter = $i;
+ $last_class = $class;
+ }
+ return $output;
+ }
+
+ /**
+ * Decomposes a Hangul syllable
+ * (see http://www.unicode.org/unicode/reports/tr15/#Hangul
+ * @param integer 32bit UCS4 code point
+ * @return array Either Hangul Syllable decomposed or original 32bit value as one value array
+ * @access private
+ */
+ function _hangul_decompose($char)
+ {
+ $sindex = (int) $char - $this->_sbase;
+ if ($sindex < 0 || $sindex >= $this->_scount) {
+ return array($char);
+ }
+ $result = array();
+ $result[] = (int) $this->_lbase + $sindex / $this->_ncount;
+ $result[] = (int) $this->_vbase + ($sindex % $this->_ncount) / $this->_tcount;
+ $T = intval($this->_tbase + $sindex % $this->_tcount);
+ if ($T != $this->_tbase) $result[] = $T;
+ return $result;
+ }
+ /**
+ * Ccomposes a Hangul syllable
+ * (see http://www.unicode.org/unicode/reports/tr15/#Hangul
+ * @param array Decomposed UCS4 sequence
+ * @return array UCS4 sequence with syllables composed
+ * @access private
+ */
+ function _hangul_compose($input)
+ {
+ $inp_len = count($input);
+ if (!$inp_len) return array();
+ $result = array();
+ $last = (int) $input[0];
+ $result[] = $last; // copy first char from input to output
+
+ for ($i = 1; $i < $inp_len; ++$i) {
+ $char = (int) $input[$i];
+ $sindex = $last - $this->_sbase;
+ $lindex = $last - $this->_lbase;
+ $vindex = $char - $this->_vbase;
+ $tindex = $char - $this->_tbase;
+ // Find out, whether two current characters are LV and T
+ if (0 <= $sindex && $sindex < $this->_scount && ($sindex % $this->_tcount == 0)
+ && 0 <= $tindex && $tindex <= $this->_tcount) {
+ // create syllable of form LVT
+ $last += $tindex;
+ $result[(count($result) - 1)] = $last; // reset last
+ continue; // discard char
+ }
+ // Find out, whether two current characters form L and V
+ if (0 <= $lindex && $lindex < $this->_lcount && 0 <= $vindex && $vindex < $this->_vcount) {
+ // create syllable of form LV
+ $last = (int) $this->_sbase + ($lindex * $this->_vcount + $vindex) * $this->_tcount;
+ $result[(count($result) - 1)] = $last; // reset last
+ continue; // discard char
+ }
+ // if neither case was true, just add the character
+ $last = $char;
+ $result[] = $char;
+ }
+ return $result;
+ }
+
+ /**
+ * Returns the combining class of a certain wide char
+ * @param integer Wide char to check (32bit integer)
+ * @return integer Combining class if found, else 0
+ * @access private
+ */
+ function _get_combining_class($char)
+ {
+ return isset($this->NP['norm_combcls'][$char]) ? $this->NP['norm_combcls'][$char] : 0;
+ }
+
+ /**
+ * Apllies the cannonical ordering of a decomposed UCS4 sequence
+ * @param array Decomposed UCS4 sequence
+ * @return array Ordered USC4 sequence
+ * @access private
+ */
+ function _apply_cannonical_ordering($input)
+ {
+ $swap = true;
+ $size = count($input);
+ while ($swap) {
+ $swap = false;
+ $last = $this->_get_combining_class(intval($input[0]));
+ for ($i = 0; $i < $size-1; ++$i) {
+ $next = $this->_get_combining_class(intval($input[$i+1]));
+ if ($next != 0 && $last > $next) {
+ // Move item leftward until it fits
+ for ($j = $i + 1; $j > 0; --$j) {
+ if ($this->_get_combining_class(intval($input[$j-1])) <= $next) break;
+ $t = intval($input[$j]);
+ $input[$j] = intval($input[$j-1]);
+ $input[$j-1] = $t;
+ $swap = true;
+ }
+ // Reentering the loop looking at the old character again
+ $next = $last;
+ }
+ $last = $next;
+ }
+ }
+ return $input;
+ }
+
+ /**
+ * Do composition of a sequence of starter and non-starter
+ * @param array UCS4 Decomposed sequence
+ * @return array Ordered USC4 sequence
+ * @access private
+ */
+ function _combine($input)
+ {
+ $inp_len = count($input);
+ foreach ($this->NP['replacemaps'] as $np_src => $np_target) {
+ if ($np_target[0] != $input[0]) continue;
+ if (count($np_target) != $inp_len) continue;
+ $hit = false;
+ foreach ($input as $k2 => $v2) {
+ if ($v2 == $np_target[$k2]) {
+ $hit = true;
+ } else {
+ $hit = false;
+ break;
+ }
+ }
+ if ($hit) return $np_src;
+ }
+ return false;
+ }
+
+ /**
+ * This converts an UTF-8 encoded string to its UCS-4 representation
+ * By talking about UCS-4 "strings" we mean arrays of 32bit integers representing
+ * each of the "chars". This is due to PHP not being able to handle strings with
+ * bit depth different from 8. This apllies to the reverse method _ucs4_to_utf8(), too.
+ * The following UTF-8 encodings are supported:
+ * bytes bits representation
+ * 1 7 0xxxxxxx
+ * 2 11 110xxxxx 10xxxxxx
+ * 3 16 1110xxxx 10xxxxxx 10xxxxxx
+ * 4 21 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ * 5 26 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+ * 6 31 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+ * Each x represents a bit that can be used to store character data.
+ * The five and six byte sequences are part of Annex D of ISO/IEC 10646-1:2000
+ * @access private
+ */
+ function _utf8_to_ucs4($input)
+ {
+ $output = array();
+ $out_len = 0;
+ $inp_len = strlen($input);
+ $mode = 'next';
+ $test = 'none';
+ for ($k = 0; $k < $inp_len; ++$k) {
+ $v = ord($input[$k]); // Extract byte from input string
+
+ if ($v < 128) { // We found an ASCII char - put into stirng as is
+ $output[$out_len] = $v;
+ ++$out_len;
+ if ('add' == $mode) {
+ $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k);
+ return false;
+ }
+ continue;
+ }
+ if ('next' == $mode) { // Try to find the next start byte; determine the width of the Unicode char
+ $start_byte = $v;
+ $mode = 'add';
+ $test = 'range';
+ if ($v >> 5 == 6) { // &110xxxxx 10xxxxx
+ $next_byte = 0; // Tells, how many times subsequent bitmasks must rotate 6bits to the left
+ $v = ($v - 192) << 6;
+ } elseif ($v >> 4 == 14) { // &1110xxxx 10xxxxxx 10xxxxxx
+ $next_byte = 1;
+ $v = ($v - 224) << 12;
+ } elseif ($v >> 3 == 30) { // &11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ $next_byte = 2;
+ $v = ($v - 240) << 18;
+ } elseif ($v >> 2 == 62) { // &111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+ $next_byte = 3;
+ $v = ($v - 248) << 24;
+ } elseif ($v >> 1 == 126) { // &1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+ $next_byte = 4;
+ $v = ($v - 252) << 30;
+ } else {
+ $this->_error('This might be UTF-8, but I don\'t understand it at byte '.$k);
+ return false;
+ }
+ if ('add' == $mode) {
+ $output[$out_len] = (int) $v;
+ ++$out_len;
+ continue;
+ }
+ }
+ if ('add' == $mode) {
+ if (!$this->_allow_overlong && $test == 'range') {
+ $test = 'none';
+ if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) {
+ $this->_error('Bogus UTF-8 character detected (out of legal range) at byte '.$k);
+ return false;
+ }
+ }
+ if ($v >> 6 == 2) { // Bit mask must be 10xxxxxx
+ $v = ($v - 128) << ($next_byte * 6);
+ $output[($out_len - 1)] += $v;
+ --$next_byte;
+ } else {
+ $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte '.$k);
+ return false;
+ }
+ if ($next_byte < 0) {
+ $mode = 'next';
+ }
+ }
+ } // for
+ return $output;
+ }
+
+ /**
+ * Convert UCS-4 string into UTF-8 string
+ * See _utf8_to_ucs4() for details
+ * @access private
+ */
+ function _ucs4_to_utf8($input)
+ {
+ $output = '';
+ $k = 0;
+ foreach ($input as $v) {
+ ++$k;
+ // $v = ord($v);
+ if ($v < 128) { // 7bit are transferred literally
+ $output .= chr($v);
+ } elseif ($v < (1 << 11)) { // 2 bytes
+ $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63));
+ } elseif ($v < (1 << 16)) { // 3 bytes
+ $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
+ } elseif ($v < (1 << 21)) { // 4 bytes
+ $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63))
+ . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
+ } elseif ($v < (1 << 26)) { // 5 bytes
+ $output .= chr(248 + ($v >> 24)) . chr(128 + (($v >> 18) & 63))
+ . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63))
+ . chr(128 + ($v & 63));
+ } elseif ($v < (1 << 31)) { // 6 bytes
+ $output .= chr(252 + ($v >> 30)) . chr(128 + (($v >> 24) & 63))
+ . chr(128 + (($v >> 18) & 63)) . chr(128 + (($v >> 12) & 63))
+ . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
+ } else {
+ $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k);
+ return false;
+ }
+ }
+ return $output;
+ }
+
+ /**
+ * Convert UCS-4 array into UCS-4 string
+ *
+ * @access private
+ */
+ function _ucs4_to_ucs4_string($input)
+ {
+ $output = '';
+ // Take array values and split output to 4 bytes per value
+ // The bit mask is 255, which reads &11111111
+ foreach ($input as $v) {
+ $output .= chr(($v >> 24) & 255).chr(($v >> 16) & 255).chr(($v >> 8) & 255).chr($v & 255);
+ }
+ return $output;
+ }
+
+ /**
+ * Convert UCS-4 strin into UCS-4 garray
+ *
+ * @access private
+ */
+ function _ucs4_string_to_ucs4($input)
+ {
+ $output = array();
+ $inp_len = strlen($input);
+ // Input length must be dividable by 4
+ if ($inp_len % 4) {
+ $this->_error('Input UCS4 string is broken');
+ return false;
+ }
+ // Empty input - return empty output
+ if (!$inp_len) return $output;
+ for ($i = 0, $out_len = -1; $i < $inp_len; ++$i) {
+ // Increment output position every 4 input bytes
+ if (!($i % 4)) {
+ $out_len++;
+ $output[$out_len] = 0;
+ }
+ $output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) );
+ }
+ return $output;
+ }
+}
+
+/**
+* Adapter class for aligning the API of idna_convert with that of Net_IDNA
+* @author Matthias Sommerfeld
+*/
+class Net_IDNA_php4 extends idna_convert
+{
+ /**
+ * Sets a new option value. Available options and values:
+ * [encoding - Use either UTF-8, UCS4 as array or UCS4 as string as input ('utf8' for UTF-8,
+ * 'ucs4_string' and 'ucs4_array' respectively for UCS4); The output is always UTF-8]
+ * [overlong - Unicode does not allow unnecessarily long encodings of chars,
+ * to allow this, set this parameter to true, else to false;
+ * default is false.]
+ * [strict - true: strict mode, good for registration purposes - Causes errors
+ * on failures; false: loose mode, ideal for "wildlife" applications
+ * by silently ignoring errors and returning the original input instead
+ *
+ * @param mixed Parameter to set (string: single parameter; array of Parameter => Value pairs)
+ * @param string Value to use (if parameter 1 is a string)
+ * @return boolean true on success, false otherwise
+ * @access public
+ */
+ function setParams($option, $param = false)
+ {
+ return $this->IC->set_parameters($option, $param);
+ }
+}
+
+?>
diff --git a/manager/media/rss/vendor/simplepie/simplepie/idn/npdata.ser b/manager/media/rss/vendor/simplepie/simplepie/idn/npdata.ser
new file mode 100644
index 0000000000..d7ce6d03f2
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/idn/npdata.ser
@@ -0,0 +1 @@
+a:6:{s:11:"map_nothing";a:27:{i:0;i:173;i:1;i:847;i:2;i:6150;i:3;i:6155;i:4;i:6156;i:5;i:6157;i:6;i:8203;i:7;i:8204;i:8;i:8205;i:9;i:8288;i:10;i:65024;i:11;i:65025;i:12;i:65026;i:13;i:65027;i:14;i:65028;i:15;i:65029;i:16;i:65030;i:17;i:65031;i:18;i:65032;i:19;i:65033;i:20;i:65034;i:21;i:65035;i:22;i:65036;i:23;i:65037;i:24;i:65038;i:25;i:65039;i:26;i:65279;}s:18:"general_prohibited";a:64:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;i:4;i:5;i:5;i:6;i:6;i:7;i:7;i:8;i:8;i:9;i:9;i:10;i:10;i:11;i:11;i:12;i:12;i:13;i:13;i:14;i:14;i:15;i:15;i:16;i:16;i:17;i:17;i:18;i:18;i:19;i:19;i:20;i:20;i:21;i:21;i:22;i:22;i:23;i:23;i:24;i:24;i:25;i:25;i:26;i:26;i:27;i:27;i:28;i:28;i:29;i:29;i:30;i:30;i:31;i:31;i:32;i:32;i:33;i:33;i:34;i:34;i:35;i:35;i:36;i:36;i:37;i:37;i:38;i:38;i:39;i:39;i:40;i:40;i:41;i:41;i:42;i:42;i:43;i:43;i:44;i:44;i:45;i:47;i:46;i:59;i:47;i:60;i:48;i:61;i:49;i:62;i:50;i:63;i:51;i:64;i:52;i:91;i:53;i:92;i:54;i:93;i:55;i:94;i:56;i:95;i:57;i:96;i:58;i:123;i:59;i:124;i:60;i:125;i:61;i:126;i:62;i:127;i:63;i:12290;}s:8:"prohibit";a:84:{i:0;i:160;i:1;i:5760;i:2;i:8192;i:3;i:8193;i:4;i:8194;i:5;i:8195;i:6;i:8196;i:7;i:8197;i:8;i:8198;i:9;i:8199;i:10;i:8200;i:11;i:8201;i:12;i:8202;i:13;i:8203;i:14;i:8239;i:15;i:8287;i:16;i:12288;i:17;i:1757;i:18;i:1807;i:19;i:6158;i:20;i:8204;i:21;i:8205;i:22;i:8232;i:23;i:8233;i:24;i:65279;i:25;i:65529;i:26;i:65530;i:27;i:65531;i:28;i:65532;i:29;i:65534;i:30;i:65535;i:31;i:131070;i:32;i:131071;i:33;i:196606;i:34;i:196607;i:35;i:262142;i:36;i:262143;i:37;i:327678;i:38;i:327679;i:39;i:393214;i:40;i:393215;i:41;i:458750;i:42;i:458751;i:43;i:524286;i:44;i:524287;i:45;i:589822;i:46;i:589823;i:47;i:655358;i:48;i:655359;i:49;i:720894;i:50;i:720895;i:51;i:786430;i:52;i:786431;i:53;i:851966;i:54;i:851967;i:55;i:917502;i:56;i:917503;i:57;i:983038;i:58;i:983039;i:59;i:1048574;i:60;i:1048575;i:61;i:1114110;i:62;i:1114111;i:63;i:65529;i:64;i:65530;i:65;i:65531;i:66;i:65532;i:67;i:65533;i:68;i:832;i:69;i:833;i:70;i:8206;i:71;i:8207;i:72;i:8234;i:73;i:8235;i:74;i:8236;i:75;i:8237;i:76;i:8238;i:77;i:8298;i:78;i:8299;i:79;i:8300;i:80;i:8301;i:81;i:8302;i:82;i:8303;i:83;i:917505;}s:15:"prohibit_ranges";a:10:{i:0;a:2:{i:0;i:128;i:1;i:159;}i:1;a:2:{i:0;i:8288;i:1;i:8303;}i:2;a:2:{i:0;i:119155;i:1;i:119162;}i:3;a:2:{i:0;i:57344;i:1;i:63743;}i:4;a:2:{i:0;i:983040;i:1;i:1048573;}i:5;a:2:{i:0;i:1048576;i:1;i:1114109;}i:6;a:2:{i:0;i:64976;i:1;i:65007;}i:7;a:2:{i:0;i:55296;i:1;i:57343;}i:8;a:2:{i:0;i:12272;i:1;i:12283;}i:9;a:2:{i:0;i:917536;i:1;i:917631;}}s:11:"replacemaps";a:1401:{i:65;a:1:{i:0;i:97;}i:66;a:1:{i:0;i:98;}i:67;a:1:{i:0;i:99;}i:68;a:1:{i:0;i:100;}i:69;a:1:{i:0;i:101;}i:70;a:1:{i:0;i:102;}i:71;a:1:{i:0;i:103;}i:72;a:1:{i:0;i:104;}i:73;a:1:{i:0;i:105;}i:74;a:1:{i:0;i:106;}i:75;a:1:{i:0;i:107;}i:76;a:1:{i:0;i:108;}i:77;a:1:{i:0;i:109;}i:78;a:1:{i:0;i:110;}i:79;a:1:{i:0;i:111;}i:80;a:1:{i:0;i:112;}i:81;a:1:{i:0;i:113;}i:82;a:1:{i:0;i:114;}i:83;a:1:{i:0;i:115;}i:84;a:1:{i:0;i:116;}i:85;a:1:{i:0;i:117;}i:86;a:1:{i:0;i:118;}i:87;a:1:{i:0;i:119;}i:88;a:1:{i:0;i:120;}i:89;a:1:{i:0;i:121;}i:90;a:1:{i:0;i:122;}i:181;a:1:{i:0;i:956;}i:192;a:1:{i:0;i:224;}i:193;a:1:{i:0;i:225;}i:194;a:1:{i:0;i:226;}i:195;a:1:{i:0;i:227;}i:196;a:1:{i:0;i:228;}i:197;a:1:{i:0;i:229;}i:198;a:1:{i:0;i:230;}i:199;a:1:{i:0;i:231;}i:200;a:1:{i:0;i:232;}i:201;a:1:{i:0;i:233;}i:202;a:1:{i:0;i:234;}i:203;a:1:{i:0;i:235;}i:204;a:1:{i:0;i:236;}i:205;a:1:{i:0;i:237;}i:206;a:1:{i:0;i:238;}i:207;a:1:{i:0;i:239;}i:208;a:1:{i:0;i:240;}i:209;a:1:{i:0;i:241;}i:210;a:1:{i:0;i:242;}i:211;a:1:{i:0;i:243;}i:212;a:1:{i:0;i:244;}i:213;a:1:{i:0;i:245;}i:214;a:1:{i:0;i:246;}i:216;a:1:{i:0;i:248;}i:217;a:1:{i:0;i:249;}i:218;a:1:{i:0;i:250;}i:219;a:1:{i:0;i:251;}i:220;a:1:{i:0;i:252;}i:221;a:1:{i:0;i:253;}i:222;a:1:{i:0;i:254;}i:223;a:2:{i:0;i:115;i:1;i:115;}i:256;a:1:{i:0;i:257;}i:258;a:1:{i:0;i:259;}i:260;a:1:{i:0;i:261;}i:262;a:1:{i:0;i:263;}i:264;a:1:{i:0;i:265;}i:266;a:1:{i:0;i:267;}i:268;a:1:{i:0;i:269;}i:270;a:1:{i:0;i:271;}i:272;a:1:{i:0;i:273;}i:274;a:1:{i:0;i:275;}i:276;a:1:{i:0;i:277;}i:278;a:1:{i:0;i:279;}i:280;a:1:{i:0;i:281;}i:282;a:1:{i:0;i:283;}i:284;a:1:{i:0;i:285;}i:286;a:1:{i:0;i:287;}i:288;a:1:{i:0;i:289;}i:290;a:1:{i:0;i:291;}i:292;a:1:{i:0;i:293;}i:294;a:1:{i:0;i:295;}i:296;a:1:{i:0;i:297;}i:298;a:1:{i:0;i:299;}i:300;a:1:{i:0;i:301;}i:302;a:1:{i:0;i:303;}i:304;a:2:{i:0;i:105;i:1;i:775;}i:306;a:1:{i:0;i:307;}i:308;a:1:{i:0;i:309;}i:310;a:1:{i:0;i:311;}i:313;a:1:{i:0;i:314;}i:315;a:1:{i:0;i:316;}i:317;a:1:{i:0;i:318;}i:319;a:1:{i:0;i:320;}i:321;a:1:{i:0;i:322;}i:323;a:1:{i:0;i:324;}i:325;a:1:{i:0;i:326;}i:327;a:1:{i:0;i:328;}i:329;a:2:{i:0;i:700;i:1;i:110;}i:330;a:1:{i:0;i:331;}i:332;a:1:{i:0;i:333;}i:334;a:1:{i:0;i:335;}i:336;a:1:{i:0;i:337;}i:338;a:1:{i:0;i:339;}i:340;a:1:{i:0;i:341;}i:342;a:1:{i:0;i:343;}i:344;a:1:{i:0;i:345;}i:346;a:1:{i:0;i:347;}i:348;a:1:{i:0;i:349;}i:350;a:1:{i:0;i:351;}i:352;a:1:{i:0;i:353;}i:354;a:1:{i:0;i:355;}i:356;a:1:{i:0;i:357;}i:358;a:1:{i:0;i:359;}i:360;a:1:{i:0;i:361;}i:362;a:1:{i:0;i:363;}i:364;a:1:{i:0;i:365;}i:366;a:1:{i:0;i:367;}i:368;a:1:{i:0;i:369;}i:370;a:1:{i:0;i:371;}i:372;a:1:{i:0;i:373;}i:374;a:1:{i:0;i:375;}i:376;a:1:{i:0;i:255;}i:377;a:1:{i:0;i:378;}i:379;a:1:{i:0;i:380;}i:381;a:1:{i:0;i:382;}i:383;a:1:{i:0;i:115;}i:385;a:1:{i:0;i:595;}i:386;a:1:{i:0;i:387;}i:388;a:1:{i:0;i:389;}i:390;a:1:{i:0;i:596;}i:391;a:1:{i:0;i:392;}i:393;a:1:{i:0;i:598;}i:394;a:1:{i:0;i:599;}i:395;a:1:{i:0;i:396;}i:398;a:1:{i:0;i:477;}i:399;a:1:{i:0;i:601;}i:400;a:1:{i:0;i:603;}i:401;a:1:{i:0;i:402;}i:403;a:1:{i:0;i:608;}i:404;a:1:{i:0;i:611;}i:406;a:1:{i:0;i:617;}i:407;a:1:{i:0;i:616;}i:408;a:1:{i:0;i:409;}i:412;a:1:{i:0;i:623;}i:413;a:1:{i:0;i:626;}i:415;a:1:{i:0;i:629;}i:416;a:1:{i:0;i:417;}i:418;a:1:{i:0;i:419;}i:420;a:1:{i:0;i:421;}i:422;a:1:{i:0;i:640;}i:423;a:1:{i:0;i:424;}i:425;a:1:{i:0;i:643;}i:428;a:1:{i:0;i:429;}i:430;a:1:{i:0;i:648;}i:431;a:1:{i:0;i:432;}i:433;a:1:{i:0;i:650;}i:434;a:1:{i:0;i:651;}i:435;a:1:{i:0;i:436;}i:437;a:1:{i:0;i:438;}i:439;a:1:{i:0;i:658;}i:440;a:1:{i:0;i:441;}i:444;a:1:{i:0;i:445;}i:452;a:1:{i:0;i:454;}i:453;a:1:{i:0;i:454;}i:455;a:1:{i:0;i:457;}i:456;a:1:{i:0;i:457;}i:458;a:1:{i:0;i:460;}i:459;a:1:{i:0;i:460;}i:461;a:1:{i:0;i:462;}i:463;a:1:{i:0;i:464;}i:465;a:1:{i:0;i:466;}i:467;a:1:{i:0;i:468;}i:469;a:1:{i:0;i:470;}i:471;a:1:{i:0;i:472;}i:473;a:1:{i:0;i:474;}i:475;a:1:{i:0;i:476;}i:478;a:1:{i:0;i:479;}i:480;a:1:{i:0;i:481;}i:482;a:1:{i:0;i:483;}i:484;a:1:{i:0;i:485;}i:486;a:1:{i:0;i:487;}i:488;a:1:{i:0;i:489;}i:490;a:1:{i:0;i:491;}i:492;a:1:{i:0;i:493;}i:494;a:1:{i:0;i:495;}i:496;a:2:{i:0;i:106;i:1;i:780;}i:497;a:1:{i:0;i:499;}i:498;a:1:{i:0;i:499;}i:500;a:1:{i:0;i:501;}i:502;a:1:{i:0;i:405;}i:503;a:1:{i:0;i:447;}i:504;a:1:{i:0;i:505;}i:506;a:1:{i:0;i:507;}i:508;a:1:{i:0;i:509;}i:510;a:1:{i:0;i:511;}i:512;a:1:{i:0;i:513;}i:514;a:1:{i:0;i:515;}i:516;a:1:{i:0;i:517;}i:518;a:1:{i:0;i:519;}i:520;a:1:{i:0;i:521;}i:522;a:1:{i:0;i:523;}i:524;a:1:{i:0;i:525;}i:526;a:1:{i:0;i:527;}i:528;a:1:{i:0;i:529;}i:530;a:1:{i:0;i:531;}i:532;a:1:{i:0;i:533;}i:534;a:1:{i:0;i:535;}i:536;a:1:{i:0;i:537;}i:538;a:1:{i:0;i:539;}i:540;a:1:{i:0;i:541;}i:542;a:1:{i:0;i:543;}i:544;a:1:{i:0;i:414;}i:546;a:1:{i:0;i:547;}i:548;a:1:{i:0;i:549;}i:550;a:1:{i:0;i:551;}i:552;a:1:{i:0;i:553;}i:554;a:1:{i:0;i:555;}i:556;a:1:{i:0;i:557;}i:558;a:1:{i:0;i:559;}i:560;a:1:{i:0;i:561;}i:562;a:1:{i:0;i:563;}i:837;a:1:{i:0;i:953;}i:890;a:2:{i:0;i:32;i:1;i:953;}i:902;a:1:{i:0;i:940;}i:904;a:1:{i:0;i:941;}i:905;a:1:{i:0;i:942;}i:906;a:1:{i:0;i:943;}i:908;a:1:{i:0;i:972;}i:910;a:1:{i:0;i:973;}i:911;a:1:{i:0;i:974;}i:912;a:3:{i:0;i:953;i:1;i:776;i:2;i:769;}i:913;a:1:{i:0;i:945;}i:914;a:1:{i:0;i:946;}i:915;a:1:{i:0;i:947;}i:916;a:1:{i:0;i:948;}i:917;a:1:{i:0;i:949;}i:918;a:1:{i:0;i:950;}i:919;a:1:{i:0;i:951;}i:920;a:1:{i:0;i:952;}i:921;a:1:{i:0;i:953;}i:922;a:1:{i:0;i:954;}i:923;a:1:{i:0;i:955;}i:924;a:1:{i:0;i:956;}i:925;a:1:{i:0;i:957;}i:926;a:1:{i:0;i:958;}i:927;a:1:{i:0;i:959;}i:928;a:1:{i:0;i:960;}i:929;a:1:{i:0;i:961;}i:931;a:1:{i:0;i:963;}i:932;a:1:{i:0;i:964;}i:933;a:1:{i:0;i:965;}i:934;a:1:{i:0;i:966;}i:935;a:1:{i:0;i:967;}i:936;a:1:{i:0;i:968;}i:937;a:1:{i:0;i:969;}i:938;a:1:{i:0;i:970;}i:939;a:1:{i:0;i:971;}i:944;a:3:{i:0;i:965;i:1;i:776;i:2;i:769;}i:962;a:1:{i:0;i:963;}i:976;a:1:{i:0;i:946;}i:977;a:1:{i:0;i:952;}i:978;a:1:{i:0;i:965;}i:979;a:1:{i:0;i:973;}i:980;a:1:{i:0;i:971;}i:981;a:1:{i:0;i:966;}i:982;a:1:{i:0;i:960;}i:984;a:1:{i:0;i:985;}i:986;a:1:{i:0;i:987;}i:988;a:1:{i:0;i:989;}i:990;a:1:{i:0;i:991;}i:992;a:1:{i:0;i:993;}i:994;a:1:{i:0;i:995;}i:996;a:1:{i:0;i:997;}i:998;a:1:{i:0;i:999;}i:1000;a:1:{i:0;i:1001;}i:1002;a:1:{i:0;i:1003;}i:1004;a:1:{i:0;i:1005;}i:1006;a:1:{i:0;i:1007;}i:1008;a:1:{i:0;i:954;}i:1009;a:1:{i:0;i:961;}i:1010;a:1:{i:0;i:963;}i:1012;a:1:{i:0;i:952;}i:1013;a:1:{i:0;i:949;}i:1024;a:1:{i:0;i:1104;}i:1025;a:1:{i:0;i:1105;}i:1026;a:1:{i:0;i:1106;}i:1027;a:1:{i:0;i:1107;}i:1028;a:1:{i:0;i:1108;}i:1029;a:1:{i:0;i:1109;}i:1030;a:1:{i:0;i:1110;}i:1031;a:1:{i:0;i:1111;}i:1032;a:1:{i:0;i:1112;}i:1033;a:1:{i:0;i:1113;}i:1034;a:1:{i:0;i:1114;}i:1035;a:1:{i:0;i:1115;}i:1036;a:1:{i:0;i:1116;}i:1037;a:1:{i:0;i:1117;}i:1038;a:1:{i:0;i:1118;}i:1039;a:1:{i:0;i:1119;}i:1040;a:1:{i:0;i:1072;}i:1041;a:1:{i:0;i:1073;}i:1042;a:1:{i:0;i:1074;}i:1043;a:1:{i:0;i:1075;}i:1044;a:1:{i:0;i:1076;}i:1045;a:1:{i:0;i:1077;}i:1046;a:1:{i:0;i:1078;}i:1047;a:1:{i:0;i:1079;}i:1048;a:1:{i:0;i:1080;}i:1049;a:1:{i:0;i:1081;}i:1050;a:1:{i:0;i:1082;}i:1051;a:1:{i:0;i:1083;}i:1052;a:1:{i:0;i:1084;}i:1053;a:1:{i:0;i:1085;}i:1054;a:1:{i:0;i:1086;}i:1055;a:1:{i:0;i:1087;}i:1056;a:1:{i:0;i:1088;}i:1057;a:1:{i:0;i:1089;}i:1058;a:1:{i:0;i:1090;}i:1059;a:1:{i:0;i:1091;}i:1060;a:1:{i:0;i:1092;}i:1061;a:1:{i:0;i:1093;}i:1062;a:1:{i:0;i:1094;}i:1063;a:1:{i:0;i:1095;}i:1064;a:1:{i:0;i:1096;}i:1065;a:1:{i:0;i:1097;}i:1066;a:1:{i:0;i:1098;}i:1067;a:1:{i:0;i:1099;}i:1068;a:1:{i:0;i:1100;}i:1069;a:1:{i:0;i:1101;}i:1070;a:1:{i:0;i:1102;}i:1071;a:1:{i:0;i:1103;}i:1120;a:1:{i:0;i:1121;}i:1122;a:1:{i:0;i:1123;}i:1124;a:1:{i:0;i:1125;}i:1126;a:1:{i:0;i:1127;}i:1128;a:1:{i:0;i:1129;}i:1130;a:1:{i:0;i:1131;}i:1132;a:1:{i:0;i:1133;}i:1134;a:1:{i:0;i:1135;}i:1136;a:1:{i:0;i:1137;}i:1138;a:1:{i:0;i:1139;}i:1140;a:1:{i:0;i:1141;}i:1142;a:1:{i:0;i:1143;}i:1144;a:1:{i:0;i:1145;}i:1146;a:1:{i:0;i:1147;}i:1148;a:1:{i:0;i:1149;}i:1150;a:1:{i:0;i:1151;}i:1152;a:1:{i:0;i:1153;}i:1162;a:1:{i:0;i:1163;}i:1164;a:1:{i:0;i:1165;}i:1166;a:1:{i:0;i:1167;}i:1168;a:1:{i:0;i:1169;}i:1170;a:1:{i:0;i:1171;}i:1172;a:1:{i:0;i:1173;}i:1174;a:1:{i:0;i:1175;}i:1176;a:1:{i:0;i:1177;}i:1178;a:1:{i:0;i:1179;}i:1180;a:1:{i:0;i:1181;}i:1182;a:1:{i:0;i:1183;}i:1184;a:1:{i:0;i:1185;}i:1186;a:1:{i:0;i:1187;}i:1188;a:1:{i:0;i:1189;}i:1190;a:1:{i:0;i:1191;}i:1192;a:1:{i:0;i:1193;}i:1194;a:1:{i:0;i:1195;}i:1196;a:1:{i:0;i:1197;}i:1198;a:1:{i:0;i:1199;}i:1200;a:1:{i:0;i:1201;}i:1202;a:1:{i:0;i:1203;}i:1204;a:1:{i:0;i:1205;}i:1206;a:1:{i:0;i:1207;}i:1208;a:1:{i:0;i:1209;}i:1210;a:1:{i:0;i:1211;}i:1212;a:1:{i:0;i:1213;}i:1214;a:1:{i:0;i:1215;}i:1217;a:1:{i:0;i:1218;}i:1219;a:1:{i:0;i:1220;}i:1221;a:1:{i:0;i:1222;}i:1223;a:1:{i:0;i:1224;}i:1225;a:1:{i:0;i:1226;}i:1227;a:1:{i:0;i:1228;}i:1229;a:1:{i:0;i:1230;}i:1232;a:1:{i:0;i:1233;}i:1234;a:1:{i:0;i:1235;}i:1236;a:1:{i:0;i:1237;}i:1238;a:1:{i:0;i:1239;}i:1240;a:1:{i:0;i:1241;}i:1242;a:1:{i:0;i:1243;}i:1244;a:1:{i:0;i:1245;}i:1246;a:1:{i:0;i:1247;}i:1248;a:1:{i:0;i:1249;}i:1250;a:1:{i:0;i:1251;}i:1252;a:1:{i:0;i:1253;}i:1254;a:1:{i:0;i:1255;}i:1256;a:1:{i:0;i:1257;}i:1258;a:1:{i:0;i:1259;}i:1260;a:1:{i:0;i:1261;}i:1262;a:1:{i:0;i:1263;}i:1264;a:1:{i:0;i:1265;}i:1266;a:1:{i:0;i:1267;}i:1268;a:1:{i:0;i:1269;}i:1272;a:1:{i:0;i:1273;}i:1280;a:1:{i:0;i:1281;}i:1282;a:1:{i:0;i:1283;}i:1284;a:1:{i:0;i:1285;}i:1286;a:1:{i:0;i:1287;}i:1288;a:1:{i:0;i:1289;}i:1290;a:1:{i:0;i:1291;}i:1292;a:1:{i:0;i:1293;}i:1294;a:1:{i:0;i:1295;}i:1329;a:1:{i:0;i:1377;}i:1330;a:1:{i:0;i:1378;}i:1331;a:1:{i:0;i:1379;}i:1332;a:1:{i:0;i:1380;}i:1333;a:1:{i:0;i:1381;}i:1334;a:1:{i:0;i:1382;}i:1335;a:1:{i:0;i:1383;}i:1336;a:1:{i:0;i:1384;}i:1337;a:1:{i:0;i:1385;}i:1338;a:1:{i:0;i:1386;}i:1339;a:1:{i:0;i:1387;}i:1340;a:1:{i:0;i:1388;}i:1341;a:1:{i:0;i:1389;}i:1342;a:1:{i:0;i:1390;}i:1343;a:1:{i:0;i:1391;}i:1344;a:1:{i:0;i:1392;}i:1345;a:1:{i:0;i:1393;}i:1346;a:1:{i:0;i:1394;}i:1347;a:1:{i:0;i:1395;}i:1348;a:1:{i:0;i:1396;}i:1349;a:1:{i:0;i:1397;}i:1350;a:1:{i:0;i:1398;}i:1351;a:1:{i:0;i:1399;}i:1352;a:1:{i:0;i:1400;}i:1353;a:1:{i:0;i:1401;}i:1354;a:1:{i:0;i:1402;}i:1355;a:1:{i:0;i:1403;}i:1356;a:1:{i:0;i:1404;}i:1357;a:1:{i:0;i:1405;}i:1358;a:1:{i:0;i:1406;}i:1359;a:1:{i:0;i:1407;}i:1360;a:1:{i:0;i:1408;}i:1361;a:1:{i:0;i:1409;}i:1362;a:1:{i:0;i:1410;}i:1363;a:1:{i:0;i:1411;}i:1364;a:1:{i:0;i:1412;}i:1365;a:1:{i:0;i:1413;}i:1366;a:1:{i:0;i:1414;}i:1415;a:2:{i:0;i:1381;i:1;i:1410;}i:7680;a:1:{i:0;i:7681;}i:7682;a:1:{i:0;i:7683;}i:7684;a:1:{i:0;i:7685;}i:7686;a:1:{i:0;i:7687;}i:7688;a:1:{i:0;i:7689;}i:7690;a:1:{i:0;i:7691;}i:7692;a:1:{i:0;i:7693;}i:7694;a:1:{i:0;i:7695;}i:7696;a:1:{i:0;i:7697;}i:7698;a:1:{i:0;i:7699;}i:7700;a:1:{i:0;i:7701;}i:7702;a:1:{i:0;i:7703;}i:7704;a:1:{i:0;i:7705;}i:7706;a:1:{i:0;i:7707;}i:7708;a:1:{i:0;i:7709;}i:7710;a:1:{i:0;i:7711;}i:7712;a:1:{i:0;i:7713;}i:7714;a:1:{i:0;i:7715;}i:7716;a:1:{i:0;i:7717;}i:7718;a:1:{i:0;i:7719;}i:7720;a:1:{i:0;i:7721;}i:7722;a:1:{i:0;i:7723;}i:7724;a:1:{i:0;i:7725;}i:7726;a:1:{i:0;i:7727;}i:7728;a:1:{i:0;i:7729;}i:7730;a:1:{i:0;i:7731;}i:7732;a:1:{i:0;i:7733;}i:7734;a:1:{i:0;i:7735;}i:7736;a:1:{i:0;i:7737;}i:7738;a:1:{i:0;i:7739;}i:7740;a:1:{i:0;i:7741;}i:7742;a:1:{i:0;i:7743;}i:7744;a:1:{i:0;i:7745;}i:7746;a:1:{i:0;i:7747;}i:7748;a:1:{i:0;i:7749;}i:7750;a:1:{i:0;i:7751;}i:7752;a:1:{i:0;i:7753;}i:7754;a:1:{i:0;i:7755;}i:7756;a:1:{i:0;i:7757;}i:7758;a:1:{i:0;i:7759;}i:7760;a:1:{i:0;i:7761;}i:7762;a:1:{i:0;i:7763;}i:7764;a:1:{i:0;i:7765;}i:7766;a:1:{i:0;i:7767;}i:7768;a:1:{i:0;i:7769;}i:7770;a:1:{i:0;i:7771;}i:7772;a:1:{i:0;i:7773;}i:7774;a:1:{i:0;i:7775;}i:7776;a:1:{i:0;i:7777;}i:7778;a:1:{i:0;i:7779;}i:7780;a:1:{i:0;i:7781;}i:7782;a:1:{i:0;i:7783;}i:7784;a:1:{i:0;i:7785;}i:7786;a:1:{i:0;i:7787;}i:7788;a:1:{i:0;i:7789;}i:7790;a:1:{i:0;i:7791;}i:7792;a:1:{i:0;i:7793;}i:7794;a:1:{i:0;i:7795;}i:7796;a:1:{i:0;i:7797;}i:7798;a:1:{i:0;i:7799;}i:7800;a:1:{i:0;i:7801;}i:7802;a:1:{i:0;i:7803;}i:7804;a:1:{i:0;i:7805;}i:7806;a:1:{i:0;i:7807;}i:7808;a:1:{i:0;i:7809;}i:7810;a:1:{i:0;i:7811;}i:7812;a:1:{i:0;i:7813;}i:7814;a:1:{i:0;i:7815;}i:7816;a:1:{i:0;i:7817;}i:7818;a:1:{i:0;i:7819;}i:7820;a:1:{i:0;i:7821;}i:7822;a:1:{i:0;i:7823;}i:7824;a:1:{i:0;i:7825;}i:7826;a:1:{i:0;i:7827;}i:7828;a:1:{i:0;i:7829;}i:7830;a:2:{i:0;i:104;i:1;i:817;}i:7831;a:2:{i:0;i:116;i:1;i:776;}i:7832;a:2:{i:0;i:119;i:1;i:778;}i:7833;a:2:{i:0;i:121;i:1;i:778;}i:7834;a:2:{i:0;i:97;i:1;i:702;}i:7835;a:1:{i:0;i:7777;}i:7840;a:1:{i:0;i:7841;}i:7842;a:1:{i:0;i:7843;}i:7844;a:1:{i:0;i:7845;}i:7846;a:1:{i:0;i:7847;}i:7848;a:1:{i:0;i:7849;}i:7850;a:1:{i:0;i:7851;}i:7852;a:1:{i:0;i:7853;}i:7854;a:1:{i:0;i:7855;}i:7856;a:1:{i:0;i:7857;}i:7858;a:1:{i:0;i:7859;}i:7860;a:1:{i:0;i:7861;}i:7862;a:1:{i:0;i:7863;}i:7864;a:1:{i:0;i:7865;}i:7866;a:1:{i:0;i:7867;}i:7868;a:1:{i:0;i:7869;}i:7870;a:1:{i:0;i:7871;}i:7872;a:1:{i:0;i:7873;}i:7874;a:1:{i:0;i:7875;}i:7876;a:1:{i:0;i:7877;}i:7878;a:1:{i:0;i:7879;}i:7880;a:1:{i:0;i:7881;}i:7882;a:1:{i:0;i:7883;}i:7884;a:1:{i:0;i:7885;}i:7886;a:1:{i:0;i:7887;}i:7888;a:1:{i:0;i:7889;}i:7890;a:1:{i:0;i:7891;}i:7892;a:1:{i:0;i:7893;}i:7894;a:1:{i:0;i:7895;}i:7896;a:1:{i:0;i:7897;}i:7898;a:1:{i:0;i:7899;}i:7900;a:1:{i:0;i:7901;}i:7902;a:1:{i:0;i:7903;}i:7904;a:1:{i:0;i:7905;}i:7906;a:1:{i:0;i:7907;}i:7908;a:1:{i:0;i:7909;}i:7910;a:1:{i:0;i:7911;}i:7912;a:1:{i:0;i:7913;}i:7914;a:1:{i:0;i:7915;}i:7916;a:1:{i:0;i:7917;}i:7918;a:1:{i:0;i:7919;}i:7920;a:1:{i:0;i:7921;}i:7922;a:1:{i:0;i:7923;}i:7924;a:1:{i:0;i:7925;}i:7926;a:1:{i:0;i:7927;}i:7928;a:1:{i:0;i:7929;}i:7944;a:1:{i:0;i:7936;}i:7945;a:1:{i:0;i:7937;}i:7946;a:1:{i:0;i:7938;}i:7947;a:1:{i:0;i:7939;}i:7948;a:1:{i:0;i:7940;}i:7949;a:1:{i:0;i:7941;}i:7950;a:1:{i:0;i:7942;}i:7951;a:1:{i:0;i:7943;}i:7960;a:1:{i:0;i:7952;}i:7961;a:1:{i:0;i:7953;}i:7962;a:1:{i:0;i:7954;}i:7963;a:1:{i:0;i:7955;}i:7964;a:1:{i:0;i:7956;}i:7965;a:1:{i:0;i:7957;}i:7976;a:1:{i:0;i:7968;}i:7977;a:1:{i:0;i:7969;}i:7978;a:1:{i:0;i:7970;}i:7979;a:1:{i:0;i:7971;}i:7980;a:1:{i:0;i:7972;}i:7981;a:1:{i:0;i:7973;}i:7982;a:1:{i:0;i:7974;}i:7983;a:1:{i:0;i:7975;}i:7992;a:1:{i:0;i:7984;}i:7993;a:1:{i:0;i:7985;}i:7994;a:1:{i:0;i:7986;}i:7995;a:1:{i:0;i:7987;}i:7996;a:1:{i:0;i:7988;}i:7997;a:1:{i:0;i:7989;}i:7998;a:1:{i:0;i:7990;}i:7999;a:1:{i:0;i:7991;}i:8008;a:1:{i:0;i:8000;}i:8009;a:1:{i:0;i:8001;}i:8010;a:1:{i:0;i:8002;}i:8011;a:1:{i:0;i:8003;}i:8012;a:1:{i:0;i:8004;}i:8013;a:1:{i:0;i:8005;}i:8016;a:2:{i:0;i:965;i:1;i:787;}i:8018;a:3:{i:0;i:965;i:1;i:787;i:2;i:768;}i:8020;a:3:{i:0;i:965;i:1;i:787;i:2;i:769;}i:8022;a:3:{i:0;i:965;i:1;i:787;i:2;i:834;}i:8025;a:1:{i:0;i:8017;}i:8027;a:1:{i:0;i:8019;}i:8029;a:1:{i:0;i:8021;}i:8031;a:1:{i:0;i:8023;}i:8040;a:1:{i:0;i:8032;}i:8041;a:1:{i:0;i:8033;}i:8042;a:1:{i:0;i:8034;}i:8043;a:1:{i:0;i:8035;}i:8044;a:1:{i:0;i:8036;}i:8045;a:1:{i:0;i:8037;}i:8046;a:1:{i:0;i:8038;}i:8047;a:1:{i:0;i:8039;}i:8064;a:2:{i:0;i:7936;i:1;i:953;}i:8065;a:2:{i:0;i:7937;i:1;i:953;}i:8066;a:2:{i:0;i:7938;i:1;i:953;}i:8067;a:2:{i:0;i:7939;i:1;i:953;}i:8068;a:2:{i:0;i:7940;i:1;i:953;}i:8069;a:2:{i:0;i:7941;i:1;i:953;}i:8070;a:2:{i:0;i:7942;i:1;i:953;}i:8071;a:2:{i:0;i:7943;i:1;i:953;}i:8072;a:2:{i:0;i:7936;i:1;i:953;}i:8073;a:2:{i:0;i:7937;i:1;i:953;}i:8074;a:2:{i:0;i:7938;i:1;i:953;}i:8075;a:2:{i:0;i:7939;i:1;i:953;}i:8076;a:2:{i:0;i:7940;i:1;i:953;}i:8077;a:2:{i:0;i:7941;i:1;i:953;}i:8078;a:2:{i:0;i:7942;i:1;i:953;}i:8079;a:2:{i:0;i:7943;i:1;i:953;}i:8080;a:2:{i:0;i:7968;i:1;i:953;}i:8081;a:2:{i:0;i:7969;i:1;i:953;}i:8082;a:2:{i:0;i:7970;i:1;i:953;}i:8083;a:2:{i:0;i:7971;i:1;i:953;}i:8084;a:2:{i:0;i:7972;i:1;i:953;}i:8085;a:2:{i:0;i:7973;i:1;i:953;}i:8086;a:2:{i:0;i:7974;i:1;i:953;}i:8087;a:2:{i:0;i:7975;i:1;i:953;}i:8088;a:2:{i:0;i:7968;i:1;i:953;}i:8089;a:2:{i:0;i:7969;i:1;i:953;}i:8090;a:2:{i:0;i:7970;i:1;i:953;}i:8091;a:2:{i:0;i:7971;i:1;i:953;}i:8092;a:2:{i:0;i:7972;i:1;i:953;}i:8093;a:2:{i:0;i:7973;i:1;i:953;}i:8094;a:2:{i:0;i:7974;i:1;i:953;}i:8095;a:2:{i:0;i:7975;i:1;i:953;}i:8096;a:2:{i:0;i:8032;i:1;i:953;}i:8097;a:2:{i:0;i:8033;i:1;i:953;}i:8098;a:2:{i:0;i:8034;i:1;i:953;}i:8099;a:2:{i:0;i:8035;i:1;i:953;}i:8100;a:2:{i:0;i:8036;i:1;i:953;}i:8101;a:2:{i:0;i:8037;i:1;i:953;}i:8102;a:2:{i:0;i:8038;i:1;i:953;}i:8103;a:2:{i:0;i:8039;i:1;i:953;}i:8104;a:2:{i:0;i:8032;i:1;i:953;}i:8105;a:2:{i:0;i:8033;i:1;i:953;}i:8106;a:2:{i:0;i:8034;i:1;i:953;}i:8107;a:2:{i:0;i:8035;i:1;i:953;}i:8108;a:2:{i:0;i:8036;i:1;i:953;}i:8109;a:2:{i:0;i:8037;i:1;i:953;}i:8110;a:2:{i:0;i:8038;i:1;i:953;}i:8111;a:2:{i:0;i:8039;i:1;i:953;}i:8114;a:2:{i:0;i:8048;i:1;i:953;}i:8115;a:2:{i:0;i:945;i:1;i:953;}i:8116;a:2:{i:0;i:940;i:1;i:953;}i:8118;a:2:{i:0;i:945;i:1;i:834;}i:8119;a:3:{i:0;i:945;i:1;i:834;i:2;i:953;}i:8120;a:1:{i:0;i:8112;}i:8121;a:1:{i:0;i:8113;}i:8122;a:1:{i:0;i:8048;}i:8123;a:1:{i:0;i:8049;}i:8124;a:2:{i:0;i:945;i:1;i:953;}i:8126;a:1:{i:0;i:953;}i:8130;a:2:{i:0;i:8052;i:1;i:953;}i:8131;a:2:{i:0;i:951;i:1;i:953;}i:8132;a:2:{i:0;i:942;i:1;i:953;}i:8134;a:2:{i:0;i:951;i:1;i:834;}i:8135;a:3:{i:0;i:951;i:1;i:834;i:2;i:953;}i:8136;a:1:{i:0;i:8050;}i:8137;a:1:{i:0;i:8051;}i:8138;a:1:{i:0;i:8052;}i:8139;a:1:{i:0;i:8053;}i:8140;a:2:{i:0;i:951;i:1;i:953;}i:8146;a:3:{i:0;i:953;i:1;i:776;i:2;i:768;}i:8147;a:3:{i:0;i:953;i:1;i:776;i:2;i:769;}i:8150;a:2:{i:0;i:953;i:1;i:834;}i:8151;a:3:{i:0;i:953;i:1;i:776;i:2;i:834;}i:8152;a:1:{i:0;i:8144;}i:8153;a:1:{i:0;i:8145;}i:8154;a:1:{i:0;i:8054;}i:8155;a:1:{i:0;i:8055;}i:8162;a:3:{i:0;i:965;i:1;i:776;i:2;i:768;}i:8163;a:3:{i:0;i:965;i:1;i:776;i:2;i:769;}i:8164;a:2:{i:0;i:961;i:1;i:787;}i:8166;a:2:{i:0;i:965;i:1;i:834;}i:8167;a:3:{i:0;i:965;i:1;i:776;i:2;i:834;}i:8168;a:1:{i:0;i:8160;}i:8169;a:1:{i:0;i:8161;}i:8170;a:1:{i:0;i:8058;}i:8171;a:1:{i:0;i:8059;}i:8172;a:1:{i:0;i:8165;}i:8178;a:2:{i:0;i:8060;i:1;i:953;}i:8179;a:2:{i:0;i:969;i:1;i:953;}i:8180;a:2:{i:0;i:974;i:1;i:953;}i:8182;a:2:{i:0;i:969;i:1;i:834;}i:8183;a:3:{i:0;i:969;i:1;i:834;i:2;i:953;}i:8184;a:1:{i:0;i:8056;}i:8185;a:1:{i:0;i:8057;}i:8186;a:1:{i:0;i:8060;}i:8187;a:1:{i:0;i:8061;}i:8188;a:2:{i:0;i:969;i:1;i:953;}i:8360;a:2:{i:0;i:114;i:1;i:115;}i:8450;a:1:{i:0;i:99;}i:8451;a:2:{i:0;i:176;i:1;i:99;}i:8455;a:1:{i:0;i:603;}i:8457;a:2:{i:0;i:176;i:1;i:102;}i:8459;a:1:{i:0;i:104;}i:8460;a:1:{i:0;i:104;}i:8461;a:1:{i:0;i:104;}i:8464;a:1:{i:0;i:105;}i:8465;a:1:{i:0;i:105;}i:8466;a:1:{i:0;i:108;}i:8469;a:1:{i:0;i:110;}i:8470;a:2:{i:0;i:110;i:1;i:111;}i:8473;a:1:{i:0;i:112;}i:8474;a:1:{i:0;i:113;}i:8475;a:1:{i:0;i:114;}i:8476;a:1:{i:0;i:114;}i:8477;a:1:{i:0;i:114;}i:8480;a:2:{i:0;i:115;i:1;i:109;}i:8481;a:3:{i:0;i:116;i:1;i:101;i:2;i:108;}i:8482;a:2:{i:0;i:116;i:1;i:109;}i:8484;a:1:{i:0;i:122;}i:8486;a:1:{i:0;i:969;}i:8488;a:1:{i:0;i:122;}i:8490;a:1:{i:0;i:107;}i:8491;a:1:{i:0;i:229;}i:8492;a:1:{i:0;i:98;}i:8493;a:1:{i:0;i:99;}i:8496;a:1:{i:0;i:101;}i:8497;a:1:{i:0;i:102;}i:8499;a:1:{i:0;i:109;}i:8510;a:1:{i:0;i:947;}i:8511;a:1:{i:0;i:960;}i:8517;a:1:{i:0;i:100;}i:8544;a:1:{i:0;i:8560;}i:8545;a:1:{i:0;i:8561;}i:8546;a:1:{i:0;i:8562;}i:8547;a:1:{i:0;i:8563;}i:8548;a:1:{i:0;i:8564;}i:8549;a:1:{i:0;i:8565;}i:8550;a:1:{i:0;i:8566;}i:8551;a:1:{i:0;i:8567;}i:8552;a:1:{i:0;i:8568;}i:8553;a:1:{i:0;i:8569;}i:8554;a:1:{i:0;i:8570;}i:8555;a:1:{i:0;i:8571;}i:8556;a:1:{i:0;i:8572;}i:8557;a:1:{i:0;i:8573;}i:8558;a:1:{i:0;i:8574;}i:8559;a:1:{i:0;i:8575;}i:9398;a:1:{i:0;i:9424;}i:9399;a:1:{i:0;i:9425;}i:9400;a:1:{i:0;i:9426;}i:9401;a:1:{i:0;i:9427;}i:9402;a:1:{i:0;i:9428;}i:9403;a:1:{i:0;i:9429;}i:9404;a:1:{i:0;i:9430;}i:9405;a:1:{i:0;i:9431;}i:9406;a:1:{i:0;i:9432;}i:9407;a:1:{i:0;i:9433;}i:9408;a:1:{i:0;i:9434;}i:9409;a:1:{i:0;i:9435;}i:9410;a:1:{i:0;i:9436;}i:9411;a:1:{i:0;i:9437;}i:9412;a:1:{i:0;i:9438;}i:9413;a:1:{i:0;i:9439;}i:9414;a:1:{i:0;i:9440;}i:9415;a:1:{i:0;i:9441;}i:9416;a:1:{i:0;i:9442;}i:9417;a:1:{i:0;i:9443;}i:9418;a:1:{i:0;i:9444;}i:9419;a:1:{i:0;i:9445;}i:9420;a:1:{i:0;i:9446;}i:9421;a:1:{i:0;i:9447;}i:9422;a:1:{i:0;i:9448;}i:9423;a:1:{i:0;i:9449;}i:13169;a:3:{i:0;i:104;i:1;i:112;i:2;i:97;}i:13171;a:2:{i:0;i:97;i:1;i:117;}i:13173;a:2:{i:0;i:111;i:1;i:118;}i:13184;a:2:{i:0;i:112;i:1;i:97;}i:13185;a:2:{i:0;i:110;i:1;i:97;}i:13186;a:2:{i:0;i:956;i:1;i:97;}i:13187;a:2:{i:0;i:109;i:1;i:97;}i:13188;a:2:{i:0;i:107;i:1;i:97;}i:13189;a:2:{i:0;i:107;i:1;i:98;}i:13190;a:2:{i:0;i:109;i:1;i:98;}i:13191;a:2:{i:0;i:103;i:1;i:98;}i:13194;a:2:{i:0;i:112;i:1;i:102;}i:13195;a:2:{i:0;i:110;i:1;i:102;}i:13196;a:2:{i:0;i:956;i:1;i:102;}i:13200;a:2:{i:0;i:104;i:1;i:122;}i:13201;a:3:{i:0;i:107;i:1;i:104;i:2;i:122;}i:13202;a:3:{i:0;i:109;i:1;i:104;i:2;i:122;}i:13203;a:3:{i:0;i:103;i:1;i:104;i:2;i:122;}i:13204;a:3:{i:0;i:116;i:1;i:104;i:2;i:122;}i:13225;a:2:{i:0;i:112;i:1;i:97;}i:13226;a:3:{i:0;i:107;i:1;i:112;i:2;i:97;}i:13227;a:3:{i:0;i:109;i:1;i:112;i:2;i:97;}i:13228;a:3:{i:0;i:103;i:1;i:112;i:2;i:97;}i:13236;a:2:{i:0;i:112;i:1;i:118;}i:13237;a:2:{i:0;i:110;i:1;i:118;}i:13238;a:2:{i:0;i:956;i:1;i:118;}i:13239;a:2:{i:0;i:109;i:1;i:118;}i:13240;a:2:{i:0;i:107;i:1;i:118;}i:13241;a:2:{i:0;i:109;i:1;i:118;}i:13242;a:2:{i:0;i:112;i:1;i:119;}i:13243;a:2:{i:0;i:110;i:1;i:119;}i:13244;a:2:{i:0;i:956;i:1;i:119;}i:13245;a:2:{i:0;i:109;i:1;i:119;}i:13246;a:2:{i:0;i:107;i:1;i:119;}i:13247;a:2:{i:0;i:109;i:1;i:119;}i:13248;a:2:{i:0;i:107;i:1;i:969;}i:13249;a:2:{i:0;i:109;i:1;i:969;}i:13251;a:2:{i:0;i:98;i:1;i:113;}i:13254;a:4:{i:0;i:99;i:1;i:8725;i:2;i:107;i:3;i:103;}i:13255;a:3:{i:0;i:99;i:1;i:111;i:2;i:46;}i:13256;a:2:{i:0;i:100;i:1;i:98;}i:13257;a:2:{i:0;i:103;i:1;i:121;}i:13259;a:2:{i:0;i:104;i:1;i:112;}i:13261;a:2:{i:0;i:107;i:1;i:107;}i:13262;a:2:{i:0;i:107;i:1;i:109;}i:13271;a:2:{i:0;i:112;i:1;i:104;}i:13273;a:3:{i:0;i:112;i:1;i:112;i:2;i:109;}i:13274;a:2:{i:0;i:112;i:1;i:114;}i:13276;a:2:{i:0;i:115;i:1;i:118;}i:13277;a:2:{i:0;i:119;i:1;i:98;}i:64256;a:2:{i:0;i:102;i:1;i:102;}i:64257;a:2:{i:0;i:102;i:1;i:105;}i:64258;a:2:{i:0;i:102;i:1;i:108;}i:64259;a:3:{i:0;i:102;i:1;i:102;i:2;i:105;}i:64260;a:3:{i:0;i:102;i:1;i:102;i:2;i:108;}i:64261;a:2:{i:0;i:115;i:1;i:116;}i:64262;a:2:{i:0;i:115;i:1;i:116;}i:64275;a:2:{i:0;i:1396;i:1;i:1398;}i:64276;a:2:{i:0;i:1396;i:1;i:1381;}i:64277;a:2:{i:0;i:1396;i:1;i:1387;}i:64278;a:2:{i:0;i:1406;i:1;i:1398;}i:64279;a:2:{i:0;i:1396;i:1;i:1389;}i:65313;a:1:{i:0;i:65345;}i:65314;a:1:{i:0;i:65346;}i:65315;a:1:{i:0;i:65347;}i:65316;a:1:{i:0;i:65348;}i:65317;a:1:{i:0;i:65349;}i:65318;a:1:{i:0;i:65350;}i:65319;a:1:{i:0;i:65351;}i:65320;a:1:{i:0;i:65352;}i:65321;a:1:{i:0;i:65353;}i:65322;a:1:{i:0;i:65354;}i:65323;a:1:{i:0;i:65355;}i:65324;a:1:{i:0;i:65356;}i:65325;a:1:{i:0;i:65357;}i:65326;a:1:{i:0;i:65358;}i:65327;a:1:{i:0;i:65359;}i:65328;a:1:{i:0;i:65360;}i:65329;a:1:{i:0;i:65361;}i:65330;a:1:{i:0;i:65362;}i:65331;a:1:{i:0;i:65363;}i:65332;a:1:{i:0;i:65364;}i:65333;a:1:{i:0;i:65365;}i:65334;a:1:{i:0;i:65366;}i:65335;a:1:{i:0;i:65367;}i:65336;a:1:{i:0;i:65368;}i:65337;a:1:{i:0;i:65369;}i:65338;a:1:{i:0;i:65370;}i:66560;a:1:{i:0;i:66600;}i:66561;a:1:{i:0;i:66601;}i:66562;a:1:{i:0;i:66602;}i:66563;a:1:{i:0;i:66603;}i:66564;a:1:{i:0;i:66604;}i:66565;a:1:{i:0;i:66605;}i:66566;a:1:{i:0;i:66606;}i:66567;a:1:{i:0;i:66607;}i:66568;a:1:{i:0;i:66608;}i:66569;a:1:{i:0;i:66609;}i:66570;a:1:{i:0;i:66610;}i:66571;a:1:{i:0;i:66611;}i:66572;a:1:{i:0;i:66612;}i:66573;a:1:{i:0;i:66613;}i:66574;a:1:{i:0;i:66614;}i:66575;a:1:{i:0;i:66615;}i:66576;a:1:{i:0;i:66616;}i:66577;a:1:{i:0;i:66617;}i:66578;a:1:{i:0;i:66618;}i:66579;a:1:{i:0;i:66619;}i:66580;a:1:{i:0;i:66620;}i:66581;a:1:{i:0;i:66621;}i:66582;a:1:{i:0;i:66622;}i:66583;a:1:{i:0;i:66623;}i:66584;a:1:{i:0;i:66624;}i:66585;a:1:{i:0;i:66625;}i:66586;a:1:{i:0;i:66626;}i:66587;a:1:{i:0;i:66627;}i:66588;a:1:{i:0;i:66628;}i:66589;a:1:{i:0;i:66629;}i:66590;a:1:{i:0;i:66630;}i:66591;a:1:{i:0;i:66631;}i:66592;a:1:{i:0;i:66632;}i:66593;a:1:{i:0;i:66633;}i:66594;a:1:{i:0;i:66634;}i:66595;a:1:{i:0;i:66635;}i:66596;a:1:{i:0;i:66636;}i:66597;a:1:{i:0;i:66637;}i:119808;a:1:{i:0;i:97;}i:119809;a:1:{i:0;i:98;}i:119810;a:1:{i:0;i:99;}i:119811;a:1:{i:0;i:100;}i:119812;a:1:{i:0;i:101;}i:119813;a:1:{i:0;i:102;}i:119814;a:1:{i:0;i:103;}i:119815;a:1:{i:0;i:104;}i:119816;a:1:{i:0;i:105;}i:119817;a:1:{i:0;i:106;}i:119818;a:1:{i:0;i:107;}i:119819;a:1:{i:0;i:108;}i:119820;a:1:{i:0;i:109;}i:119821;a:1:{i:0;i:110;}i:119822;a:1:{i:0;i:111;}i:119823;a:1:{i:0;i:112;}i:119824;a:1:{i:0;i:113;}i:119825;a:1:{i:0;i:114;}i:119826;a:1:{i:0;i:115;}i:119827;a:1:{i:0;i:116;}i:119828;a:1:{i:0;i:117;}i:119829;a:1:{i:0;i:118;}i:119830;a:1:{i:0;i:119;}i:119831;a:1:{i:0;i:120;}i:119832;a:1:{i:0;i:121;}i:119833;a:1:{i:0;i:122;}i:119860;a:1:{i:0;i:97;}i:119861;a:1:{i:0;i:98;}i:119862;a:1:{i:0;i:99;}i:119863;a:1:{i:0;i:100;}i:119864;a:1:{i:0;i:101;}i:119865;a:1:{i:0;i:102;}i:119866;a:1:{i:0;i:103;}i:119867;a:1:{i:0;i:104;}i:119868;a:1:{i:0;i:105;}i:119869;a:1:{i:0;i:106;}i:119870;a:1:{i:0;i:107;}i:119871;a:1:{i:0;i:108;}i:119872;a:1:{i:0;i:109;}i:119873;a:1:{i:0;i:110;}i:119874;a:1:{i:0;i:111;}i:119875;a:1:{i:0;i:112;}i:119876;a:1:{i:0;i:113;}i:119877;a:1:{i:0;i:114;}i:119878;a:1:{i:0;i:115;}i:119879;a:1:{i:0;i:116;}i:119880;a:1:{i:0;i:117;}i:119881;a:1:{i:0;i:118;}i:119882;a:1:{i:0;i:119;}i:119883;a:1:{i:0;i:120;}i:119884;a:1:{i:0;i:121;}i:119885;a:1:{i:0;i:122;}i:119912;a:1:{i:0;i:97;}i:119913;a:1:{i:0;i:98;}i:119914;a:1:{i:0;i:99;}i:119915;a:1:{i:0;i:100;}i:119916;a:1:{i:0;i:101;}i:119917;a:1:{i:0;i:102;}i:119918;a:1:{i:0;i:103;}i:119919;a:1:{i:0;i:104;}i:119920;a:1:{i:0;i:105;}i:119921;a:1:{i:0;i:106;}i:119922;a:1:{i:0;i:107;}i:119923;a:1:{i:0;i:108;}i:119924;a:1:{i:0;i:109;}i:119925;a:1:{i:0;i:110;}i:119926;a:1:{i:0;i:111;}i:119927;a:1:{i:0;i:112;}i:119928;a:1:{i:0;i:113;}i:119929;a:1:{i:0;i:114;}i:119930;a:1:{i:0;i:115;}i:119931;a:1:{i:0;i:116;}i:119932;a:1:{i:0;i:117;}i:119933;a:1:{i:0;i:118;}i:119934;a:1:{i:0;i:119;}i:119935;a:1:{i:0;i:120;}i:119936;a:1:{i:0;i:121;}i:119937;a:1:{i:0;i:122;}i:119964;a:1:{i:0;i:97;}i:119966;a:1:{i:0;i:99;}i:119967;a:1:{i:0;i:100;}i:119970;a:1:{i:0;i:103;}i:119973;a:1:{i:0;i:106;}i:119974;a:1:{i:0;i:107;}i:119977;a:1:{i:0;i:110;}i:119978;a:1:{i:0;i:111;}i:119979;a:1:{i:0;i:112;}i:119980;a:1:{i:0;i:113;}i:119982;a:1:{i:0;i:115;}i:119983;a:1:{i:0;i:116;}i:119984;a:1:{i:0;i:117;}i:119985;a:1:{i:0;i:118;}i:119986;a:1:{i:0;i:119;}i:119987;a:1:{i:0;i:120;}i:119988;a:1:{i:0;i:121;}i:119989;a:1:{i:0;i:122;}i:120016;a:1:{i:0;i:97;}i:120017;a:1:{i:0;i:98;}i:120018;a:1:{i:0;i:99;}i:120019;a:1:{i:0;i:100;}i:120020;a:1:{i:0;i:101;}i:120021;a:1:{i:0;i:102;}i:120022;a:1:{i:0;i:103;}i:120023;a:1:{i:0;i:104;}i:120024;a:1:{i:0;i:105;}i:120025;a:1:{i:0;i:106;}i:120026;a:1:{i:0;i:107;}i:120027;a:1:{i:0;i:108;}i:120028;a:1:{i:0;i:109;}i:120029;a:1:{i:0;i:110;}i:120030;a:1:{i:0;i:111;}i:120031;a:1:{i:0;i:112;}i:120032;a:1:{i:0;i:113;}i:120033;a:1:{i:0;i:114;}i:120034;a:1:{i:0;i:115;}i:120035;a:1:{i:0;i:116;}i:120036;a:1:{i:0;i:117;}i:120037;a:1:{i:0;i:118;}i:120038;a:1:{i:0;i:119;}i:120039;a:1:{i:0;i:120;}i:120040;a:1:{i:0;i:121;}i:120041;a:1:{i:0;i:122;}i:120068;a:1:{i:0;i:97;}i:120069;a:1:{i:0;i:98;}i:120071;a:1:{i:0;i:100;}i:120072;a:1:{i:0;i:101;}i:120073;a:1:{i:0;i:102;}i:120074;a:1:{i:0;i:103;}i:120077;a:1:{i:0;i:106;}i:120078;a:1:{i:0;i:107;}i:120079;a:1:{i:0;i:108;}i:120080;a:1:{i:0;i:109;}i:120081;a:1:{i:0;i:110;}i:120082;a:1:{i:0;i:111;}i:120083;a:1:{i:0;i:112;}i:120084;a:1:{i:0;i:113;}i:120086;a:1:{i:0;i:115;}i:120087;a:1:{i:0;i:116;}i:120088;a:1:{i:0;i:117;}i:120089;a:1:{i:0;i:118;}i:120090;a:1:{i:0;i:119;}i:120091;a:1:{i:0;i:120;}i:120092;a:1:{i:0;i:121;}i:120120;a:1:{i:0;i:97;}i:120121;a:1:{i:0;i:98;}i:120123;a:1:{i:0;i:100;}i:120124;a:1:{i:0;i:101;}i:120125;a:1:{i:0;i:102;}i:120126;a:1:{i:0;i:103;}i:120128;a:1:{i:0;i:105;}i:120129;a:1:{i:0;i:106;}i:120130;a:1:{i:0;i:107;}i:120131;a:1:{i:0;i:108;}i:120132;a:1:{i:0;i:109;}i:120134;a:1:{i:0;i:111;}i:120138;a:1:{i:0;i:115;}i:120139;a:1:{i:0;i:116;}i:120140;a:1:{i:0;i:117;}i:120141;a:1:{i:0;i:118;}i:120142;a:1:{i:0;i:119;}i:120143;a:1:{i:0;i:120;}i:120144;a:1:{i:0;i:121;}i:120172;a:1:{i:0;i:97;}i:120173;a:1:{i:0;i:98;}i:120174;a:1:{i:0;i:99;}i:120175;a:1:{i:0;i:100;}i:120176;a:1:{i:0;i:101;}i:120177;a:1:{i:0;i:102;}i:120178;a:1:{i:0;i:103;}i:120179;a:1:{i:0;i:104;}i:120180;a:1:{i:0;i:105;}i:120181;a:1:{i:0;i:106;}i:120182;a:1:{i:0;i:107;}i:120183;a:1:{i:0;i:108;}i:120184;a:1:{i:0;i:109;}i:120185;a:1:{i:0;i:110;}i:120186;a:1:{i:0;i:111;}i:120187;a:1:{i:0;i:112;}i:120188;a:1:{i:0;i:113;}i:120189;a:1:{i:0;i:114;}i:120190;a:1:{i:0;i:115;}i:120191;a:1:{i:0;i:116;}i:120192;a:1:{i:0;i:117;}i:120193;a:1:{i:0;i:118;}i:120194;a:1:{i:0;i:119;}i:120195;a:1:{i:0;i:120;}i:120196;a:1:{i:0;i:121;}i:120197;a:1:{i:0;i:122;}i:120224;a:1:{i:0;i:97;}i:120225;a:1:{i:0;i:98;}i:120226;a:1:{i:0;i:99;}i:120227;a:1:{i:0;i:100;}i:120228;a:1:{i:0;i:101;}i:120229;a:1:{i:0;i:102;}i:120230;a:1:{i:0;i:103;}i:120231;a:1:{i:0;i:104;}i:120232;a:1:{i:0;i:105;}i:120233;a:1:{i:0;i:106;}i:120234;a:1:{i:0;i:107;}i:120235;a:1:{i:0;i:108;}i:120236;a:1:{i:0;i:109;}i:120237;a:1:{i:0;i:110;}i:120238;a:1:{i:0;i:111;}i:120239;a:1:{i:0;i:112;}i:120240;a:1:{i:0;i:113;}i:120241;a:1:{i:0;i:114;}i:120242;a:1:{i:0;i:115;}i:120243;a:1:{i:0;i:116;}i:120244;a:1:{i:0;i:117;}i:120245;a:1:{i:0;i:118;}i:120246;a:1:{i:0;i:119;}i:120247;a:1:{i:0;i:120;}i:120248;a:1:{i:0;i:121;}i:120249;a:1:{i:0;i:122;}i:120276;a:1:{i:0;i:97;}i:120277;a:1:{i:0;i:98;}i:120278;a:1:{i:0;i:99;}i:120279;a:1:{i:0;i:100;}i:120280;a:1:{i:0;i:101;}i:120281;a:1:{i:0;i:102;}i:120282;a:1:{i:0;i:103;}i:120283;a:1:{i:0;i:104;}i:120284;a:1:{i:0;i:105;}i:120285;a:1:{i:0;i:106;}i:120286;a:1:{i:0;i:107;}i:120287;a:1:{i:0;i:108;}i:120288;a:1:{i:0;i:109;}i:120289;a:1:{i:0;i:110;}i:120290;a:1:{i:0;i:111;}i:120291;a:1:{i:0;i:112;}i:120292;a:1:{i:0;i:113;}i:120293;a:1:{i:0;i:114;}i:120294;a:1:{i:0;i:115;}i:120295;a:1:{i:0;i:116;}i:120296;a:1:{i:0;i:117;}i:120297;a:1:{i:0;i:118;}i:120298;a:1:{i:0;i:119;}i:120299;a:1:{i:0;i:120;}i:120300;a:1:{i:0;i:121;}i:120301;a:1:{i:0;i:122;}i:120328;a:1:{i:0;i:97;}i:120329;a:1:{i:0;i:98;}i:120330;a:1:{i:0;i:99;}i:120331;a:1:{i:0;i:100;}i:120332;a:1:{i:0;i:101;}i:120333;a:1:{i:0;i:102;}i:120334;a:1:{i:0;i:103;}i:120335;a:1:{i:0;i:104;}i:120336;a:1:{i:0;i:105;}i:120337;a:1:{i:0;i:106;}i:120338;a:1:{i:0;i:107;}i:120339;a:1:{i:0;i:108;}i:120340;a:1:{i:0;i:109;}i:120341;a:1:{i:0;i:110;}i:120342;a:1:{i:0;i:111;}i:120343;a:1:{i:0;i:112;}i:120344;a:1:{i:0;i:113;}i:120345;a:1:{i:0;i:114;}i:120346;a:1:{i:0;i:115;}i:120347;a:1:{i:0;i:116;}i:120348;a:1:{i:0;i:117;}i:120349;a:1:{i:0;i:118;}i:120350;a:1:{i:0;i:119;}i:120351;a:1:{i:0;i:120;}i:120352;a:1:{i:0;i:121;}i:120353;a:1:{i:0;i:122;}i:120380;a:1:{i:0;i:97;}i:120381;a:1:{i:0;i:98;}i:120382;a:1:{i:0;i:99;}i:120383;a:1:{i:0;i:100;}i:120384;a:1:{i:0;i:101;}i:120385;a:1:{i:0;i:102;}i:120386;a:1:{i:0;i:103;}i:120387;a:1:{i:0;i:104;}i:120388;a:1:{i:0;i:105;}i:120389;a:1:{i:0;i:106;}i:120390;a:1:{i:0;i:107;}i:120391;a:1:{i:0;i:108;}i:120392;a:1:{i:0;i:109;}i:120393;a:1:{i:0;i:110;}i:120394;a:1:{i:0;i:111;}i:120395;a:1:{i:0;i:112;}i:120396;a:1:{i:0;i:113;}i:120397;a:1:{i:0;i:114;}i:120398;a:1:{i:0;i:115;}i:120399;a:1:{i:0;i:116;}i:120400;a:1:{i:0;i:117;}i:120401;a:1:{i:0;i:118;}i:120402;a:1:{i:0;i:119;}i:120403;a:1:{i:0;i:120;}i:120404;a:1:{i:0;i:121;}i:120405;a:1:{i:0;i:122;}i:120432;a:1:{i:0;i:97;}i:120433;a:1:{i:0;i:98;}i:120434;a:1:{i:0;i:99;}i:120435;a:1:{i:0;i:100;}i:120436;a:1:{i:0;i:101;}i:120437;a:1:{i:0;i:102;}i:120438;a:1:{i:0;i:103;}i:120439;a:1:{i:0;i:104;}i:120440;a:1:{i:0;i:105;}i:120441;a:1:{i:0;i:106;}i:120442;a:1:{i:0;i:107;}i:120443;a:1:{i:0;i:108;}i:120444;a:1:{i:0;i:109;}i:120445;a:1:{i:0;i:110;}i:120446;a:1:{i:0;i:111;}i:120447;a:1:{i:0;i:112;}i:120448;a:1:{i:0;i:113;}i:120449;a:1:{i:0;i:114;}i:120450;a:1:{i:0;i:115;}i:120451;a:1:{i:0;i:116;}i:120452;a:1:{i:0;i:117;}i:120453;a:1:{i:0;i:118;}i:120454;a:1:{i:0;i:119;}i:120455;a:1:{i:0;i:120;}i:120456;a:1:{i:0;i:121;}i:120457;a:1:{i:0;i:122;}i:120488;a:1:{i:0;i:945;}i:120489;a:1:{i:0;i:946;}i:120490;a:1:{i:0;i:947;}i:120491;a:1:{i:0;i:948;}i:120492;a:1:{i:0;i:949;}i:120493;a:1:{i:0;i:950;}i:120494;a:1:{i:0;i:951;}i:120495;a:1:{i:0;i:952;}i:120496;a:1:{i:0;i:953;}i:120497;a:1:{i:0;i:954;}i:120498;a:1:{i:0;i:955;}i:120499;a:1:{i:0;i:956;}i:120500;a:1:{i:0;i:957;}i:120501;a:1:{i:0;i:958;}i:120502;a:1:{i:0;i:959;}i:120503;a:1:{i:0;i:960;}i:120504;a:1:{i:0;i:961;}i:120505;a:1:{i:0;i:952;}i:120506;a:1:{i:0;i:963;}i:120507;a:1:{i:0;i:964;}i:120508;a:1:{i:0;i:965;}i:120509;a:1:{i:0;i:966;}i:120510;a:1:{i:0;i:967;}i:120511;a:1:{i:0;i:968;}i:120512;a:1:{i:0;i:969;}i:120531;a:1:{i:0;i:963;}i:120546;a:1:{i:0;i:945;}i:120547;a:1:{i:0;i:946;}i:120548;a:1:{i:0;i:947;}i:120549;a:1:{i:0;i:948;}i:120550;a:1:{i:0;i:949;}i:120551;a:1:{i:0;i:950;}i:120552;a:1:{i:0;i:951;}i:120553;a:1:{i:0;i:952;}i:120554;a:1:{i:0;i:953;}i:120555;a:1:{i:0;i:954;}i:120556;a:1:{i:0;i:955;}i:120557;a:1:{i:0;i:956;}i:120558;a:1:{i:0;i:957;}i:120559;a:1:{i:0;i:958;}i:120560;a:1:{i:0;i:959;}i:120561;a:1:{i:0;i:960;}i:120562;a:1:{i:0;i:961;}i:120563;a:1:{i:0;i:952;}i:120564;a:1:{i:0;i:963;}i:120565;a:1:{i:0;i:964;}i:120566;a:1:{i:0;i:965;}i:120567;a:1:{i:0;i:966;}i:120568;a:1:{i:0;i:967;}i:120569;a:1:{i:0;i:968;}i:120570;a:1:{i:0;i:969;}i:120589;a:1:{i:0;i:963;}i:120604;a:1:{i:0;i:945;}i:120605;a:1:{i:0;i:946;}i:120606;a:1:{i:0;i:947;}i:120607;a:1:{i:0;i:948;}i:120608;a:1:{i:0;i:949;}i:120609;a:1:{i:0;i:950;}i:120610;a:1:{i:0;i:951;}i:120611;a:1:{i:0;i:952;}i:120612;a:1:{i:0;i:953;}i:120613;a:1:{i:0;i:954;}i:120614;a:1:{i:0;i:955;}i:120615;a:1:{i:0;i:956;}i:120616;a:1:{i:0;i:957;}i:120617;a:1:{i:0;i:958;}i:120618;a:1:{i:0;i:959;}i:120619;a:1:{i:0;i:960;}i:120620;a:1:{i:0;i:961;}i:120621;a:1:{i:0;i:952;}i:120622;a:1:{i:0;i:963;}i:120623;a:1:{i:0;i:964;}i:120624;a:1:{i:0;i:965;}i:120625;a:1:{i:0;i:966;}i:120626;a:1:{i:0;i:967;}i:120627;a:1:{i:0;i:968;}i:120628;a:1:{i:0;i:969;}i:120647;a:1:{i:0;i:963;}i:120662;a:1:{i:0;i:945;}i:120663;a:1:{i:0;i:946;}i:120664;a:1:{i:0;i:947;}i:120665;a:1:{i:0;i:948;}i:120666;a:1:{i:0;i:949;}i:120667;a:1:{i:0;i:950;}i:120668;a:1:{i:0;i:951;}i:120669;a:1:{i:0;i:952;}i:120670;a:1:{i:0;i:953;}i:120671;a:1:{i:0;i:954;}i:120672;a:1:{i:0;i:955;}i:120673;a:1:{i:0;i:956;}i:120674;a:1:{i:0;i:957;}i:120675;a:1:{i:0;i:958;}i:120676;a:1:{i:0;i:959;}i:120677;a:1:{i:0;i:960;}i:120678;a:1:{i:0;i:961;}i:120679;a:1:{i:0;i:952;}i:120680;a:1:{i:0;i:963;}i:120681;a:1:{i:0;i:964;}i:120682;a:1:{i:0;i:965;}i:120683;a:1:{i:0;i:966;}i:120684;a:1:{i:0;i:967;}i:120685;a:1:{i:0;i:968;}i:120686;a:1:{i:0;i:969;}i:120705;a:1:{i:0;i:963;}i:120720;a:1:{i:0;i:945;}i:120721;a:1:{i:0;i:946;}i:120722;a:1:{i:0;i:947;}i:120723;a:1:{i:0;i:948;}i:120724;a:1:{i:0;i:949;}i:120725;a:1:{i:0;i:950;}i:120726;a:1:{i:0;i:951;}i:120727;a:1:{i:0;i:952;}i:120728;a:1:{i:0;i:953;}i:120729;a:1:{i:0;i:954;}i:120730;a:1:{i:0;i:955;}i:120731;a:1:{i:0;i:956;}i:120732;a:1:{i:0;i:957;}i:120733;a:1:{i:0;i:958;}i:120734;a:1:{i:0;i:959;}i:120735;a:1:{i:0;i:960;}i:120736;a:1:{i:0;i:961;}i:120737;a:1:{i:0;i:952;}i:120738;a:1:{i:0;i:963;}i:120739;a:1:{i:0;i:964;}i:120740;a:1:{i:0;i:965;}i:120741;a:1:{i:0;i:966;}i:120742;a:1:{i:0;i:967;}i:120743;a:1:{i:0;i:968;}i:120744;a:1:{i:0;i:969;}i:120763;a:1:{i:0;i:963;}i:1017;a:1:{i:0;i:963;}i:7468;a:1:{i:0;i:97;}i:7469;a:1:{i:0;i:230;}i:7470;a:1:{i:0;i:98;}i:7472;a:1:{i:0;i:100;}i:7473;a:1:{i:0;i:101;}i:7474;a:1:{i:0;i:477;}i:7475;a:1:{i:0;i:103;}i:7476;a:1:{i:0;i:104;}i:7477;a:1:{i:0;i:105;}i:7478;a:1:{i:0;i:106;}i:7479;a:1:{i:0;i:107;}i:7480;a:1:{i:0;i:108;}i:7481;a:1:{i:0;i:109;}i:7482;a:1:{i:0;i:110;}i:7484;a:1:{i:0;i:111;}i:7485;a:1:{i:0;i:547;}i:7486;a:1:{i:0;i:112;}i:7487;a:1:{i:0;i:114;}i:7488;a:1:{i:0;i:116;}i:7489;a:1:{i:0;i:117;}i:7490;a:1:{i:0;i:119;}i:8507;a:3:{i:0;i:102;i:1;i:97;i:2;i:120;}i:12880;a:3:{i:0;i:112;i:1;i:116;i:2;i:101;}i:13004;a:2:{i:0;i:104;i:1;i:103;}i:13006;a:2:{i:0;i:101;i:1;i:118;}i:13007;a:3:{i:0;i:108;i:1;i:116;i:2;i:100;}i:13178;a:2:{i:0;i:105;i:1;i:117;}i:13278;a:3:{i:0;i:118;i:1;i:8725;i:2;i:109;}i:13279;a:3:{i:0;i:97;i:1;i:8725;i:2;i:109;}}s:12:"norm_combcls";a:341:{i:820;i:1;i:821;i:1;i:822;i:1;i:823;i:1;i:824;i:1;i:2364;i:7;i:2492;i:7;i:2620;i:7;i:2748;i:7;i:2876;i:7;i:3260;i:7;i:4151;i:7;i:12441;i:8;i:12442;i:8;i:2381;i:9;i:2509;i:9;i:2637;i:9;i:2765;i:9;i:2893;i:9;i:3021;i:9;i:3149;i:9;i:3277;i:9;i:3405;i:9;i:3530;i:9;i:3642;i:9;i:3972;i:9;i:4153;i:9;i:5908;i:9;i:5940;i:9;i:6098;i:9;i:1456;i:10;i:1457;i:11;i:1458;i:12;i:1459;i:13;i:1460;i:14;i:1461;i:15;i:1462;i:16;i:1463;i:17;i:1464;i:18;i:1465;i:19;i:1467;i:20;i:1468;i:21;i:1469;i:22;i:1471;i:23;i:1473;i:24;i:1474;i:25;i:64286;i:26;i:1611;i:27;i:1612;i:28;i:1613;i:29;i:1614;i:30;i:1615;i:31;i:1616;i:32;i:1617;i:33;i:1618;i:34;i:1648;i:35;i:1809;i:36;i:3157;i:84;i:3158;i:91;i:3640;i:103;i:3641;i:103;i:3656;i:107;i:3657;i:107;i:3658;i:107;i:3659;i:107;i:3768;i:118;i:3769;i:118;i:3784;i:122;i:3785;i:122;i:3786;i:122;i:3787;i:122;i:3953;i:129;i:3954;i:130;i:3962;i:130;i:3963;i:130;i:3964;i:130;i:3965;i:130;i:3968;i:130;i:3956;i:132;i:801;i:202;i:802;i:202;i:807;i:202;i:808;i:202;i:795;i:216;i:3897;i:216;i:119141;i:216;i:119142;i:216;i:119150;i:216;i:119151;i:216;i:119152;i:216;i:119153;i:216;i:119154;i:216;i:12330;i:218;i:790;i:220;i:791;i:220;i:792;i:220;i:793;i:220;i:796;i:220;i:797;i:220;i:798;i:220;i:799;i:220;i:800;i:220;i:803;i:220;i:804;i:220;i:805;i:220;i:806;i:220;i:809;i:220;i:810;i:220;i:811;i:220;i:812;i:220;i:813;i:220;i:814;i:220;i:815;i:220;i:816;i:220;i:817;i:220;i:818;i:220;i:819;i:220;i:825;i:220;i:826;i:220;i:827;i:220;i:828;i:220;i:839;i:220;i:840;i:220;i:841;i:220;i:845;i:220;i:846;i:220;i:851;i:220;i:852;i:220;i:853;i:220;i:854;i:220;i:1425;i:220;i:1430;i:220;i:1435;i:220;i:1443;i:220;i:1444;i:220;i:1445;i:220;i:1446;i:220;i:1447;i:220;i:1450;i:220;i:1621;i:220;i:1622;i:220;i:1763;i:220;i:1770;i:220;i:1773;i:220;i:1841;i:220;i:1844;i:220;i:1847;i:220;i:1848;i:220;i:1849;i:220;i:1851;i:220;i:1852;i:220;i:1854;i:220;i:1858;i:220;i:1860;i:220;i:1862;i:220;i:1864;i:220;i:2386;i:220;i:3864;i:220;i:3865;i:220;i:3893;i:220;i:3895;i:220;i:4038;i:220;i:6459;i:220;i:8424;i:220;i:119163;i:220;i:119164;i:220;i:119165;i:220;i:119166;i:220;i:119167;i:220;i:119168;i:220;i:119169;i:220;i:119170;i:220;i:119178;i:220;i:119179;i:220;i:1434;i:222;i:1453;i:222;i:6441;i:222;i:12333;i:222;i:12334;i:224;i:12335;i:224;i:119149;i:226;i:1454;i:228;i:6313;i:228;i:12331;i:228;i:768;i:230;i:769;i:230;i:770;i:230;i:771;i:230;i:772;i:230;i:773;i:230;i:774;i:230;i:775;i:230;i:776;i:230;i:777;i:230;i:778;i:230;i:779;i:230;i:780;i:230;i:781;i:230;i:782;i:230;i:783;i:230;i:784;i:230;i:785;i:230;i:786;i:230;i:787;i:230;i:788;i:230;i:829;i:230;i:830;i:230;i:831;i:230;i:832;i:230;i:833;i:230;i:834;i:230;i:835;i:230;i:836;i:230;i:838;i:230;i:842;i:230;i:843;i:230;i:844;i:230;i:848;i:230;i:849;i:230;i:850;i:230;i:855;i:230;i:867;i:230;i:868;i:230;i:869;i:230;i:870;i:230;i:871;i:230;i:872;i:230;i:873;i:230;i:874;i:230;i:875;i:230;i:876;i:230;i:877;i:230;i:878;i:230;i:879;i:230;i:1155;i:230;i:1156;i:230;i:1157;i:230;i:1158;i:230;i:1426;i:230;i:1427;i:230;i:1428;i:230;i:1429;i:230;i:1431;i:230;i:1432;i:230;i:1433;i:230;i:1436;i:230;i:1437;i:230;i:1438;i:230;i:1439;i:230;i:1440;i:230;i:1441;i:230;i:1448;i:230;i:1449;i:230;i:1451;i:230;i:1452;i:230;i:1455;i:230;i:1476;i:230;i:1552;i:230;i:1553;i:230;i:1554;i:230;i:1555;i:230;i:1556;i:230;i:1557;i:230;i:1619;i:230;i:1620;i:230;i:1623;i:230;i:1624;i:230;i:1750;i:230;i:1751;i:230;i:1752;i:230;i:1753;i:230;i:1754;i:230;i:1755;i:230;i:1756;i:230;i:1759;i:230;i:1760;i:230;i:1761;i:230;i:1762;i:230;i:1764;i:230;i:1767;i:230;i:1768;i:230;i:1771;i:230;i:1772;i:230;i:1840;i:230;i:1842;i:230;i:1843;i:230;i:1845;i:230;i:1846;i:230;i:1850;i:230;i:1853;i:230;i:1855;i:230;i:1856;i:230;i:1857;i:230;i:1859;i:230;i:1861;i:230;i:1863;i:230;i:1865;i:230;i:1866;i:230;i:2385;i:230;i:2387;i:230;i:2388;i:230;i:3970;i:230;i:3971;i:230;i:3974;i:230;i:3975;i:230;i:5901;i:230;i:6458;i:230;i:8400;i:230;i:8401;i:230;i:8404;i:230;i:8405;i:230;i:8406;i:230;i:8407;i:230;i:8411;i:230;i:8412;i:230;i:8417;i:230;i:8423;i:230;i:8425;i:230;i:65056;i:230;i:65057;i:230;i:65058;i:230;i:65059;i:230;i:119173;i:230;i:119174;i:230;i:119175;i:230;i:119177;i:230;i:119176;i:230;i:119210;i:230;i:119211;i:230;i:119212;i:230;i:119213;i:230;i:789;i:232;i:794;i:232;i:12332;i:232;i:863;i:233;i:866;i:233;i:861;i:234;i:862;i:234;i:864;i:234;i:865;i:234;i:837;i:240;}}
\ No newline at end of file
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie.php
new file mode 100755
index 0000000000..2ae78c3593
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie.php
@@ -0,0 +1,3336 @@
+' . SIMPLEPIE_NAME . ' ');
+
+/**
+ * No Autodiscovery
+ * @see SimplePie::set_autodiscovery_level()
+ */
+define('SIMPLEPIE_LOCATOR_NONE', 0);
+
+/**
+ * Feed Link Element Autodiscovery
+ * @see SimplePie::set_autodiscovery_level()
+ */
+define('SIMPLEPIE_LOCATOR_AUTODISCOVERY', 1);
+
+/**
+ * Local Feed Extension Autodiscovery
+ * @see SimplePie::set_autodiscovery_level()
+ */
+define('SIMPLEPIE_LOCATOR_LOCAL_EXTENSION', 2);
+
+/**
+ * Local Feed Body Autodiscovery
+ * @see SimplePie::set_autodiscovery_level()
+ */
+define('SIMPLEPIE_LOCATOR_LOCAL_BODY', 4);
+
+/**
+ * Remote Feed Extension Autodiscovery
+ * @see SimplePie::set_autodiscovery_level()
+ */
+define('SIMPLEPIE_LOCATOR_REMOTE_EXTENSION', 8);
+
+/**
+ * Remote Feed Body Autodiscovery
+ * @see SimplePie::set_autodiscovery_level()
+ */
+define('SIMPLEPIE_LOCATOR_REMOTE_BODY', 16);
+
+/**
+ * All Feed Autodiscovery
+ * @see SimplePie::set_autodiscovery_level()
+ */
+define('SIMPLEPIE_LOCATOR_ALL', 31);
+
+/**
+ * No known feed type
+ */
+define('SIMPLEPIE_TYPE_NONE', 0);
+
+/**
+ * RSS 0.90
+ */
+define('SIMPLEPIE_TYPE_RSS_090', 1);
+
+/**
+ * RSS 0.91 (Netscape)
+ */
+define('SIMPLEPIE_TYPE_RSS_091_NETSCAPE', 2);
+
+/**
+ * RSS 0.91 (Userland)
+ */
+define('SIMPLEPIE_TYPE_RSS_091_USERLAND', 4);
+
+/**
+ * RSS 0.91 (both Netscape and Userland)
+ */
+define('SIMPLEPIE_TYPE_RSS_091', 6);
+
+/**
+ * RSS 0.92
+ */
+define('SIMPLEPIE_TYPE_RSS_092', 8);
+
+/**
+ * RSS 0.93
+ */
+define('SIMPLEPIE_TYPE_RSS_093', 16);
+
+/**
+ * RSS 0.94
+ */
+define('SIMPLEPIE_TYPE_RSS_094', 32);
+
+/**
+ * RSS 1.0
+ */
+define('SIMPLEPIE_TYPE_RSS_10', 64);
+
+/**
+ * RSS 2.0
+ */
+define('SIMPLEPIE_TYPE_RSS_20', 128);
+
+/**
+ * RDF-based RSS
+ */
+define('SIMPLEPIE_TYPE_RSS_RDF', 65);
+
+/**
+ * Non-RDF-based RSS (truly intended as syndication format)
+ */
+define('SIMPLEPIE_TYPE_RSS_SYNDICATION', 190);
+
+/**
+ * All RSS
+ */
+define('SIMPLEPIE_TYPE_RSS_ALL', 255);
+
+/**
+ * Atom 0.3
+ */
+define('SIMPLEPIE_TYPE_ATOM_03', 256);
+
+/**
+ * Atom 1.0
+ */
+define('SIMPLEPIE_TYPE_ATOM_10', 512);
+
+/**
+ * All Atom
+ */
+define('SIMPLEPIE_TYPE_ATOM_ALL', 768);
+
+/**
+ * All feed types
+ */
+define('SIMPLEPIE_TYPE_ALL', 1023);
+
+/**
+ * No construct
+ */
+define('SIMPLEPIE_CONSTRUCT_NONE', 0);
+
+/**
+ * Text construct
+ */
+define('SIMPLEPIE_CONSTRUCT_TEXT', 1);
+
+/**
+ * HTML construct
+ */
+define('SIMPLEPIE_CONSTRUCT_HTML', 2);
+
+/**
+ * XHTML construct
+ */
+define('SIMPLEPIE_CONSTRUCT_XHTML', 4);
+
+/**
+ * base64-encoded construct
+ */
+define('SIMPLEPIE_CONSTRUCT_BASE64', 8);
+
+/**
+ * IRI construct
+ */
+define('SIMPLEPIE_CONSTRUCT_IRI', 16);
+
+/**
+ * A construct that might be HTML
+ */
+define('SIMPLEPIE_CONSTRUCT_MAYBE_HTML', 32);
+
+/**
+ * All constructs
+ */
+define('SIMPLEPIE_CONSTRUCT_ALL', 63);
+
+/**
+ * Don't change case
+ */
+define('SIMPLEPIE_SAME_CASE', 1);
+
+/**
+ * Change to lowercase
+ */
+define('SIMPLEPIE_LOWERCASE', 2);
+
+/**
+ * Change to uppercase
+ */
+define('SIMPLEPIE_UPPERCASE', 4);
+
+/**
+ * PCRE for HTML attributes
+ */
+define('SIMPLEPIE_PCRE_HTML_ATTRIBUTE', '((?:[\x09\x0A\x0B\x0C\x0D\x20]+[^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?)*)[\x09\x0A\x0B\x0C\x0D\x20]*');
+
+/**
+ * PCRE for XML attributes
+ */
+define('SIMPLEPIE_PCRE_XML_ATTRIBUTE', '((?:\s+(?:(?:[^\s:]+:)?[^\s:]+)\s*=\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'))*)\s*');
+
+/**
+ * XML Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_XML', 'http://www.w3.org/XML/1998/namespace');
+
+/**
+ * Atom 1.0 Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_ATOM_10', 'http://www.w3.org/2005/Atom');
+
+/**
+ * Atom 0.3 Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_ATOM_03', 'http://purl.org/atom/ns#');
+
+/**
+ * RDF Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_RDF', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');
+
+/**
+ * RSS 0.90 Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_RSS_090', 'http://my.netscape.com/rdf/simple/0.9/');
+
+/**
+ * RSS 1.0 Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_RSS_10', 'http://purl.org/rss/1.0/');
+
+/**
+ * RSS 1.0 Content Module Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT', 'http://purl.org/rss/1.0/modules/content/');
+
+/**
+ * RSS 2.0 Namespace
+ * (Stupid, I know, but I'm certain it will confuse people less with support.)
+ */
+define('SIMPLEPIE_NAMESPACE_RSS_20', '');
+
+/**
+ * DC 1.0 Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_DC_10', 'http://purl.org/dc/elements/1.0/');
+
+/**
+ * DC 1.1 Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_DC_11', 'http://purl.org/dc/elements/1.1/');
+
+/**
+ * W3C Basic Geo (WGS84 lat/long) Vocabulary Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO', 'http://www.w3.org/2003/01/geo/wgs84_pos#');
+
+/**
+ * GeoRSS Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_GEORSS', 'http://www.georss.org/georss');
+
+/**
+ * Media RSS Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_MEDIARSS', 'http://search.yahoo.com/mrss/');
+
+/**
+ * Wrong Media RSS Namespace. Caused by a long-standing typo in the spec.
+ */
+define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG', 'http://search.yahoo.com/mrss');
+
+/**
+ * Wrong Media RSS Namespace #2. New namespace introduced in Media RSS 1.5.
+ */
+define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG2', 'http://video.search.yahoo.com/mrss');
+
+/**
+ * Wrong Media RSS Namespace #3. A possible typo of the Media RSS 1.5 namespace.
+ */
+define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG3', 'http://video.search.yahoo.com/mrss/');
+
+/**
+ * Wrong Media RSS Namespace #4. New spec location after the RSS Advisory Board takes it over, but not a valid namespace.
+ */
+define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG4', 'http://www.rssboard.org/media-rss');
+
+/**
+ * Wrong Media RSS Namespace #5. A possible typo of the RSS Advisory Board URL.
+ */
+define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG5', 'http://www.rssboard.org/media-rss/');
+
+/**
+ * iTunes RSS Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_ITUNES', 'http://www.itunes.com/dtds/podcast-1.0.dtd');
+
+/**
+ * XHTML Namespace
+ */
+define('SIMPLEPIE_NAMESPACE_XHTML', 'http://www.w3.org/1999/xhtml');
+
+/**
+ * IANA Link Relations Registry
+ */
+define('SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY', 'http://www.iana.org/assignments/relation/');
+
+/**
+ * No file source
+ */
+define('SIMPLEPIE_FILE_SOURCE_NONE', 0);
+
+/**
+ * Remote file source
+ */
+define('SIMPLEPIE_FILE_SOURCE_REMOTE', 1);
+
+/**
+ * Local file source
+ */
+define('SIMPLEPIE_FILE_SOURCE_LOCAL', 2);
+
+/**
+ * fsockopen() file source
+ */
+define('SIMPLEPIE_FILE_SOURCE_FSOCKOPEN', 4);
+
+/**
+ * cURL file source
+ */
+define('SIMPLEPIE_FILE_SOURCE_CURL', 8);
+
+/**
+ * file_get_contents() file source
+ */
+define('SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS', 16);
+
+
+
+/**
+ * SimplePie
+ *
+ * @package SimplePie
+ * @subpackage API
+ */
+class SimplePie
+{
+ /**
+ * @var array Raw data
+ * @access private
+ */
+ public $data = array();
+
+ /**
+ * @var mixed Error string
+ * @access private
+ */
+ public $error;
+
+ /**
+ * @var int HTTP status code
+ * @see SimplePie::status_code()
+ * @access private
+ */
+ public $status_code;
+
+ /**
+ * @var object Instance of SimplePie_Sanitize (or other class)
+ * @see SimplePie::set_sanitize_class()
+ * @access private
+ */
+ public $sanitize;
+
+ /**
+ * @var string SimplePie Useragent
+ * @see SimplePie::set_useragent()
+ * @access private
+ */
+ public $useragent = SIMPLEPIE_USERAGENT;
+
+ /**
+ * @var string Feed URL
+ * @see SimplePie::set_feed_url()
+ * @access private
+ */
+ public $feed_url;
+
+ /**
+ * @var string Original feed URL, or new feed URL iff HTTP 301 Moved Permanently
+ * @see SimplePie::subscribe_url()
+ * @access private
+ */
+ public $permanent_url = null;
+
+ /**
+ * @var object Instance of SimplePie_File to use as a feed
+ * @see SimplePie::set_file()
+ * @access private
+ */
+ public $file;
+
+ /**
+ * @var string Raw feed data
+ * @see SimplePie::set_raw_data()
+ * @access private
+ */
+ public $raw_data;
+
+ /**
+ * @var int Timeout for fetching remote files
+ * @see SimplePie::set_timeout()
+ * @access private
+ */
+ public $timeout = 10;
+
+ /**
+ * @var array Custom curl options
+ * @see SimplePie::set_curl_options()
+ * @access private
+ */
+ public $curl_options = array();
+
+ /**
+ * @var bool Forces fsockopen() to be used for remote files instead
+ * of cURL, even if a new enough version is installed
+ * @see SimplePie::force_fsockopen()
+ * @access private
+ */
+ public $force_fsockopen = false;
+
+ /**
+ * @var bool Force the given data/URL to be treated as a feed no matter what
+ * it appears like
+ * @see SimplePie::force_feed()
+ * @access private
+ */
+ public $force_feed = false;
+
+ /**
+ * @var bool Enable/Disable Caching
+ * @see SimplePie::enable_cache()
+ * @access private
+ */
+ public $cache = true;
+
+ /**
+ * @var bool Force SimplePie to fallback to expired cache, if enabled,
+ * when feed is unavailable.
+ * @see SimplePie::force_cache_fallback()
+ * @access private
+ */
+ public $force_cache_fallback = false;
+
+ /**
+ * @var int Cache duration (in seconds)
+ * @see SimplePie::set_cache_duration()
+ * @access private
+ */
+ public $cache_duration = 3600;
+
+ /**
+ * @var int Auto-discovery cache duration (in seconds)
+ * @see SimplePie::set_autodiscovery_cache_duration()
+ * @access private
+ */
+ public $autodiscovery_cache_duration = 604800; // 7 Days.
+
+ /**
+ * @var string Cache location (relative to executing script)
+ * @see SimplePie::set_cache_location()
+ * @access private
+ */
+ public $cache_location = './cache';
+
+ /**
+ * @var string Function that creates the cache filename
+ * @see SimplePie::set_cache_name_function()
+ * @access private
+ */
+ public $cache_name_function = 'md5';
+
+ /**
+ * @var bool Reorder feed by date descending
+ * @see SimplePie::enable_order_by_date()
+ * @access private
+ */
+ public $order_by_date = true;
+
+ /**
+ * @var mixed Force input encoding to be set to the follow value
+ * (false, or anything type-cast to false, disables this feature)
+ * @see SimplePie::set_input_encoding()
+ * @access private
+ */
+ public $input_encoding = false;
+
+ /**
+ * @var int Feed Autodiscovery Level
+ * @see SimplePie::set_autodiscovery_level()
+ * @access private
+ */
+ public $autodiscovery = SIMPLEPIE_LOCATOR_ALL;
+
+ /**
+ * Class registry object
+ *
+ * @var SimplePie_Registry
+ */
+ public $registry;
+
+ /**
+ * @var int Maximum number of feeds to check with autodiscovery
+ * @see SimplePie::set_max_checked_feeds()
+ * @access private
+ */
+ public $max_checked_feeds = 10;
+
+ /**
+ * @var array All the feeds found during the autodiscovery process
+ * @see SimplePie::get_all_discovered_feeds()
+ * @access private
+ */
+ public $all_discovered_feeds = array();
+
+ /**
+ * @var string Web-accessible path to the handler_image.php file.
+ * @see SimplePie::set_image_handler()
+ * @access private
+ */
+ public $image_handler = '';
+
+ /**
+ * @var array Stores the URLs when multiple feeds are being initialized.
+ * @see SimplePie::set_feed_url()
+ * @access private
+ */
+ public $multifeed_url = array();
+
+ /**
+ * @var array Stores SimplePie objects when multiple feeds initialized.
+ * @access private
+ */
+ public $multifeed_objects = array();
+
+ /**
+ * @var array Stores the get_object_vars() array for use with multifeeds.
+ * @see SimplePie::set_feed_url()
+ * @access private
+ */
+ public $config_settings = null;
+
+ /**
+ * @var integer Stores the number of items to return per-feed with multifeeds.
+ * @see SimplePie::set_item_limit()
+ * @access private
+ */
+ public $item_limit = 0;
+
+ /**
+ * @var bool Stores if last-modified and/or etag headers were sent with the
+ * request when checking a feed.
+ */
+ public $check_modified = false;
+
+ /**
+ * @var array Stores the default attributes to be stripped by strip_attributes().
+ * @see SimplePie::strip_attributes()
+ * @access private
+ */
+ public $strip_attributes = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc');
+
+ /**
+ * @var array Stores the default attributes to add to different tags by add_attributes().
+ * @see SimplePie::add_attributes()
+ * @access private
+ */
+ public $add_attributes = array('audio' => array('preload' => 'none'), 'iframe' => array('sandbox' => 'allow-scripts allow-same-origin'), 'video' => array('preload' => 'none'));
+
+ /**
+ * @var array Stores the default tags to be stripped by strip_htmltags().
+ * @see SimplePie::strip_htmltags()
+ * @access private
+ */
+ public $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style');
+
+ /**
+ * @var array Stores the default attributes to be renamed by rename_attributes().
+ * @see SimplePie::rename_attributes()
+ * @access private
+ */
+ public $rename_attributes = array();
+
+ /**
+ * @var bool Should we throw exceptions, or use the old-style error property?
+ * @access private
+ */
+ public $enable_exceptions = false;
+
+ /**
+ * The SimplePie class contains feed level data and options
+ *
+ * To use SimplePie, create the SimplePie object with no parameters. You can
+ * then set configuration options using the provided methods. After setting
+ * them, you must initialise the feed using $feed->init(). At that point the
+ * object's methods and properties will be available to you.
+ *
+ * Previously, it was possible to pass in the feed URL along with cache
+ * options directly into the constructor. This has been removed as of 1.3 as
+ * it caused a lot of confusion.
+ *
+ * @since 1.0 Preview Release
+ */
+ public function __construct()
+ {
+ if (version_compare(PHP_VERSION, '5.6', '<'))
+ {
+ trigger_error('Please upgrade to PHP 5.6 or newer.');
+ die();
+ }
+
+ // Other objects, instances created here so we can set options on them
+ $this->sanitize = new SimplePie_Sanitize();
+ $this->registry = new SimplePie_Registry();
+
+ if (func_num_args() > 0)
+ {
+ $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING;
+ trigger_error('Passing parameters to the constructor is no longer supported. Please use set_feed_url(), set_cache_location(), and set_cache_duration() directly.', $level);
+
+ $args = func_get_args();
+ switch (count($args)) {
+ case 3:
+ $this->set_cache_duration($args[2]);
+ case 2:
+ $this->set_cache_location($args[1]);
+ case 1:
+ $this->set_feed_url($args[0]);
+ $this->init();
+ }
+ }
+ }
+
+ /**
+ * Used for converting object to a string
+ */
+ public function __toString()
+ {
+ return md5(serialize($this->data));
+ }
+
+ /**
+ * Remove items that link back to this before destroying this object
+ */
+ public function __destruct()
+ {
+ if (!gc_enabled())
+ {
+ if (!empty($this->data['items']))
+ {
+ foreach ($this->data['items'] as $item)
+ {
+ $item->__destruct();
+ }
+ unset($item, $this->data['items']);
+ }
+ if (!empty($this->data['ordered_items']))
+ {
+ foreach ($this->data['ordered_items'] as $item)
+ {
+ $item->__destruct();
+ }
+ unset($item, $this->data['ordered_items']);
+ }
+ }
+ }
+
+ /**
+ * Force the given data/URL to be treated as a feed
+ *
+ * This tells SimplePie to ignore the content-type provided by the server.
+ * Be careful when using this option, as it will also disable autodiscovery.
+ *
+ * @since 1.1
+ * @param bool $enable Force the given data/URL to be treated as a feed
+ */
+ public function force_feed($enable = false)
+ {
+ $this->force_feed = (bool) $enable;
+ }
+
+ /**
+ * Set the URL of the feed you want to parse
+ *
+ * This allows you to enter the URL of the feed you want to parse, or the
+ * website you want to try to use auto-discovery on. This takes priority
+ * over any set raw data.
+ *
+ * You can set multiple feeds to mash together by passing an array instead
+ * of a string for the $url. Remember that with each additional feed comes
+ * additional processing and resources.
+ *
+ * @since 1.0 Preview Release
+ * @see set_raw_data()
+ * @param string|array $url This is the URL (or array of URLs) that you want to parse.
+ */
+ public function set_feed_url($url)
+ {
+ $this->multifeed_url = array();
+ if (is_array($url))
+ {
+ foreach ($url as $value)
+ {
+ $this->multifeed_url[] = $this->registry->call('Misc', 'fix_protocol', array($value, 1));
+ }
+ }
+ else
+ {
+ $this->feed_url = $this->registry->call('Misc', 'fix_protocol', array($url, 1));
+ $this->permanent_url = $this->feed_url;
+ }
+ }
+
+ /**
+ * Set an instance of {@see SimplePie_File} to use as a feed
+ *
+ * @param SimplePie_File &$file
+ * @return bool True on success, false on failure
+ */
+ public function set_file(&$file)
+ {
+ if ($file instanceof SimplePie_File)
+ {
+ $this->feed_url = $file->url;
+ $this->permanent_url = $this->feed_url;
+ $this->file =& $file;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Set the raw XML data to parse
+ *
+ * Allows you to use a string of RSS/Atom data instead of a remote feed.
+ *
+ * If you have a feed available as a string in PHP, you can tell SimplePie
+ * to parse that data string instead of a remote feed. Any set feed URL
+ * takes precedence.
+ *
+ * @since 1.0 Beta 3
+ * @param string $data RSS or Atom data as a string.
+ * @see set_feed_url()
+ */
+ public function set_raw_data($data)
+ {
+ $this->raw_data = $data;
+ }
+
+ /**
+ * Set the default timeout for fetching remote feeds
+ *
+ * This allows you to change the maximum time the feed's server to respond
+ * and send the feed back.
+ *
+ * @since 1.0 Beta 3
+ * @param int $timeout The maximum number of seconds to spend waiting to retrieve a feed.
+ */
+ public function set_timeout($timeout = 10)
+ {
+ $this->timeout = (int) $timeout;
+ }
+
+ /**
+ * Set custom curl options
+ *
+ * This allows you to change default curl options
+ *
+ * @since 1.0 Beta 3
+ * @param array $curl_options Curl options to add to default settings
+ */
+ public function set_curl_options(array $curl_options = array())
+ {
+ $this->curl_options = $curl_options;
+ }
+
+ /**
+ * Force SimplePie to use fsockopen() instead of cURL
+ *
+ * @since 1.0 Beta 3
+ * @param bool $enable Force fsockopen() to be used
+ */
+ public function force_fsockopen($enable = false)
+ {
+ $this->force_fsockopen = (bool) $enable;
+ }
+
+ /**
+ * Enable/disable caching in SimplePie.
+ *
+ * This option allows you to disable caching all-together in SimplePie.
+ * However, disabling the cache can lead to longer load times.
+ *
+ * @since 1.0 Preview Release
+ * @param bool $enable Enable caching
+ */
+ public function enable_cache($enable = true)
+ {
+ $this->cache = (bool) $enable;
+ }
+
+ /**
+ * SimplePie to continue to fall back to expired cache, if enabled, when
+ * feed is unavailable.
+ *
+ * This tells SimplePie to ignore any file errors and fall back to cache
+ * instead. This only works if caching is enabled and cached content
+ * still exists.
+
+ * @param bool $enable Force use of cache on fail.
+ */
+ public function force_cache_fallback($enable = false)
+ {
+ $this->force_cache_fallback= (bool) $enable;
+ }
+
+ /**
+ * Set the length of time (in seconds) that the contents of a feed will be
+ * cached
+ *
+ * @param int $seconds The feed content cache duration
+ */
+ public function set_cache_duration($seconds = 3600)
+ {
+ $this->cache_duration = (int) $seconds;
+ }
+
+ /**
+ * Set the length of time (in seconds) that the autodiscovered feed URL will
+ * be cached
+ *
+ * @param int $seconds The autodiscovered feed URL cache duration.
+ */
+ public function set_autodiscovery_cache_duration($seconds = 604800)
+ {
+ $this->autodiscovery_cache_duration = (int) $seconds;
+ }
+
+ /**
+ * Set the file system location where the cached files should be stored
+ *
+ * @param string $location The file system location.
+ */
+ public function set_cache_location($location = './cache')
+ {
+ $this->cache_location = (string) $location;
+ }
+
+ /**
+ * Return the filename (i.e. hash, without path and without extension) of the file to cache a given URL.
+ * @param string $url The URL of the feed to be cached.
+ * @return string A filename (i.e. hash, without path and without extension).
+ */
+ public function get_cache_filename($url)
+ {
+ // Append custom parameters to the URL to avoid cache pollution in case of multiple calls with different parameters.
+ $url .= $this->force_feed ? '#force_feed' : '';
+ $options = array();
+ if ($this->timeout != 10)
+ {
+ $options[CURLOPT_TIMEOUT] = $this->timeout;
+ }
+ if ($this->useragent !== SIMPLEPIE_USERAGENT)
+ {
+ $options[CURLOPT_USERAGENT] = $this->useragent;
+ }
+ if (!empty($this->curl_options))
+ {
+ foreach ($this->curl_options as $k => $v)
+ {
+ $options[$k] = $v;
+ }
+ }
+ if (!empty($options))
+ {
+ ksort($options);
+ $url .= '#' . urlencode(var_export($options, true));
+ }
+ return call_user_func($this->cache_name_function, $url);
+ }
+
+ /**
+ * Set whether feed items should be sorted into reverse chronological order
+ *
+ * @param bool $enable Sort as reverse chronological order.
+ */
+ public function enable_order_by_date($enable = true)
+ {
+ $this->order_by_date = (bool) $enable;
+ }
+
+ /**
+ * Set the character encoding used to parse the feed
+ *
+ * This overrides the encoding reported by the feed, however it will fall
+ * back to the normal encoding detection if the override fails
+ *
+ * @param string $encoding Character encoding
+ */
+ public function set_input_encoding($encoding = false)
+ {
+ if ($encoding)
+ {
+ $this->input_encoding = (string) $encoding;
+ }
+ else
+ {
+ $this->input_encoding = false;
+ }
+ }
+
+ /**
+ * Set how much feed autodiscovery to do
+ *
+ * @see SIMPLEPIE_LOCATOR_NONE
+ * @see SIMPLEPIE_LOCATOR_AUTODISCOVERY
+ * @see SIMPLEPIE_LOCATOR_LOCAL_EXTENSION
+ * @see SIMPLEPIE_LOCATOR_LOCAL_BODY
+ * @see SIMPLEPIE_LOCATOR_REMOTE_EXTENSION
+ * @see SIMPLEPIE_LOCATOR_REMOTE_BODY
+ * @see SIMPLEPIE_LOCATOR_ALL
+ * @param int $level Feed Autodiscovery Level (level can be a combination of the above constants, see bitwise OR operator)
+ */
+ public function set_autodiscovery_level($level = SIMPLEPIE_LOCATOR_ALL)
+ {
+ $this->autodiscovery = (int) $level;
+ }
+
+ /**
+ * Get the class registry
+ *
+ * Use this to override SimplePie's default classes
+ * @see SimplePie_Registry
+ * @return SimplePie_Registry
+ */
+ public function &get_registry()
+ {
+ return $this->registry;
+ }
+
+ /**#@+
+ * Useful when you are overloading or extending SimplePie's default classes.
+ *
+ * @deprecated Use {@see get_registry()} instead
+ * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
+ * @param string $class Name of custom class
+ * @return boolean True on success, false otherwise
+ */
+ /**
+ * Set which class SimplePie uses for caching
+ */
+ public function set_cache_class($class = 'SimplePie_Cache')
+ {
+ return $this->registry->register('Cache', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for auto-discovery
+ */
+ public function set_locator_class($class = 'SimplePie_Locator')
+ {
+ return $this->registry->register('Locator', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for XML parsing
+ */
+ public function set_parser_class($class = 'SimplePie_Parser')
+ {
+ return $this->registry->register('Parser', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for remote file fetching
+ */
+ public function set_file_class($class = 'SimplePie_File')
+ {
+ return $this->registry->register('File', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for data sanitization
+ */
+ public function set_sanitize_class($class = 'SimplePie_Sanitize')
+ {
+ return $this->registry->register('Sanitize', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for handling feed items
+ */
+ public function set_item_class($class = 'SimplePie_Item')
+ {
+ return $this->registry->register('Item', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for handling author data
+ */
+ public function set_author_class($class = 'SimplePie_Author')
+ {
+ return $this->registry->register('Author', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for handling category data
+ */
+ public function set_category_class($class = 'SimplePie_Category')
+ {
+ return $this->registry->register('Category', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for feed enclosures
+ */
+ public function set_enclosure_class($class = 'SimplePie_Enclosure')
+ {
+ return $this->registry->register('Enclosure', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for `` captions
+ */
+ public function set_caption_class($class = 'SimplePie_Caption')
+ {
+ return $this->registry->register('Caption', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for ``
+ */
+ public function set_copyright_class($class = 'SimplePie_Copyright')
+ {
+ return $this->registry->register('Copyright', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for ``
+ */
+ public function set_credit_class($class = 'SimplePie_Credit')
+ {
+ return $this->registry->register('Credit', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for ``
+ */
+ public function set_rating_class($class = 'SimplePie_Rating')
+ {
+ return $this->registry->register('Rating', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for ``
+ */
+ public function set_restriction_class($class = 'SimplePie_Restriction')
+ {
+ return $this->registry->register('Restriction', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses for content-type sniffing
+ */
+ public function set_content_type_sniffer_class($class = 'SimplePie_Content_Type_Sniffer')
+ {
+ return $this->registry->register('Content_Type_Sniffer', $class, true);
+ }
+
+ /**
+ * Set which class SimplePie uses item sources
+ */
+ public function set_source_class($class = 'SimplePie_Source')
+ {
+ return $this->registry->register('Source', $class, true);
+ }
+ /**#@-*/
+
+ /**
+ * Set the user agent string
+ *
+ * @param string $ua New user agent string.
+ */
+ public function set_useragent($ua = SIMPLEPIE_USERAGENT)
+ {
+ $this->useragent = (string) $ua;
+ }
+
+ /**
+ * Set callback function to create cache filename with
+ *
+ * @param mixed $function Callback function
+ */
+ public function set_cache_name_function($function = 'md5')
+ {
+ if (is_callable($function))
+ {
+ $this->cache_name_function = $function;
+ }
+ }
+
+ /**
+ * Set options to make SP as fast as possible
+ *
+ * Forgoes a substantial amount of data sanitization in favor of speed. This
+ * turns SimplePie into a dumb parser of feeds.
+ *
+ * @param bool $set Whether to set them or not
+ */
+ public function set_stupidly_fast($set = false)
+ {
+ if ($set)
+ {
+ $this->enable_order_by_date(false);
+ $this->remove_div(false);
+ $this->strip_comments(false);
+ $this->strip_htmltags(false);
+ $this->strip_attributes(false);
+ $this->add_attributes(false);
+ $this->set_image_handler(false);
+ $this->set_https_domains(array());
+ }
+ }
+
+ /**
+ * Set maximum number of feeds to check with autodiscovery
+ *
+ * @param int $max Maximum number of feeds to check
+ */
+ public function set_max_checked_feeds($max = 10)
+ {
+ $this->max_checked_feeds = (int) $max;
+ }
+
+ public function remove_div($enable = true)
+ {
+ $this->sanitize->remove_div($enable);
+ }
+
+ public function strip_htmltags($tags = '', $encode = null)
+ {
+ if ($tags === '')
+ {
+ $tags = $this->strip_htmltags;
+ }
+ $this->sanitize->strip_htmltags($tags);
+ if ($encode !== null)
+ {
+ $this->sanitize->encode_instead_of_strip($tags);
+ }
+ }
+
+ public function encode_instead_of_strip($enable = true)
+ {
+ $this->sanitize->encode_instead_of_strip($enable);
+ }
+
+ public function rename_attributes($attribs = '')
+ {
+ if ($attribs === '')
+ {
+ $attribs = $this->rename_attributes;
+ }
+ $this->sanitize->rename_attributes($attribs);
+ }
+
+ public function strip_attributes($attribs = '')
+ {
+ if ($attribs === '')
+ {
+ $attribs = $this->strip_attributes;
+ }
+ $this->sanitize->strip_attributes($attribs);
+ }
+
+ public function add_attributes($attribs = '')
+ {
+ if ($attribs === '')
+ {
+ $attribs = $this->add_attributes;
+ }
+ $this->sanitize->add_attributes($attribs);
+ }
+
+ /**
+ * Set the output encoding
+ *
+ * Allows you to override SimplePie's output to match that of your webpage.
+ * This is useful for times when your webpages are not being served as
+ * UTF-8. This setting will be obeyed by {@see handle_content_type()}, and
+ * is similar to {@see set_input_encoding()}.
+ *
+ * It should be noted, however, that not all character encodings can support
+ * all characters. If your page is being served as ISO-8859-1 and you try
+ * to display a Japanese feed, you'll likely see garbled characters.
+ * Because of this, it is highly recommended to ensure that your webpages
+ * are served as UTF-8.
+ *
+ * The number of supported character encodings depends on whether your web
+ * host supports {@link http://php.net/mbstring mbstring},
+ * {@link http://php.net/iconv iconv}, or both. See
+ * {@link http://simplepie.org/wiki/faq/Supported_Character_Encodings} for
+ * more information.
+ *
+ * @param string $encoding
+ */
+ public function set_output_encoding($encoding = 'UTF-8')
+ {
+ $this->sanitize->set_output_encoding($encoding);
+ }
+
+ public function strip_comments($strip = false)
+ {
+ $this->sanitize->strip_comments($strip);
+ }
+
+ /**
+ * Set element/attribute key/value pairs of HTML attributes
+ * containing URLs that need to be resolved relative to the feed
+ *
+ * Defaults to |a|@href, |area|@href, |blockquote|@cite, |del|@cite,
+ * |form|@action, |img|@longdesc, |img|@src, |input|@src, |ins|@cite,
+ * |q|@cite
+ *
+ * @since 1.0
+ * @param array|null $element_attribute Element/attribute key/value pairs, null for default
+ */
+ public function set_url_replacements($element_attribute = null)
+ {
+ $this->sanitize->set_url_replacements($element_attribute);
+ }
+
+ /**
+ * Set the list of domains for which to force HTTPS.
+ * @see SimplePie_Sanitize::set_https_domains()
+ * @param array List of HTTPS domains. Example array('biz', 'example.com', 'example.org', 'www.example.net').
+ */
+ public function set_https_domains($domains = array())
+ {
+ if (is_array($domains))
+ {
+ $this->sanitize->set_https_domains($domains);
+ }
+ }
+
+ /**
+ * Set the handler to enable the display of cached images.
+ *
+ * @param string $page Web-accessible path to the handler_image.php file.
+ * @param string $qs The query string that the value should be passed to.
+ */
+ public function set_image_handler($page = false, $qs = 'i')
+ {
+ if ($page !== false)
+ {
+ $this->sanitize->set_image_handler($page . '?' . $qs . '=');
+ }
+ else
+ {
+ $this->image_handler = '';
+ }
+ }
+
+ /**
+ * Set the limit for items returned per-feed with multifeeds
+ *
+ * @param integer $limit The maximum number of items to return.
+ */
+ public function set_item_limit($limit = 0)
+ {
+ $this->item_limit = (int) $limit;
+ }
+
+ /**
+ * Enable throwing exceptions
+ *
+ * @param boolean $enable Should we throw exceptions, or use the old-style error property?
+ */
+ public function enable_exceptions($enable = true)
+ {
+ $this->enable_exceptions = $enable;
+ }
+
+ /**
+ * Initialize the feed object
+ *
+ * This is what makes everything happen. Period. This is where all of the
+ * configuration options get processed, feeds are fetched, cached, and
+ * parsed, and all of that other good stuff.
+ *
+ * @return boolean True if successful, false otherwise
+ */
+ public function init()
+ {
+ // Check absolute bare minimum requirements.
+ if (!extension_loaded('xml') || !extension_loaded('pcre'))
+ {
+ $this->error = 'XML or PCRE extensions not loaded!';
+ return false;
+ }
+ // Then check the xml extension is sane (i.e., libxml 2.7.x issue on PHP < 5.2.9 and libxml 2.7.0 to 2.7.2 on any version) if we don't have xmlreader.
+ elseif (!extension_loaded('xmlreader'))
+ {
+ static $xml_is_sane = null;
+ if ($xml_is_sane === null)
+ {
+ $parser_check = xml_parser_create();
+ xml_parse_into_struct($parser_check, '& ', $values);
+ xml_parser_free($parser_check);
+ $xml_is_sane = isset($values[0]['value']);
+ }
+ if (!$xml_is_sane)
+ {
+ return false;
+ }
+ }
+
+ // The default sanitize class gets set in the constructor, check if it has
+ // changed.
+ if ($this->registry->get_class('Sanitize') !== 'SimplePie_Sanitize') {
+ $this->sanitize = $this->registry->create('Sanitize');
+ }
+ if (method_exists($this->sanitize, 'set_registry'))
+ {
+ $this->sanitize->set_registry($this->registry);
+ }
+
+ // Pass whatever was set with config options over to the sanitizer.
+ // Pass the classes in for legacy support; new classes should use the registry instead
+ $this->sanitize->pass_cache_data($this->cache, $this->cache_location, $this->cache_name_function, $this->registry->get_class('Cache'));
+ $this->sanitize->pass_file_data($this->registry->get_class('File'), $this->timeout, $this->useragent, $this->force_fsockopen, $this->curl_options);
+
+ if (!empty($this->multifeed_url))
+ {
+ $i = 0;
+ $success = 0;
+ $this->multifeed_objects = array();
+ $this->error = array();
+ foreach ($this->multifeed_url as $url)
+ {
+ $this->multifeed_objects[$i] = clone $this;
+ $this->multifeed_objects[$i]->set_feed_url($url);
+ $single_success = $this->multifeed_objects[$i]->init();
+ $success |= $single_success;
+ if (!$single_success)
+ {
+ $this->error[$i] = $this->multifeed_objects[$i]->error();
+ }
+ $i++;
+ }
+ return (bool) $success;
+ }
+ elseif ($this->feed_url === null && $this->raw_data === null)
+ {
+ return false;
+ }
+
+ $this->error = null;
+ $this->data = array();
+ $this->check_modified = false;
+ $this->multifeed_objects = array();
+ $cache = false;
+
+ if ($this->feed_url !== null)
+ {
+ $parsed_feed_url = $this->registry->call('Misc', 'parse_url', array($this->feed_url));
+
+ // Decide whether to enable caching
+ if ($this->cache && $parsed_feed_url['scheme'] !== '')
+ {
+ $filename = $this->get_cache_filename($this->feed_url);
+ $cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, $filename, 'spc'));
+ }
+
+ // Fetch the data via SimplePie_File into $this->raw_data
+ if (($fetched = $this->fetch_data($cache)) === true)
+ {
+ return true;
+ }
+ elseif ($fetched === false) {
+ return false;
+ }
+
+ list($headers, $sniffed) = $fetched;
+ }
+
+ // Empty response check
+ if(empty($this->raw_data)){
+ $this->error = "A feed could not be found at `$this->feed_url`. Empty body.";
+ $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__));
+ return false;
+ }
+
+ // Set up array of possible encodings
+ $encodings = array();
+
+ // First check to see if input has been overridden.
+ if ($this->input_encoding !== false)
+ {
+ $encodings[] = strtoupper($this->input_encoding);
+ }
+
+ $application_types = array('application/xml', 'application/xml-dtd', 'application/xml-external-parsed-entity');
+ $text_types = array('text/xml', 'text/xml-external-parsed-entity');
+
+ // RFC 3023 (only applies to sniffed content)
+ if (isset($sniffed))
+ {
+ if (in_array($sniffed, $application_types) || substr($sniffed, 0, 12) === 'application/' && substr($sniffed, -4) === '+xml')
+ {
+ if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset))
+ {
+ $encodings[] = strtoupper($charset[1]);
+ }
+ $encodings = array_merge($encodings, $this->registry->call('Misc', 'xml_encoding', array($this->raw_data, &$this->registry)));
+ $encodings[] = 'UTF-8';
+ }
+ elseif (in_array($sniffed, $text_types) || substr($sniffed, 0, 5) === 'text/' && substr($sniffed, -4) === '+xml')
+ {
+ if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset))
+ {
+ $encodings[] = strtoupper($charset[1]);
+ }
+ $encodings[] = 'US-ASCII';
+ }
+ // Text MIME-type default
+ elseif (substr($sniffed, 0, 5) === 'text/')
+ {
+ $encodings[] = 'UTF-8';
+ }
+ }
+
+ // Fallback to XML 1.0 Appendix F.1/UTF-8/ISO-8859-1
+ $encodings = array_merge($encodings, $this->registry->call('Misc', 'xml_encoding', array($this->raw_data, &$this->registry)));
+ $encodings[] = 'UTF-8';
+ $encodings[] = 'ISO-8859-1';
+
+ // There's no point in trying an encoding twice
+ $encodings = array_unique($encodings);
+
+ // Loop through each possible encoding, till we return something, or run out of possibilities
+ foreach ($encodings as $encoding)
+ {
+ // Change the encoding to UTF-8 (as we always use UTF-8 internally)
+ if ($utf8_data = $this->registry->call('Misc', 'change_encoding', array($this->raw_data, $encoding, 'UTF-8')))
+ {
+ // Create new parser
+ $parser = $this->registry->create('Parser');
+
+ // If it's parsed fine
+ if ($parser->parse($utf8_data, 'UTF-8', $this->permanent_url))
+ {
+ $this->data = $parser->get_data();
+ if (!($this->get_type() & ~SIMPLEPIE_TYPE_NONE))
+ {
+ $this->error = "A feed could not be found at `$this->feed_url`. This does not appear to be a valid RSS or Atom feed.";
+ $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__));
+ return false;
+ }
+
+ if (isset($headers))
+ {
+ $this->data['headers'] = $headers;
+ }
+ $this->data['build'] = SIMPLEPIE_BUILD;
+
+ // Cache the file if caching is enabled
+ if ($cache && !$cache->save($this))
+ {
+ trigger_error("$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING);
+ }
+ return true;
+ }
+ }
+ }
+
+ if (isset($parser))
+ {
+ // We have an error, just set SimplePie_Misc::error to it and quit
+ $this->error = $this->feed_url;
+ $this->error .= sprintf(' is invalid XML, likely due to invalid characters. XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column());
+ }
+ else
+ {
+ $this->error = 'The data could not be converted to UTF-8.';
+ if (!extension_loaded('mbstring') && !extension_loaded('iconv') && !class_exists('\UConverter')) {
+ $this->error .= ' You MUST have either the iconv, mbstring or intl (PHP 5.5+) extension installed and enabled.';
+ } else {
+ $missingExtensions = array();
+ if (!extension_loaded('iconv')) {
+ $missingExtensions[] = 'iconv';
+ }
+ if (!extension_loaded('mbstring')) {
+ $missingExtensions[] = 'mbstring';
+ }
+ if (!class_exists('\UConverter')) {
+ $missingExtensions[] = 'intl (PHP 5.5+)';
+ }
+ $this->error .= ' Try installing/enabling the ' . implode(' or ', $missingExtensions) . ' extension.';
+ }
+ }
+
+ $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__));
+
+ return false;
+ }
+
+ /**
+ * Fetch the data via SimplePie_File
+ *
+ * If the data is already cached, attempt to fetch it from there instead
+ * @param SimplePie_Cache_Base|false $cache Cache handler, or false to not load from the cache
+ * @return array|true Returns true if the data was loaded from the cache, or an array of HTTP headers and sniffed type
+ */
+ protected function fetch_data(&$cache)
+ {
+ // If it's enabled, use the cache
+ if ($cache)
+ {
+ // Load the Cache
+ $this->data = $cache->load();
+ if (!empty($this->data))
+ {
+ // If the cache is for an outdated build of SimplePie
+ if (!isset($this->data['build']) || $this->data['build'] !== SIMPLEPIE_BUILD)
+ {
+ $cache->unlink();
+ $this->data = array();
+ }
+ // If we've hit a collision just rerun it with caching disabled
+ elseif (isset($this->data['url']) && $this->data['url'] !== $this->feed_url)
+ {
+ $cache = false;
+ $this->data = array();
+ }
+ // If we've got a non feed_url stored (if the page isn't actually a feed, or is a redirect) use that URL.
+ elseif (isset($this->data['feed_url']))
+ {
+ // If the autodiscovery cache is still valid use it.
+ if ($cache->mtime() + $this->autodiscovery_cache_duration > time())
+ {
+ // Do not need to do feed autodiscovery yet.
+ if ($this->data['feed_url'] !== $this->data['url'])
+ {
+ $this->set_feed_url($this->data['feed_url']);
+ return $this->init();
+ }
+
+ $cache->unlink();
+ $this->data = array();
+ }
+ }
+ // Check if the cache has been updated
+ elseif ($cache->mtime() + $this->cache_duration < time())
+ {
+ // Want to know if we tried to send last-modified and/or etag headers
+ // when requesting this file. (Note that it's up to the file to
+ // support this, but we don't always send the headers either.)
+ $this->check_modified = true;
+ if (isset($this->data['headers']['last-modified']) || isset($this->data['headers']['etag']))
+ {
+ $headers = array(
+ 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',
+ );
+ if (isset($this->data['headers']['last-modified']))
+ {
+ $headers['if-modified-since'] = $this->data['headers']['last-modified'];
+ }
+ if (isset($this->data['headers']['etag']))
+ {
+ $headers['if-none-match'] = $this->data['headers']['etag'];
+ }
+
+ $file = $this->registry->create('File', array($this->feed_url, $this->timeout/10, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options));
+ $this->status_code = $file->status_code;
+
+ if ($file->success)
+ {
+ if ($file->status_code === 304)
+ {
+ // Set raw_data to false here too, to signify that the cache
+ // is still valid.
+ $this->raw_data = false;
+ $cache->touch();
+ return true;
+ }
+ }
+ else
+ {
+ $this->check_modified = false;
+ if($this->force_cache_fallback)
+ {
+ $cache->touch();
+ return true;
+ }
+
+ unset($file);
+ }
+ }
+ }
+ // If the cache is still valid, just return true
+ else
+ {
+ $this->raw_data = false;
+ return true;
+ }
+ }
+ // If the cache is empty, delete it
+ else
+ {
+ $cache->unlink();
+ $this->data = array();
+ }
+ }
+ // If we don't already have the file (it'll only exist if we've opened it to check if the cache has been modified), open it.
+ if (!isset($file))
+ {
+ if ($this->file instanceof SimplePie_File && $this->file->url === $this->feed_url)
+ {
+ $file =& $this->file;
+ }
+ else
+ {
+ $headers = array(
+ 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',
+ );
+ $file = $this->registry->create('File', array($this->feed_url, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options));
+ }
+ }
+ $this->status_code = $file->status_code;
+
+ // If the file connection has an error, set SimplePie::error to that and quit
+ if (!$file->success && !($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)))
+ {
+ $this->error = $file->error;
+ return !empty($this->data);
+ }
+
+ if (!$this->force_feed)
+ {
+ // Check if the supplied URL is a feed, if it isn't, look for it.
+ $locate = $this->registry->create('Locator', array(&$file, $this->timeout, $this->useragent, $this->max_checked_feeds, $this->force_fsockopen, $this->curl_options));
+
+ if (!$locate->is_feed($file))
+ {
+ $copyStatusCode = $file->status_code;
+ $copyContentType = $file->headers['content-type'];
+ try
+ {
+ $microformats = false;
+ if (class_exists('DOMXpath') && function_exists('Mf2\parse')) {
+ $doc = new DOMDocument();
+ @$doc->loadHTML($file->body);
+ $xpath = new DOMXpath($doc);
+ // Check for both h-feed and h-entry, as both a feed with no entries
+ // and a list of entries without an h-feed wrapper are both valid.
+ $query = '//*[contains(concat(" ", @class, " "), " h-feed ") or '.
+ 'contains(concat(" ", @class, " "), " h-entry ")]';
+ $result = $xpath->query($query);
+ $microformats = $result->length !== 0;
+ }
+ // Now also do feed discovery, but if microformats were found don't
+ // overwrite the current value of file.
+ $discovered = $locate->find($this->autodiscovery,
+ $this->all_discovered_feeds);
+ if ($microformats)
+ {
+ if ($hub = $locate->get_rel_link('hub'))
+ {
+ $self = $locate->get_rel_link('self');
+ $this->store_links($file, $hub, $self);
+ }
+ // Push the current file onto all_discovered feeds so the user can
+ // be shown this as one of the options.
+ if (isset($this->all_discovered_feeds)) {
+ $this->all_discovered_feeds[] = $file;
+ }
+ }
+ else
+ {
+ if ($discovered)
+ {
+ $file = $discovered;
+ }
+ else
+ {
+ // We need to unset this so that if SimplePie::set_file() has
+ // been called that object is untouched
+ unset($file);
+ $this->error = "A feed could not be found at `$this->feed_url`; the status code is `$copyStatusCode` and content-type is `$copyContentType`";
+ $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__));
+ return false;
+ }
+ }
+ }
+ catch (SimplePie_Exception $e)
+ {
+ // We need to unset this so that if SimplePie::set_file() has been called that object is untouched
+ unset($file);
+ // This is usually because DOMDocument doesn't exist
+ $this->error = $e->getMessage();
+ $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, $e->getFile(), $e->getLine()));
+ return false;
+ }
+ if ($cache)
+ {
+ $this->data = array('url' => $this->feed_url, 'feed_url' => $file->url, 'build' => SIMPLEPIE_BUILD);
+ if (!$cache->save($this))
+ {
+ trigger_error("$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING);
+ }
+ $cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, call_user_func($this->cache_name_function, $file->url), 'spc'));
+ }
+ }
+ $this->feed_url = $file->url;
+ $locate = null;
+ }
+
+ $this->raw_data = $file->body;
+ $this->permanent_url = $file->permanent_url;
+ $headers = $file->headers;
+ $sniffer = $this->registry->create('Content_Type_Sniffer', array(&$file));
+ $sniffed = $sniffer->get_type();
+
+ return array($headers, $sniffed);
+ }
+
+ /**
+ * Get the error message for the occurred error
+ *
+ * @return string|array Error message, or array of messages for multifeeds
+ */
+ public function error()
+ {
+ return $this->error;
+ }
+
+ /**
+ * Get the last HTTP status code
+ *
+ * @return int Status code
+ */
+ public function status_code()
+ {
+ return $this->status_code;
+ }
+
+ /**
+ * Get the raw XML
+ *
+ * This is the same as the old `$feed->enable_xml_dump(true)`, but returns
+ * the data instead of printing it.
+ *
+ * @return string|boolean Raw XML data, false if the cache is used
+ */
+ public function get_raw_data()
+ {
+ return $this->raw_data;
+ }
+
+ /**
+ * Get the character encoding used for output
+ *
+ * @since Preview Release
+ * @return string
+ */
+ public function get_encoding()
+ {
+ return $this->sanitize->output_encoding;
+ }
+
+ /**
+ * Send the content-type header with correct encoding
+ *
+ * This method ensures that the SimplePie-enabled page is being served with
+ * the correct {@link http://www.iana.org/assignments/media-types/ mime-type}
+ * and character encoding HTTP headers (character encoding determined by the
+ * {@see set_output_encoding} config option).
+ *
+ * This won't work properly if any content or whitespace has already been
+ * sent to the browser, because it relies on PHP's
+ * {@link http://php.net/header header()} function, and these are the
+ * circumstances under which the function works.
+ *
+ * Because it's setting these settings for the entire page (as is the nature
+ * of HTTP headers), this should only be used once per page (again, at the
+ * top).
+ *
+ * @param string $mime MIME type to serve the page as
+ */
+ public function handle_content_type($mime = 'text/html')
+ {
+ if (!headers_sent())
+ {
+ $header = "Content-type: $mime;";
+ if ($this->get_encoding())
+ {
+ $header .= ' charset=' . $this->get_encoding();
+ }
+ else
+ {
+ $header .= ' charset=UTF-8';
+ }
+ header($header);
+ }
+ }
+
+ /**
+ * Get the type of the feed
+ *
+ * This returns a SIMPLEPIE_TYPE_* constant, which can be tested against
+ * using {@link http://php.net/language.operators.bitwise bitwise operators}
+ *
+ * @since 0.8 (usage changed to using constants in 1.0)
+ * @see SIMPLEPIE_TYPE_NONE Unknown.
+ * @see SIMPLEPIE_TYPE_RSS_090 RSS 0.90.
+ * @see SIMPLEPIE_TYPE_RSS_091_NETSCAPE RSS 0.91 (Netscape).
+ * @see SIMPLEPIE_TYPE_RSS_091_USERLAND RSS 0.91 (Userland).
+ * @see SIMPLEPIE_TYPE_RSS_091 RSS 0.91.
+ * @see SIMPLEPIE_TYPE_RSS_092 RSS 0.92.
+ * @see SIMPLEPIE_TYPE_RSS_093 RSS 0.93.
+ * @see SIMPLEPIE_TYPE_RSS_094 RSS 0.94.
+ * @see SIMPLEPIE_TYPE_RSS_10 RSS 1.0.
+ * @see SIMPLEPIE_TYPE_RSS_20 RSS 2.0.x.
+ * @see SIMPLEPIE_TYPE_RSS_RDF RDF-based RSS.
+ * @see SIMPLEPIE_TYPE_RSS_SYNDICATION Non-RDF-based RSS (truly intended as syndication format).
+ * @see SIMPLEPIE_TYPE_RSS_ALL Any version of RSS.
+ * @see SIMPLEPIE_TYPE_ATOM_03 Atom 0.3.
+ * @see SIMPLEPIE_TYPE_ATOM_10 Atom 1.0.
+ * @see SIMPLEPIE_TYPE_ATOM_ALL Any version of Atom.
+ * @see SIMPLEPIE_TYPE_ALL Any known/supported feed type.
+ * @return int SIMPLEPIE_TYPE_* constant
+ */
+ public function get_type()
+ {
+ if (!isset($this->data['type']))
+ {
+ $this->data['type'] = SIMPLEPIE_TYPE_ALL;
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed']))
+ {
+ $this->data['type'] &= SIMPLEPIE_TYPE_ATOM_10;
+ }
+ elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed']))
+ {
+ $this->data['type'] &= SIMPLEPIE_TYPE_ATOM_03;
+ }
+ elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF']))
+ {
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['channel'])
+ || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['image'])
+ || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item'])
+ || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_10]['textinput']))
+ {
+ $this->data['type'] &= SIMPLEPIE_TYPE_RSS_10;
+ }
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['channel'])
+ || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['image'])
+ || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item'])
+ || isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_090]['textinput']))
+ {
+ $this->data['type'] &= SIMPLEPIE_TYPE_RSS_090;
+ }
+ }
+ elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss']))
+ {
+ $this->data['type'] &= SIMPLEPIE_TYPE_RSS_ALL;
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version']))
+ {
+ switch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version']))
+ {
+ case '0.91':
+ $this->data['type'] &= SIMPLEPIE_TYPE_RSS_091;
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data']))
+ {
+ switch (trim($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['skiphours']['hour'][0]['data']))
+ {
+ case '0':
+ $this->data['type'] &= SIMPLEPIE_TYPE_RSS_091_NETSCAPE;
+ break;
+
+ case '24':
+ $this->data['type'] &= SIMPLEPIE_TYPE_RSS_091_USERLAND;
+ break;
+ }
+ }
+ break;
+
+ case '0.92':
+ $this->data['type'] &= SIMPLEPIE_TYPE_RSS_092;
+ break;
+
+ case '0.93':
+ $this->data['type'] &= SIMPLEPIE_TYPE_RSS_093;
+ break;
+
+ case '0.94':
+ $this->data['type'] &= SIMPLEPIE_TYPE_RSS_094;
+ break;
+
+ case '2.0':
+ $this->data['type'] &= SIMPLEPIE_TYPE_RSS_20;
+ break;
+ }
+ }
+ }
+ else
+ {
+ $this->data['type'] = SIMPLEPIE_TYPE_NONE;
+ }
+ }
+ return $this->data['type'];
+ }
+
+ /**
+ * Get the URL for the feed
+ *
+ * When the 'permanent' mode is enabled, returns the original feed URL,
+ * except in the case of an `HTTP 301 Moved Permanently` status response,
+ * in which case the location of the first redirection is returned.
+ *
+ * When the 'permanent' mode is disabled (default),
+ * may or may not be different from the URL passed to {@see set_feed_url()},
+ * depending on whether auto-discovery was used, and whether there were
+ * any redirects along the way.
+ *
+ * @since Preview Release (previously called `get_feed_url()` since SimplePie 0.8.)
+ * @todo Support
+ * @todo Also, |atom:link|@rel=self
+ * @param bool $permanent Permanent mode to return only the original URL or the first redirection
+ * iff it is a 301 redirection
+ * @return string|null
+ */
+ public function subscribe_url($permanent = false)
+ {
+ if ($permanent)
+ {
+ if ($this->permanent_url !== null)
+ {
+ // sanitize encodes ampersands which are required when used in a url.
+ return str_replace('&', '&',
+ $this->sanitize($this->permanent_url,
+ SIMPLEPIE_CONSTRUCT_IRI));
+ }
+ }
+ else
+ {
+ if ($this->feed_url !== null)
+ {
+ return str_replace('&', '&',
+ $this->sanitize($this->feed_url,
+ SIMPLEPIE_CONSTRUCT_IRI));
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get data for an feed-level element
+ *
+ * This method allows you to get access to ANY element/attribute that is a
+ * sub-element of the opening feed tag.
+ *
+ * The return value is an indexed array of elements matching the given
+ * namespace and tag name. Each element has `attribs`, `data` and `child`
+ * subkeys. For `attribs` and `child`, these contain namespace subkeys.
+ * `attribs` then has one level of associative name => value data (where
+ * `value` is a string) after the namespace. `child` has tag-indexed keys
+ * after the namespace, each member of which is an indexed array matching
+ * this same format.
+ *
+ * For example:
+ *
+ * // This is probably a bad example because we already support
+ * // natively, but it shows you how to parse through
+ * // the nodes.
+ * $group = $item->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group');
+ * $content = $group[0]['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'];
+ * $file = $content[0]['attribs']['']['url'];
+ * echo $file;
+ *
+ *
+ * @since 1.0
+ * @see http://simplepie.org/wiki/faq/supported_xml_namespaces
+ * @param string $namespace The URL of the XML namespace of the elements you're trying to access
+ * @param string $tag Tag name
+ * @return array
+ */
+ public function get_feed_tags($namespace, $tag)
+ {
+ $type = $this->get_type();
+ if ($type & SIMPLEPIE_TYPE_ATOM_10)
+ {
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag]))
+ {
+ return $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag];
+ }
+ }
+ if ($type & SIMPLEPIE_TYPE_ATOM_03)
+ {
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag]))
+ {
+ return $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag];
+ }
+ }
+ if ($type & SIMPLEPIE_TYPE_RSS_RDF)
+ {
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag]))
+ {
+ return $this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag];
+ }
+ }
+ if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)
+ {
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag]))
+ {
+ return $this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag];
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get data for an channel-level element
+ *
+ * This method allows you to get access to ANY element/attribute in the
+ * channel/header section of the feed.
+ *
+ * See {@see SimplePie::get_feed_tags()} for a description of the return value
+ *
+ * @since 1.0
+ * @see http://simplepie.org/wiki/faq/supported_xml_namespaces
+ * @param string $namespace The URL of the XML namespace of the elements you're trying to access
+ * @param string $tag Tag name
+ * @return array
+ */
+ public function get_channel_tags($namespace, $tag)
+ {
+ $type = $this->get_type();
+ if ($type & SIMPLEPIE_TYPE_ATOM_ALL)
+ {
+ if ($return = $this->get_feed_tags($namespace, $tag))
+ {
+ return $return;
+ }
+ }
+ if ($type & SIMPLEPIE_TYPE_RSS_10)
+ {
+ if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'channel'))
+ {
+ if (isset($channel[0]['child'][$namespace][$tag]))
+ {
+ return $channel[0]['child'][$namespace][$tag];
+ }
+ }
+ }
+ if ($type & SIMPLEPIE_TYPE_RSS_090)
+ {
+ if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'channel'))
+ {
+ if (isset($channel[0]['child'][$namespace][$tag]))
+ {
+ return $channel[0]['child'][$namespace][$tag];
+ }
+ }
+ }
+ if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)
+ {
+ if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'channel'))
+ {
+ if (isset($channel[0]['child'][$namespace][$tag]))
+ {
+ return $channel[0]['child'][$namespace][$tag];
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get data for an channel-level element
+ *
+ * This method allows you to get access to ANY element/attribute in the
+ * image/logo section of the feed.
+ *
+ * See {@see SimplePie::get_feed_tags()} for a description of the return value
+ *
+ * @since 1.0
+ * @see http://simplepie.org/wiki/faq/supported_xml_namespaces
+ * @param string $namespace The URL of the XML namespace of the elements you're trying to access
+ * @param string $tag Tag name
+ * @return array
+ */
+ public function get_image_tags($namespace, $tag)
+ {
+ $type = $this->get_type();
+ if ($type & SIMPLEPIE_TYPE_RSS_10)
+ {
+ if ($image = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'image'))
+ {
+ if (isset($image[0]['child'][$namespace][$tag]))
+ {
+ return $image[0]['child'][$namespace][$tag];
+ }
+ }
+ }
+ if ($type & SIMPLEPIE_TYPE_RSS_090)
+ {
+ if ($image = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'image'))
+ {
+ if (isset($image[0]['child'][$namespace][$tag]))
+ {
+ return $image[0]['child'][$namespace][$tag];
+ }
+ }
+ }
+ if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)
+ {
+ if ($image = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'image'))
+ {
+ if (isset($image[0]['child'][$namespace][$tag]))
+ {
+ return $image[0]['child'][$namespace][$tag];
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get the base URL value from the feed
+ *
+ * Uses `` if available, otherwise uses the first link in the
+ * feed, or failing that, the URL of the feed itself.
+ *
+ * @see get_link
+ * @see subscribe_url
+ *
+ * @param array $element
+ * @return string
+ */
+ public function get_base($element = array())
+ {
+ if (!empty($element['xml_base_explicit']) && isset($element['xml_base']))
+ {
+ return $element['xml_base'];
+ }
+ elseif ($this->get_link() !== null)
+ {
+ return $this->get_link();
+ }
+
+ return $this->subscribe_url();
+ }
+
+ /**
+ * Sanitize feed data
+ *
+ * @access private
+ * @see SimplePie_Sanitize::sanitize()
+ * @param string $data Data to sanitize
+ * @param int $type One of the SIMPLEPIE_CONSTRUCT_* constants
+ * @param string $base Base URL to resolve URLs against
+ * @return string Sanitized data
+ */
+ public function sanitize($data, $type, $base = '')
+ {
+ try
+ {
+ return $this->sanitize->sanitize($data, $type, $base);
+ }
+ catch (SimplePie_Exception $e)
+ {
+ if (!$this->enable_exceptions)
+ {
+ $this->error = $e->getMessage();
+ $this->registry->call('Misc', 'error', array($this->error, E_USER_WARNING, $e->getFile(), $e->getLine()));
+ return '';
+ }
+
+ throw $e;
+ }
+ }
+
+ /**
+ * Get the title of the feed
+ *
+ * Uses ``, `` or ``
+ *
+ * @since 1.0 (previously called `get_feed_title` since 0.8)
+ * @return string|null
+ */
+ public function get_title()
+ {
+ if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get a category for the feed
+ *
+ * @since Unknown
+ * @param int $key The category that you want to return. Remember that arrays begin with 0, not 1
+ * @return SimplePie_Category|null
+ */
+ public function get_category($key = 0)
+ {
+ $categories = $this->get_categories();
+ if (isset($categories[$key]))
+ {
+ return $categories[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get all categories for the feed
+ *
+ * Uses ``, `` or ``
+ *
+ * @since Unknown
+ * @return array|null List of {@see SimplePie_Category} objects
+ */
+ public function get_categories()
+ {
+ $categories = array();
+
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
+ {
+ $term = null;
+ $scheme = null;
+ $label = null;
+ if (isset($category['attribs']['']['term']))
+ {
+ $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['scheme']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['label']))
+ {
+ $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories[] = $this->registry->create('Category', array($term, $scheme, $label));
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category)
+ {
+ // This is really the label, but keep this as the term also for BC.
+ // Label will also work on retrieving because that falls back to term.
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ if (isset($category['attribs']['']['domain']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = null;
+ }
+ $categories[] = $this->registry->create('Category', array($term, $scheme, null));
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category)
+ {
+ $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category)
+ {
+ $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
+ }
+
+ if (!empty($categories))
+ {
+ return array_unique($categories);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get an author for the feed
+ *
+ * @since 1.1
+ * @param int $key The author that you want to return. Remember that arrays begin with 0, not 1
+ * @return SimplePie_Author|null
+ */
+ public function get_author($key = 0)
+ {
+ $authors = $this->get_authors();
+ if (isset($authors[$key]))
+ {
+ return $authors[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get all authors for the feed
+ *
+ * Uses ``, ``, `` or ``
+ *
+ * @since 1.1
+ * @return array|null List of {@see SimplePie_Author} objects
+ */
+ public function get_authors()
+ {
+ $authors = array();
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)
+ {
+ $name = null;
+ $uri = null;
+ $email = null;
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
+ {
+ $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
+ {
+ $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
+ }
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
+ {
+ $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $uri !== null)
+ {
+ $authors[] = $this->registry->create('Author', array($name, $uri, $email));
+ }
+ }
+ if ($author = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
+ {
+ $name = null;
+ $url = null;
+ $email = null;
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
+ {
+ $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
+ {
+ $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
+ }
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
+ {
+ $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $url !== null)
+ {
+ $authors[] = $this->registry->create('Author', array($name, $url, $email));
+ }
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author)
+ {
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author)
+ {
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author)
+ {
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
+ }
+
+ if (!empty($authors))
+ {
+ return array_unique($authors);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get a contributor for the feed
+ *
+ * @since 1.1
+ * @param int $key The contrbutor that you want to return. Remember that arrays begin with 0, not 1
+ * @return SimplePie_Author|null
+ */
+ public function get_contributor($key = 0)
+ {
+ $contributors = $this->get_contributors();
+ if (isset($contributors[$key]))
+ {
+ return $contributors[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get all contributors for the feed
+ *
+ * Uses ``
+ *
+ * @since 1.1
+ * @return array|null List of {@see SimplePie_Author} objects
+ */
+ public function get_contributors()
+ {
+ $contributors = array();
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)
+ {
+ $name = null;
+ $uri = null;
+ $email = null;
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
+ {
+ $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
+ {
+ $uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
+ {
+ $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $uri !== null)
+ {
+ $contributors[] = $this->registry->create('Author', array($name, $uri, $email));
+ }
+ }
+ foreach ((array) $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor)
+ {
+ $name = null;
+ $url = null;
+ $email = null;
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
+ {
+ $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
+ {
+ $url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
+ {
+ $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $url !== null)
+ {
+ $contributors[] = $this->registry->create('Author', array($name, $url, $email));
+ }
+ }
+
+ if (!empty($contributors))
+ {
+ return array_unique($contributors);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get a single link for the feed
+ *
+ * @since 1.0 (previously called `get_feed_link` since Preview Release, `get_feed_permalink()` since 0.8)
+ * @param int $key The link that you want to return. Remember that arrays begin with 0, not 1
+ * @param string $rel The relationship of the link to return
+ * @return string|null Link URL
+ */
+ public function get_link($key = 0, $rel = 'alternate')
+ {
+ $links = $this->get_links($rel);
+ if (isset($links[$key]))
+ {
+ return $links[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the permalink for the item
+ *
+ * Returns the first link available with a relationship of "alternate".
+ * Identical to {@see get_link()} with key 0
+ *
+ * @see get_link
+ * @since 1.0 (previously called `get_feed_link` since Preview Release, `get_feed_permalink()` since 0.8)
+ * @internal Added for parity between the parent-level and the item/entry-level.
+ * @return string|null Link URL
+ */
+ public function get_permalink()
+ {
+ return $this->get_link(0);
+ }
+
+ /**
+ * Get all links for the feed
+ *
+ * Uses `` or ` `
+ *
+ * @since Beta 2
+ * @param string $rel The relationship of links to return
+ * @return array|null Links found for the feed (strings)
+ */
+ public function get_links($rel = 'alternate')
+ {
+ if (!isset($this->data['links']))
+ {
+ $this->data['links'] = array();
+ if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link'))
+ {
+ foreach ($links as $link)
+ {
+ if (isset($link['attribs']['']['href']))
+ {
+ $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
+ $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
+ }
+ }
+ }
+ if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link'))
+ {
+ foreach ($links as $link)
+ {
+ if (isset($link['attribs']['']['href']))
+ {
+ $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
+ $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
+
+ }
+ }
+ }
+ if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link'))
+ {
+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
+ }
+ if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link'))
+ {
+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
+ }
+ if ($links = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
+ {
+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
+ }
+
+ $keys = array_keys($this->data['links']);
+ foreach ($keys as $key)
+ {
+ if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
+ {
+ if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
+ {
+ $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);
+ $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];
+ }
+ else
+ {
+ $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
+ }
+ }
+ elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
+ {
+ $this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
+ }
+ $this->data['links'][$key] = array_unique($this->data['links'][$key]);
+ }
+ }
+
+ if (isset($this->data['headers']['link']))
+ {
+ $link_headers = $this->data['headers']['link'];
+ if (is_string($link_headers)) {
+ $link_headers = array($link_headers);
+ }
+ $matches = preg_filter('/<([^>]+)>; rel='.preg_quote($rel).'/', '$1', $link_headers);
+ if (!empty($matches)) {
+ return $matches;
+ }
+ }
+
+ if (isset($this->data['links'][$rel]))
+ {
+ return $this->data['links'][$rel];
+ }
+
+ return null;
+ }
+
+ public function get_all_discovered_feeds()
+ {
+ return $this->all_discovered_feeds;
+ }
+
+ /**
+ * Get the content for the item
+ *
+ * Uses ``, ``, ``,
+ * ``, `` or ``
+ *
+ * @since 1.0 (previously called `get_feed_description()` since 0.8)
+ * @return string|null
+ */
+ public function get_description()
+ {
+ if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle'))
+ {
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'tagline'))
+ {
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the copyright info for the feed
+ *
+ * Uses ``, `` or ``
+ *
+ * @since 1.0 (previously called `get_feed_copyright()` since 0.8)
+ * @return string|null
+ */
+ public function get_copyright()
+ {
+ if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright'))
+ {
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the language for the feed
+ *
+ * Uses ``, ``, or @xml_lang
+ *
+ * @since 1.0 (previously called `get_feed_language()` since 0.8)
+ * @return string|null
+ */
+ public function get_language()
+ {
+ if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_11, 'language'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_DC_10, 'language'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['xml_lang']))
+ {
+ return $this->sanitize($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['xml_lang']))
+ {
+ return $this->sanitize($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['xml_lang']))
+ {
+ return $this->sanitize($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif (isset($this->data['headers']['content-language']))
+ {
+ return $this->sanitize($this->data['headers']['content-language'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the latitude coordinates for the item
+ *
+ * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications
+ *
+ * Uses `` or ``
+ *
+ * @since 1.0
+ * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
+ * @link http://www.georss.org/ GeoRSS
+ * @return string|null
+ */
+ public function get_latitude()
+ {
+
+ if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat'))
+ {
+ return (float) $return[0]['data'];
+ }
+ elseif (($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
+ {
+ return (float) $match[1];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the longitude coordinates for the feed
+ *
+ * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications
+ *
+ * Uses ``, `` or ``
+ *
+ * @since 1.0
+ * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
+ * @link http://www.georss.org/ GeoRSS
+ * @return string|null
+ */
+ public function get_longitude()
+ {
+ if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long'))
+ {
+ return (float) $return[0]['data'];
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon'))
+ {
+ return (float) $return[0]['data'];
+ }
+ elseif (($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
+ {
+ return (float) $match[2];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the feed logo's title
+ *
+ * RSS 0.9.0, 1.0 and 2.0 feeds are allowed to have a "feed logo" title.
+ *
+ * Uses `` or ``
+ *
+ * @return string|null
+ */
+ public function get_image_title()
+ {
+ if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the feed logo's URL
+ *
+ * RSS 0.9.0, 2.0, Atom 1.0, and feeds with iTunes RSS tags are allowed to
+ * have a "feed logo" URL. This points directly to the image itself.
+ *
+ * Uses ``, ``, ``,
+ * `` or ``
+ *
+ * @return string|null
+ */
+ public function get_image_url()
+ {
+ if ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'image'))
+ {
+ return $this->sanitize($return[0]['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'logo'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'url'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'url'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
+ }
+
+ return null;
+ }
+
+
+ /**
+ * Get the feed logo's link
+ *
+ * RSS 0.9.0, 1.0 and 2.0 feeds are allowed to have a "feed logo" link. This
+ * points to a human-readable page that the image should link to.
+ *
+ * Uses ``, ``, ``,
+ * `` or ``
+ *
+ * @return string|null
+ */
+ public function get_image_link()
+ {
+ if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the feed logo's link
+ *
+ * RSS 2.0 feeds are allowed to have a "feed logo" width.
+ *
+ * Uses `` or defaults to 88.0 if no width is specified and
+ * the feed is an RSS 2.0 feed.
+ *
+ * @return int|float|null
+ */
+ public function get_image_width()
+ {
+ if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'width'))
+ {
+ return round($return[0]['data']);
+ }
+ elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
+ {
+ return 88.0;
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the feed logo's height
+ *
+ * RSS 2.0 feeds are allowed to have a "feed logo" height.
+ *
+ * Uses `` or defaults to 31.0 if no height is specified and
+ * the feed is an RSS 2.0 feed.
+ *
+ * @return int|float|null
+ */
+ public function get_image_height()
+ {
+ if ($return = $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'height'))
+ {
+ return round($return[0]['data']);
+ }
+ elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
+ {
+ return 31.0;
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the number of items in the feed
+ *
+ * This is well-suited for {@link http://php.net/for for()} loops with
+ * {@see get_item()}
+ *
+ * @param int $max Maximum value to return. 0 for no limit
+ * @return int Number of items in the feed
+ */
+ public function get_item_quantity($max = 0)
+ {
+ $max = (int) $max;
+ $qty = count($this->get_items());
+ if ($max === 0)
+ {
+ return $qty;
+ }
+
+ return ($qty > $max) ? $max : $qty;
+ }
+
+ /**
+ * Get a single item from the feed
+ *
+ * This is better suited for {@link http://php.net/for for()} loops, whereas
+ * {@see get_items()} is better suited for
+ * {@link http://php.net/foreach foreach()} loops.
+ *
+ * @see get_item_quantity()
+ * @since Beta 2
+ * @param int $key The item that you want to return. Remember that arrays begin with 0, not 1
+ * @return SimplePie_Item|null
+ */
+ public function get_item($key = 0)
+ {
+ $items = $this->get_items();
+ if (isset($items[$key]))
+ {
+ return $items[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get all items from the feed
+ *
+ * This is better suited for {@link http://php.net/for for()} loops, whereas
+ * {@see get_items()} is better suited for
+ * {@link http://php.net/foreach foreach()} loops.
+ *
+ * @see get_item_quantity
+ * @since Beta 2
+ * @param int $start Index to start at
+ * @param int $end Number of items to return. 0 for all items after `$start`
+ * @return SimplePie_Item[]|null List of {@see SimplePie_Item} objects
+ */
+ public function get_items($start = 0, $end = 0)
+ {
+ if (!isset($this->data['items']))
+ {
+ if (!empty($this->multifeed_objects))
+ {
+ $this->data['items'] = SimplePie::merge_items($this->multifeed_objects, $start, $end, $this->item_limit);
+ if (empty($this->data['items']))
+ {
+ return array();
+ }
+ return $this->data['items'];
+ }
+ $this->data['items'] = array();
+ if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'entry'))
+ {
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));
+ }
+ }
+ if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'entry'))
+ {
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));
+ }
+ }
+ if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'item'))
+ {
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));
+ }
+ }
+ if ($items = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'item'))
+ {
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));
+ }
+ }
+ if ($items = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'item'))
+ {
+ $keys = array_keys($items);
+ foreach ($keys as $key)
+ {
+ $this->data['items'][] = $this->registry->create('Item', array($this, $items[$key]));
+ }
+ }
+ }
+
+ if (empty($this->data['items']))
+ {
+ return array();
+ }
+
+ if ($this->order_by_date)
+ {
+ if (!isset($this->data['ordered_items']))
+ {
+ $this->data['ordered_items'] = $this->data['items'];
+ usort($this->data['ordered_items'], array(get_class($this), 'sort_items'));
+ }
+ $items = $this->data['ordered_items'];
+ }
+ else
+ {
+ $items = $this->data['items'];
+ }
+ // Slice the data as desired
+ if ($end === 0)
+ {
+ return array_slice($items, $start);
+ }
+
+ return array_slice($items, $start, $end);
+ }
+
+ /**
+ * Set the favicon handler
+ *
+ * @deprecated Use your own favicon handling instead
+ */
+ public function set_favicon_handler($page = false, $qs = 'i')
+ {
+ $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING;
+ trigger_error('Favicon handling has been removed, please use your own handling', $level);
+ return false;
+ }
+
+ /**
+ * Get the favicon for the current feed
+ *
+ * @deprecated Use your own favicon handling instead
+ */
+ public function get_favicon()
+ {
+ $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING;
+ trigger_error('Favicon handling has been removed, please use your own handling', $level);
+
+ if (($url = $this->get_link()) !== null)
+ {
+ return 'https://www.google.com/s2/favicons?domain=' . urlencode($url);
+ }
+
+ return false;
+ }
+
+ /**
+ * Magic method handler
+ *
+ * @param string $method Method name
+ * @param array $args Arguments to the method
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ if (strpos($method, 'subscribe_') === 0)
+ {
+ $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING;
+ trigger_error('subscribe_*() has been deprecated, implement the callback yourself', $level);
+ return '';
+ }
+ if ($method === 'enable_xml_dump')
+ {
+ $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING;
+ trigger_error('enable_xml_dump() has been deprecated, use get_raw_data() instead', $level);
+ return false;
+ }
+
+ $class = get_class($this);
+ $trace = debug_backtrace();
+ $file = $trace[0]['file'];
+ $line = $trace[0]['line'];
+ trigger_error("Call to undefined method $class::$method() in $file on line $line", E_USER_ERROR);
+ }
+
+ /**
+ * Sorting callback for items
+ *
+ * @access private
+ * @param SimplePie $a
+ * @param SimplePie $b
+ * @return boolean
+ */
+ public static function sort_items($a, $b)
+ {
+ $a_date = $a->get_date('U');
+ $b_date = $b->get_date('U');
+ if ($a_date && $b_date) {
+ return $a_date > $b_date ? -1 : 1;
+ }
+ // Sort items without dates to the top.
+ if ($a_date) {
+ return 1;
+ }
+ if ($b_date) {
+ return -1;
+ }
+ return 0;
+ }
+
+ /**
+ * Merge items from several feeds into one
+ *
+ * If you're merging multiple feeds together, they need to all have dates
+ * for the items or else SimplePie will refuse to sort them.
+ *
+ * @link http://simplepie.org/wiki/tutorial/sort_multiple_feeds_by_time_and_date#if_feeds_require_separate_per-feed_settings
+ * @param array $urls List of SimplePie feed objects to merge
+ * @param int $start Starting item
+ * @param int $end Number of items to return
+ * @param int $limit Maximum number of items per feed
+ * @return array
+ */
+ public static function merge_items($urls, $start = 0, $end = 0, $limit = 0)
+ {
+ if (is_array($urls) && sizeof($urls) > 0)
+ {
+ $items = array();
+ foreach ($urls as $arg)
+ {
+ if ($arg instanceof SimplePie)
+ {
+ $items = array_merge($items, $arg->get_items(0, $limit));
+ }
+ else
+ {
+ trigger_error('Arguments must be SimplePie objects', E_USER_WARNING);
+ }
+ }
+
+ usort($items, array(get_class($urls[0]), 'sort_items'));
+
+ if ($end === 0)
+ {
+ return array_slice($items, $start);
+ }
+
+ return array_slice($items, $start, $end);
+ }
+
+ trigger_error('Cannot merge zero SimplePie objects', E_USER_WARNING);
+ return array();
+ }
+
+ /**
+ * Store PubSubHubbub links as headers
+ *
+ * There is no way to find PuSH links in the body of a microformats feed,
+ * so they are added to the headers when found, to be used later by get_links.
+ * @param SimplePie_File $file
+ * @param string $hub
+ * @param string $self
+ */
+ private function store_links(&$file, $hub, $self) {
+ if (isset($file->headers['link']['hub']) ||
+ (isset($file->headers['link']) &&
+ preg_match('/rel=hub/', $file->headers['link'])))
+ {
+ return;
+ }
+
+ if ($hub)
+ {
+ if (isset($file->headers['link']))
+ {
+ if ($file->headers['link'] !== '')
+ {
+ $file->headers['link'] = ', ';
+ }
+ }
+ else
+ {
+ $file->headers['link'] = '';
+ }
+ $file->headers['link'] .= '<'.$hub.'>; rel=hub';
+ if ($self)
+ {
+ $file->headers['link'] .= ', <'.$self.'>; rel=self';
+ }
+ }
+ }
+}
+
+class_alias('SimplePie', 'SimplePie\SimplePie', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Author.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Author.php
new file mode 100644
index 0000000000..3baadee629
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Author.php
@@ -0,0 +1,151 @@
+name = $name;
+ $this->link = $link;
+ $this->email = $email;
+ }
+
+ /**
+ * String-ified version
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ // There is no $this->data here
+ return md5(serialize($this));
+ }
+
+ /**
+ * Author's name
+ *
+ * @return string|null
+ */
+ public function get_name()
+ {
+ if ($this->name !== null)
+ {
+ return $this->name;
+ }
+
+ return null;
+ }
+
+ /**
+ * Author's link
+ *
+ * @return string|null
+ */
+ public function get_link()
+ {
+ if ($this->link !== null)
+ {
+ return $this->link;
+ }
+
+ return null;
+ }
+
+ /**
+ * Author's email address
+ *
+ * @return string|null
+ */
+ public function get_email()
+ {
+ if ($this->email !== null)
+ {
+ return $this->email;
+ }
+
+ return null;
+ }
+}
+
+class_alias('SimplePie_Author', 'SimplePie\Author', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache.php
new file mode 100644
index 0000000000..88d811660a
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache.php
@@ -0,0 +1,136 @@
+ 'SimplePie_Cache_MySQL',
+ 'memcache' => 'SimplePie_Cache_Memcache',
+ 'memcached' => 'SimplePie_Cache_Memcached',
+ 'redis' => 'SimplePie_Cache_Redis'
+ );
+
+ /**
+ * Don't call the constructor. Please.
+ */
+ private function __construct() { }
+
+ /**
+ * Create a new SimplePie_Cache object
+ *
+ * @param string $location URL location (scheme is used to determine handler)
+ * @param string $filename Unique identifier for cache object
+ * @param string $extension 'spi' or 'spc'
+ * @return SimplePie_Cache_Base Type of object depends on scheme of `$location`
+ */
+ public static function get_handler($location, $filename, $extension)
+ {
+ $type = explode(':', $location, 2);
+ $type = $type[0];
+ if (!empty(self::$handlers[$type]))
+ {
+ $class = self::$handlers[$type];
+ return new $class($location, $filename, $extension);
+ }
+
+ return new SimplePie_Cache_File($location, $filename, $extension);
+ }
+
+ /**
+ * Create a new SimplePie_Cache object
+ *
+ * @deprecated Use {@see get_handler} instead
+ */
+ public function create($location, $filename, $extension)
+ {
+ trigger_error('Cache::create() has been replaced with Cache::get_handler(). Switch to the registry system to use this.', E_USER_DEPRECATED);
+ return self::get_handler($location, $filename, $extension);
+ }
+
+ /**
+ * Register a handler
+ *
+ * @param string $type DSN type to register for
+ * @param string $class Name of handler class. Must implement SimplePie_Cache_Base
+ */
+ public static function register($type, $class)
+ {
+ self::$handlers[$type] = $class;
+ }
+
+ /**
+ * Parse a URL into an array
+ *
+ * @param string $url
+ * @return array
+ */
+ public static function parse_URL($url)
+ {
+ $params = parse_url($url);
+ $params['extras'] = array();
+ if (isset($params['query']))
+ {
+ parse_str($params['query'], $params['extras']);
+ }
+ return $params;
+ }
+}
+
+class_alias('SimplePie_Cache', 'SimplePie\Cache', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/Base.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/Base.php
new file mode 100644
index 0000000000..29eb0594bb
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/Base.php
@@ -0,0 +1,115 @@
+get_items();
+ $items_by_id = array();
+
+ if (!empty($items))
+ {
+ foreach ($items as $item)
+ {
+ $items_by_id[$item->get_id()] = $item;
+ }
+
+ if (count($items_by_id) !== count($items))
+ {
+ $items_by_id = array();
+ foreach ($items as $item)
+ {
+ $items_by_id[$item->get_id(true)] = $item;
+ }
+ }
+
+ if (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]))
+ {
+ $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];
+ }
+ elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]))
+ {
+ $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];
+ }
+ elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]))
+ {
+ $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];
+ }
+ elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0]))
+ {
+ $channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0];
+ }
+ else
+ {
+ $channel = null;
+ }
+
+ if ($channel !== null)
+ {
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry']);
+ }
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['entry']);
+ }
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_10]['item']);
+ }
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_090]['item']);
+ }
+ if (isset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item']))
+ {
+ unset($channel['child'][SIMPLEPIE_NAMESPACE_RSS_20]['item']);
+ }
+ }
+ if (isset($data->data['items']))
+ {
+ unset($data->data['items']);
+ }
+ if (isset($data->data['ordered_items']))
+ {
+ unset($data->data['ordered_items']);
+ }
+ }
+ return array(serialize($data->data), $items_by_id);
+ }
+}
+
+class_alias('SimplePie_Cache_DB', 'SimplePie\Cache\DB', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/File.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/File.php
new file mode 100644
index 0000000000..db30e7a0fe
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/File.php
@@ -0,0 +1,166 @@
+location = $location;
+ $this->filename = $name;
+ $this->extension = $type;
+ $this->name = "$this->location/$this->filename.$this->extension";
+ }
+
+ /**
+ * Save data to the cache
+ *
+ * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
+ * @return bool Successfulness
+ */
+ public function save($data)
+ {
+ if (file_exists($this->name) && is_writable($this->name) || file_exists($this->location) && is_writable($this->location))
+ {
+ if ($data instanceof SimplePie)
+ {
+ $data = $data->data;
+ }
+
+ $data = serialize($data);
+ return (bool) file_put_contents($this->name, $data);
+ }
+ return false;
+ }
+
+ /**
+ * Retrieve the data saved to the cache
+ *
+ * @return array Data for SimplePie::$data
+ */
+ public function load()
+ {
+ if (file_exists($this->name) && is_readable($this->name))
+ {
+ return unserialize(file_get_contents($this->name));
+ }
+ return false;
+ }
+
+ /**
+ * Retrieve the last modified time for the cache
+ *
+ * @return int Timestamp
+ */
+ public function mtime()
+ {
+ return @filemtime($this->name);
+ }
+
+ /**
+ * Set the last modified time to the current time
+ *
+ * @return bool Success status
+ */
+ public function touch()
+ {
+ return @touch($this->name);
+ }
+
+ /**
+ * Remove the cache
+ *
+ * @return bool Success status
+ */
+ public function unlink()
+ {
+ if (file_exists($this->name))
+ {
+ return unlink($this->name);
+ }
+ return false;
+ }
+}
+
+class_alias('SimplePie_Cache_File', 'SimplePie\Cache\File', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/Memcache.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/Memcache.php
new file mode 100644
index 0000000000..2cc37f9077
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/Memcache.php
@@ -0,0 +1,182 @@
+options = array(
+ 'host' => '127.0.0.1',
+ 'port' => 11211,
+ 'extras' => array(
+ 'timeout' => 3600, // one hour
+ 'prefix' => 'simplepie_',
+ ),
+ );
+ $this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location));
+
+ $this->name = $this->options['extras']['prefix'] . md5("$name:$type");
+
+ $this->cache = new Memcache();
+ $this->cache->addServer($this->options['host'], (int) $this->options['port']);
+ }
+
+ /**
+ * Save data to the cache
+ *
+ * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
+ * @return bool Successfulness
+ */
+ public function save($data)
+ {
+ if ($data instanceof SimplePie)
+ {
+ $data = $data->data;
+ }
+ return $this->cache->set($this->name, serialize($data), MEMCACHE_COMPRESSED, (int) $this->options['extras']['timeout']);
+ }
+
+ /**
+ * Retrieve the data saved to the cache
+ *
+ * @return array Data for SimplePie::$data
+ */
+ public function load()
+ {
+ $data = $this->cache->get($this->name);
+
+ if ($data !== false)
+ {
+ return unserialize($data);
+ }
+ return false;
+ }
+
+ /**
+ * Retrieve the last modified time for the cache
+ *
+ * @return int Timestamp
+ */
+ public function mtime()
+ {
+ $data = $this->cache->get($this->name);
+
+ if ($data !== false)
+ {
+ // essentially ignore the mtime because Memcache expires on its own
+ return time();
+ }
+
+ return false;
+ }
+
+ /**
+ * Set the last modified time to the current time
+ *
+ * @return bool Success status
+ */
+ public function touch()
+ {
+ $data = $this->cache->get($this->name);
+
+ if ($data !== false)
+ {
+ return $this->cache->set($this->name, $data, MEMCACHE_COMPRESSED, (int) $this->options['extras']['timeout']);
+ }
+
+ return false;
+ }
+
+ /**
+ * Remove the cache
+ *
+ * @return bool Success status
+ */
+ public function unlink()
+ {
+ return $this->cache->delete($this->name, 0);
+ }
+}
+
+class_alias('SimplePie_Cache_Memcache', 'SimplePie\Cache\Memcache', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/Memcached.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/Memcached.php
new file mode 100755
index 0000000000..32a53eb7b6
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/Memcached.php
@@ -0,0 +1,168 @@
+options = array(
+ 'host' => '127.0.0.1',
+ 'port' => 11211,
+ 'extras' => array(
+ 'timeout' => 3600, // one hour
+ 'prefix' => 'simplepie_',
+ ),
+ );
+ $this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location));
+
+ $this->name = $this->options['extras']['prefix'] . md5("$name:$type");
+
+ $this->cache = new Memcached();
+ $this->cache->addServer($this->options['host'], (int)$this->options['port']);
+ }
+
+ /**
+ * Save data to the cache
+ * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
+ * @return bool Successfulness
+ */
+ public function save($data) {
+ if ($data instanceof SimplePie) {
+ $data = $data->data;
+ }
+
+ return $this->setData(serialize($data));
+ }
+
+ /**
+ * Retrieve the data saved to the cache
+ * @return array Data for SimplePie::$data
+ */
+ public function load() {
+ $data = $this->cache->get($this->name);
+
+ if ($data !== false) {
+ return unserialize($data);
+ }
+ return false;
+ }
+
+ /**
+ * Retrieve the last modified time for the cache
+ * @return int Timestamp
+ */
+ public function mtime() {
+ $data = $this->cache->get($this->name . '_mtime');
+ return (int) $data;
+ }
+
+ /**
+ * Set the last modified time to the current time
+ * @return bool Success status
+ */
+ public function touch() {
+ $data = $this->cache->get($this->name);
+ return $this->setData($data);
+ }
+
+ /**
+ * Remove the cache
+ * @return bool Success status
+ */
+ public function unlink() {
+ return $this->cache->delete($this->name, 0);
+ }
+
+ /**
+ * Set the last modified time and data to Memcached
+ * @return bool Success status
+ */
+ private function setData($data) {
+
+ if ($data !== false) {
+ $this->cache->set($this->name . '_mtime', time(), (int)$this->options['extras']['timeout']);
+ return $this->cache->set($this->name, $data, (int)$this->options['extras']['timeout']);
+ }
+
+ return false;
+ }
+}
+
+class_alias('SimplePie_Cache_Memcached', 'SimplePie\Cache\Memcached', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/MySQL.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/MySQL.php
new file mode 100644
index 0000000000..d21e2b6e4c
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/MySQL.php
@@ -0,0 +1,442 @@
+options = array(
+ 'user' => null,
+ 'pass' => null,
+ 'host' => '127.0.0.1',
+ 'port' => '3306',
+ 'path' => '',
+ 'extras' => array(
+ 'prefix' => '',
+ 'cache_purge_time' => 2592000
+ ),
+ );
+
+ $this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location));
+
+ // Path is prefixed with a "/"
+ $this->options['dbname'] = substr($this->options['path'], 1);
+
+ try
+ {
+ $this->mysql = new PDO("mysql:dbname={$this->options['dbname']};host={$this->options['host']};port={$this->options['port']}", $this->options['user'], $this->options['pass'], array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
+ }
+ catch (PDOException $e)
+ {
+ $this->mysql = null;
+ return;
+ }
+
+ $this->id = $name . $type;
+
+ if (!$query = $this->mysql->query('SHOW TABLES'))
+ {
+ $this->mysql = null;
+ return;
+ }
+
+ $db = array();
+ while ($row = $query->fetchColumn())
+ {
+ $db[] = $row;
+ }
+
+ if (!in_array($this->options['extras']['prefix'] . 'cache_data', $db))
+ {
+ $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))');
+ if ($query === false)
+ {
+ trigger_error("Can't create " . $this->options['extras']['prefix'] . "cache_data table, check permissions", E_USER_WARNING);
+ $this->mysql = null;
+ return;
+ }
+ }
+
+ if (!in_array($this->options['extras']['prefix'] . 'items', $db))
+ {
+ $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` MEDIUMBLOB NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))');
+ if ($query === false)
+ {
+ trigger_error("Can't create " . $this->options['extras']['prefix'] . "items table, check permissions", E_USER_WARNING);
+ $this->mysql = null;
+ return;
+ }
+ }
+ }
+
+ /**
+ * Save data to the cache
+ *
+ * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
+ * @return bool Successfulness
+ */
+ public function save($data)
+ {
+ if ($this->mysql === null)
+ {
+ return false;
+ }
+
+ $query = $this->mysql->prepare('DELETE i, cd FROM `' . $this->options['extras']['prefix'] . 'cache_data` cd, ' .
+ '`' . $this->options['extras']['prefix'] . 'items` i ' .
+ 'WHERE cd.id = i.feed_id ' .
+ 'AND cd.mtime < (unix_timestamp() - :purge_time)');
+ $query->bindValue(':purge_time', $this->options['extras']['cache_purge_time']);
+
+ if (!$query->execute())
+ {
+ return false;
+ }
+
+ if ($data instanceof SimplePie)
+ {
+ $data = clone $data;
+
+ $prepared = self::prepare_simplepie_object_for_cache($data);
+
+ $query = $this->mysql->prepare('SELECT COUNT(*) FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed');
+ $query->bindValue(':feed', $this->id);
+ if ($query->execute())
+ {
+ if ($query->fetchColumn() > 0)
+ {
+ $items = count($prepared[1]);
+ if ($items)
+ {
+ $sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = :items, `data` = :data, `mtime` = :time WHERE `id` = :feed';
+ $query = $this->mysql->prepare($sql);
+ $query->bindValue(':items', $items);
+ }
+ else
+ {
+ $sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `data` = :data, `mtime` = :time WHERE `id` = :feed';
+ $query = $this->mysql->prepare($sql);
+ }
+
+ $query->bindValue(':data', $prepared[0]);
+ $query->bindValue(':time', time());
+ $query->bindValue(':feed', $this->id);
+ if (!$query->execute())
+ {
+ return false;
+ }
+ }
+ else
+ {
+ $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:feed, :count, :data, :time)');
+ $query->bindValue(':feed', $this->id);
+ $query->bindValue(':count', count($prepared[1]));
+ $query->bindValue(':data', $prepared[0]);
+ $query->bindValue(':time', time());
+ if (!$query->execute())
+ {
+ return false;
+ }
+ }
+
+ $ids = array_keys($prepared[1]);
+ if (!empty($ids))
+ {
+ foreach ($ids as $id)
+ {
+ $database_ids[] = $this->mysql->quote($id);
+ }
+
+ $query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `id` = ' . implode(' OR `id` = ', $database_ids) . ' AND `feed_id` = :feed');
+ $query->bindValue(':feed', $this->id);
+
+ if ($query->execute())
+ {
+ $existing_ids = array();
+ while ($row = $query->fetchColumn())
+ {
+ $existing_ids[] = $row;
+ }
+
+ $new_ids = array_diff($ids, $existing_ids);
+
+ foreach ($new_ids as $new_id)
+ {
+ if (!($date = $prepared[1][$new_id]->get_date('U')))
+ {
+ $date = time();
+ }
+
+ $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'items` (`feed_id`, `id`, `data`, `posted`) VALUES(:feed, :id, :data, :date)');
+ $query->bindValue(':feed', $this->id);
+ $query->bindValue(':id', $new_id);
+ $query->bindValue(':data', serialize($prepared[1][$new_id]->data));
+ $query->bindValue(':date', $date);
+ if (!$query->execute())
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ else
+ {
+ return true;
+ }
+ }
+ }
+ else
+ {
+ $query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed');
+ $query->bindValue(':feed', $this->id);
+ if ($query->execute())
+ {
+ if ($query->rowCount() > 0)
+ {
+ $query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = 0, `data` = :data, `mtime` = :time WHERE `id` = :feed');
+ $query->bindValue(':data', serialize($data));
+ $query->bindValue(':time', time());
+ $query->bindValue(':feed', $this->id);
+ if ($query->execute())
+ {
+ return true;
+ }
+ }
+ else
+ {
+ $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:id, 0, :data, :time)');
+ $query->bindValue(':id', $this->id);
+ $query->bindValue(':data', serialize($data));
+ $query->bindValue(':time', time());
+ if ($query->execute())
+ {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Retrieve the data saved to the cache
+ *
+ * @return array Data for SimplePie::$data
+ */
+ public function load()
+ {
+ if ($this->mysql === null)
+ {
+ return false;
+ }
+
+ $query = $this->mysql->prepare('SELECT `items`, `data` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');
+ $query->bindValue(':id', $this->id);
+ if ($query->execute() && ($row = $query->fetch()))
+ {
+ $data = unserialize($row[1]);
+
+ if (isset($this->options['items'][0]))
+ {
+ $items = (int) $this->options['items'][0];
+ }
+ else
+ {
+ $items = (int) $row[0];
+ }
+
+ if ($items !== 0)
+ {
+ if (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]))
+ {
+ $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];
+ }
+ elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]))
+ {
+ $feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];
+ }
+ elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]))
+ {
+ $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];
+ }
+ elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]))
+ {
+ $feed =& $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0];
+ }
+ else
+ {
+ $feed = null;
+ }
+
+ if ($feed !== null)
+ {
+ $sql = 'SELECT `data` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :feed ORDER BY `posted` DESC';
+ if ($items > 0)
+ {
+ $sql .= ' LIMIT ' . $items;
+ }
+
+ $query = $this->mysql->prepare($sql);
+ $query->bindValue(':feed', $this->id);
+ if ($query->execute())
+ {
+ while ($row = $query->fetchColumn())
+ {
+ $feed['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'][] = unserialize($row);
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+ return $data;
+ }
+ return false;
+ }
+
+ /**
+ * Retrieve the last modified time for the cache
+ *
+ * @return int Timestamp
+ */
+ public function mtime()
+ {
+ if ($this->mysql === null)
+ {
+ return false;
+ }
+
+ $query = $this->mysql->prepare('SELECT `mtime` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');
+ $query->bindValue(':id', $this->id);
+ if ($query->execute() && ($time = $query->fetchColumn()))
+ {
+ return $time;
+ }
+
+ return false;
+ }
+
+ /**
+ * Set the last modified time to the current time
+ *
+ * @return bool Success status
+ */
+ public function touch()
+ {
+ if ($this->mysql === null)
+ {
+ return false;
+ }
+
+ $query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `mtime` = :time WHERE `id` = :id');
+ $query->bindValue(':time', time());
+ $query->bindValue(':id', $this->id);
+
+ return $query->execute() && $query->rowCount() > 0;
+ }
+
+ /**
+ * Remove the cache
+ *
+ * @return bool Success status
+ */
+ public function unlink()
+ {
+ if ($this->mysql === null)
+ {
+ return false;
+ }
+
+ $query = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');
+ $query->bindValue(':id', $this->id);
+ $query2 = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :id');
+ $query2->bindValue(':id', $this->id);
+
+ return $query->execute() && $query2->execute();
+ }
+}
+
+class_alias('SimplePie_Cache_MySQL', 'SimplePie\Cache\MySQL', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/Redis.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/Redis.php
new file mode 100644
index 0000000000..82d759b014
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Cache/Redis.php
@@ -0,0 +1,174 @@
+
+ * @link http://galvani.cz/
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version 0.2.9
+ */
+
+
+/**
+ * Caches data to redis
+ *
+ * Registered for URLs with the "redis" protocol
+ *
+ * For example, `redis://localhost:6379/?timeout=3600&prefix=sp_&dbIndex=0` will
+ * connect to redis on `localhost` on port 6379. All tables will be
+ * prefixed with `simple_primary-` and data will expire after 3600 seconds
+ *
+ * @package SimplePie
+ * @subpackage Caching
+ * @uses Redis
+ */
+class SimplePie_Cache_Redis implements SimplePie_Cache_Base {
+ /**
+ * Redis instance
+ *
+ * @var \Redis
+ */
+ protected $cache;
+
+ /**
+ * Options
+ *
+ * @var array
+ */
+ protected $options;
+
+ /**
+ * Cache name
+ *
+ * @var string
+ */
+ protected $name;
+
+ /**
+ * Cache Data
+ *
+ * @var type
+ */
+ protected $data;
+
+ /**
+ * Create a new cache object
+ *
+ * @param string $location Location string (from SimplePie::$cache_location)
+ * @param string $name Unique ID for the cache
+ * @param string $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
+ */
+ public function __construct($location, $name, $options = null) {
+ //$this->cache = \flow\simple\cache\Redis::getRedisClientInstance();
+ $parsed = SimplePie_Cache::parse_URL($location);
+ $redis = new Redis();
+ $redis->connect($parsed['host'], $parsed['port']);
+ if (isset($parsed['pass'])) {
+ $redis->auth($parsed['pass']);
+ }
+ if (isset($parsed['path'])) {
+ $redis->select((int)substr($parsed['path'], 1));
+ }
+ $this->cache = $redis;
+
+ if (!is_null($options) && is_array($options)) {
+ $this->options = $options;
+ } else {
+ $this->options = array (
+ 'prefix' => 'rss:simple_primary:',
+ 'expire' => 0,
+ );
+ }
+
+ $this->name = $this->options['prefix'] . $name;
+ }
+
+ /**
+ * @param \Redis $cache
+ */
+ public function setRedisClient(\Redis $cache) {
+ $this->cache = $cache;
+ }
+
+ /**
+ * Save data to the cache
+ *
+ * @param array|SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property
+ * @return bool Successfulness
+ */
+ public function save($data) {
+ if ($data instanceof SimplePie) {
+ $data = $data->data;
+ }
+ $response = $this->cache->set($this->name, serialize($data));
+ if ($this->options['expire']) {
+ $this->cache->expire($this->name, $this->options['expire']);
+ }
+
+ return $response;
+ }
+
+ /**
+ * Retrieve the data saved to the cache
+ *
+ * @return array Data for SimplePie::$data
+ */
+ public function load() {
+ $data = $this->cache->get($this->name);
+
+ if ($data !== false) {
+ return unserialize($data);
+ }
+ return false;
+ }
+
+ /**
+ * Retrieve the last modified time for the cache
+ *
+ * @return int Timestamp
+ */
+ public function mtime() {
+
+ $data = $this->cache->get($this->name);
+
+ if ($data !== false) {
+ return time();
+ }
+
+ return false;
+ }
+
+ /**
+ * Set the last modified time to the current time
+ *
+ * @return bool Success status
+ */
+ public function touch() {
+
+ $data = $this->cache->get($this->name);
+
+ if ($data !== false) {
+ $return = $this->cache->set($this->name, $data);
+ if ($this->options['expire']) {
+ return $this->cache->expire($this->name, $this->options['expire']);
+ }
+ return $return;
+ }
+
+ return false;
+ }
+
+ /**
+ * Remove the cache
+ *
+ * @return bool Success status
+ */
+ public function unlink() {
+ return $this->cache->set($this->name, null);
+ }
+
+}
+
+class_alias('SimplePie_Cache_Redis', 'SimplePie\Cache\Redis', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Caption.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Caption.php
new file mode 100644
index 0000000000..355ab52f39
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Caption.php
@@ -0,0 +1,200 @@
+` captions as defined in Media RSS.
+ *
+ * Used by {@see SimplePie_Enclosure::get_caption()} and {@see SimplePie_Enclosure::get_captions()}
+ *
+ * This class can be overloaded with {@see SimplePie::set_caption_class()}
+ *
+ * @package SimplePie
+ * @subpackage API
+ */
+class SimplePie_Caption
+{
+ /**
+ * Content type
+ *
+ * @var string
+ * @see get_type()
+ */
+ var $type;
+
+ /**
+ * Language
+ *
+ * @var string
+ * @see get_language()
+ */
+ var $lang;
+
+ /**
+ * Start time
+ *
+ * @var string
+ * @see get_starttime()
+ */
+ var $startTime;
+
+ /**
+ * End time
+ *
+ * @var string
+ * @see get_endtime()
+ */
+ var $endTime;
+
+ /**
+ * Caption text
+ *
+ * @var string
+ * @see get_text()
+ */
+ var $text;
+
+ /**
+ * Constructor, used to input the data
+ *
+ * For documentation on all the parameters, see the corresponding
+ * properties and their accessors
+ */
+ public function __construct($type = null, $lang = null, $startTime = null, $endTime = null, $text = null)
+ {
+ $this->type = $type;
+ $this->lang = $lang;
+ $this->startTime = $startTime;
+ $this->endTime = $endTime;
+ $this->text = $text;
+ }
+
+ /**
+ * String-ified version
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ // There is no $this->data here
+ return md5(serialize($this));
+ }
+
+ /**
+ * Get the end time
+ *
+ * @return string|null Time in the format 'hh:mm:ss.SSS'
+ */
+ public function get_endtime()
+ {
+ if ($this->endTime !== null)
+ {
+ return $this->endTime;
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the language
+ *
+ * @link http://tools.ietf.org/html/rfc3066
+ * @return string|null Language code as per RFC 3066
+ */
+ public function get_language()
+ {
+ if ($this->lang !== null)
+ {
+ return $this->lang;
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the start time
+ *
+ * @return string|null Time in the format 'hh:mm:ss.SSS'
+ */
+ public function get_starttime()
+ {
+ if ($this->startTime !== null)
+ {
+ return $this->startTime;
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the text of the caption
+ *
+ * @return string|null
+ */
+ public function get_text()
+ {
+ if ($this->text !== null)
+ {
+ return $this->text;
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the content type (not MIME type)
+ *
+ * @return string|null Either 'text' or 'html'
+ */
+ public function get_type()
+ {
+ if ($this->type !== null)
+ {
+ return $this->type;
+ }
+
+ return null;
+ }
+}
+
+class_alias('SimplePie_Caption', 'SimplePie\Caption', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Category.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Category.php
new file mode 100644
index 0000000000..02cb764824
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Category.php
@@ -0,0 +1,164 @@
+
+ * subject for
+ *
+ * @var string|null
+ * @see get_type()
+ */
+ var $type;
+
+ /**
+ * Constructor, used to input the data
+ *
+ * @param string|null $term
+ * @param string|null $scheme
+ * @param string|null $label
+ * @param string|null $type
+ */
+ public function __construct($term = null, $scheme = null, $label = null, $type = null)
+ {
+ $this->term = $term;
+ $this->scheme = $scheme;
+ $this->label = $label;
+ $this->type = $type;
+ }
+
+ /**
+ * String-ified version
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ // There is no $this->data here
+ return md5(serialize($this));
+ }
+
+ /**
+ * Get the category identifier
+ *
+ * @return string|null
+ */
+ public function get_term()
+ {
+ return $this->term;
+ }
+
+ /**
+ * Get the categorization scheme identifier
+ *
+ * @return string|null
+ */
+ public function get_scheme()
+ {
+ return $this->scheme;
+ }
+
+ /**
+ * Get the human readable label
+ *
+ * @param bool $strict
+ * @return string|null
+ */
+ public function get_label($strict = false)
+ {
+ if ($this->label === null && $strict !== true)
+ {
+ return $this->get_term();
+ }
+ return $this->label;
+ }
+
+ /**
+ * Get the category type
+ *
+ * @return string|null
+ */
+ public function get_type()
+ {
+ return $this->type;
+ }
+}
+
+class_alias('SimplePie_Category', 'SimplePie\Category', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Content/Type/Sniffer.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Content/Type/Sniffer.php
new file mode 100644
index 0000000000..b3a8cf3789
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Content/Type/Sniffer.php
@@ -0,0 +1,320 @@
+file = $file;
+ }
+
+ /**
+ * Get the Content-Type of the specified file
+ *
+ * @return string Actual Content-Type
+ */
+ public function get_type()
+ {
+ if (isset($this->file->headers['content-type']))
+ {
+ if (!isset($this->file->headers['content-encoding'])
+ && ($this->file->headers['content-type'] === 'text/plain'
+ || $this->file->headers['content-type'] === 'text/plain; charset=ISO-8859-1'
+ || $this->file->headers['content-type'] === 'text/plain; charset=iso-8859-1'
+ || $this->file->headers['content-type'] === 'text/plain; charset=UTF-8'))
+ {
+ return $this->text_or_binary();
+ }
+
+ if (($pos = strpos($this->file->headers['content-type'], ';')) !== false)
+ {
+ $official = substr($this->file->headers['content-type'], 0, $pos);
+ }
+ else
+ {
+ $official = $this->file->headers['content-type'];
+ }
+ $official = trim(strtolower($official));
+
+ if ($official === 'unknown/unknown'
+ || $official === 'application/unknown')
+ {
+ return $this->unknown();
+ }
+ elseif (substr($official, -4) === '+xml'
+ || $official === 'text/xml'
+ || $official === 'application/xml')
+ {
+ return $official;
+ }
+ elseif (substr($official, 0, 6) === 'image/')
+ {
+ if ($return = $this->image())
+ {
+ return $return;
+ }
+
+ return $official;
+ }
+ elseif ($official === 'text/html')
+ {
+ return $this->feed_or_html();
+ }
+
+ return $official;
+ }
+
+ return $this->unknown();
+ }
+
+ /**
+ * Sniff text or binary
+ *
+ * @return string Actual Content-Type
+ */
+ public function text_or_binary()
+ {
+ if (substr($this->file->body, 0, 2) === "\xFE\xFF"
+ || substr($this->file->body, 0, 2) === "\xFF\xFE"
+ || substr($this->file->body, 0, 4) === "\x00\x00\xFE\xFF"
+ || substr($this->file->body, 0, 3) === "\xEF\xBB\xBF")
+ {
+ return 'text/plain';
+ }
+ elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body))
+ {
+ return 'application/octet-stream';
+ }
+
+ return 'text/plain';
+ }
+
+ /**
+ * Sniff unknown
+ *
+ * @return string Actual Content-Type
+ */
+ public function unknown()
+ {
+ $ws = strspn($this->file->body, "\x09\x0A\x0B\x0C\x0D\x20");
+ if (strtolower(substr($this->file->body, $ws, 14)) === 'file->body, $ws, 5)) === 'file->body, $ws, 7)) === '";
+ }
+ }
+
+ // Flash Media Player file types.
+ // Preferred handler for MP3 file types.
+ elseif ($handler === 'fmedia' || ($handler === 'mp3' && $mediaplayer !== ''))
+ {
+ $height += 20;
+ if ($native)
+ {
+ $embed .= "get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"> ";
+ }
+ else
+ {
+ $embed .= "";
+ }
+ }
+
+ // QuickTime 7 file types. Need to test with QuickTime 6.
+ // Only handle MP3's if the Flash Media Player is not present.
+ elseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === ''))
+ {
+ $height += 16;
+ if ($native)
+ {
+ if ($placeholder !== '')
+ {
+ $embed .= "get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"> ";
+ }
+ else
+ {
+ $embed .= "get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"> ";
+ }
+ }
+ else
+ {
+ $embed .= "";
+ }
+ }
+
+ // Windows Media
+ elseif ($handler === 'wmedia')
+ {
+ $height += 45;
+ if ($native)
+ {
+ $embed .= "get_link() . "\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"> ";
+ }
+ else
+ {
+ $embed .= "";
+ }
+ }
+
+ // Everything else
+ else $embed .= '' . $alt . ' ';
+
+ return $embed;
+ }
+
+ /**
+ * Get the real media type
+ *
+ * Often, feeds lie to us, necessitating a bit of deeper inspection. This
+ * converts types to their canonical representations based on the file
+ * extension
+ *
+ * @see get_type()
+ * @param bool $find_handler Internal use only, use {@see get_handler()} instead
+ * @return string MIME type
+ */
+ public function get_real_type($find_handler = false)
+ {
+ // Mime-types by handler.
+ $types_flash = array('application/x-shockwave-flash', 'application/futuresplash'); // Flash
+ $types_fmedia = array('video/flv', 'video/x-flv','flv-application/octet-stream'); // Flash Media Player
+ $types_quicktime = array('audio/3gpp', 'audio/3gpp2', 'audio/aac', 'audio/x-aac', 'audio/aiff', 'audio/x-aiff', 'audio/mid', 'audio/midi', 'audio/x-midi', 'audio/mp4', 'audio/m4a', 'audio/x-m4a', 'audio/wav', 'audio/x-wav', 'video/3gpp', 'video/3gpp2', 'video/m4v', 'video/x-m4v', 'video/mp4', 'video/mpeg', 'video/x-mpeg', 'video/quicktime', 'video/sd-video'); // QuickTime
+ $types_wmedia = array('application/asx', 'application/x-mplayer2', 'audio/x-ms-wma', 'audio/x-ms-wax', 'video/x-ms-asf-plugin', 'video/x-ms-asf', 'video/x-ms-wm', 'video/x-ms-wmv', 'video/x-ms-wvx'); // Windows Media
+ $types_mp3 = array('audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-mpeg'); // MP3
+
+ if ($this->get_type() !== null)
+ {
+ $type = strtolower($this->type);
+ }
+ else
+ {
+ $type = null;
+ }
+
+ // If we encounter an unsupported mime-type, check the file extension and guess intelligently.
+ if (!in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3)))
+ {
+ $extension = $this->get_extension();
+ if ($extension === null) {
+ return null;
+ }
+
+ switch (strtolower($extension))
+ {
+ // Audio mime-types
+ case 'aac':
+ case 'adts':
+ $type = 'audio/acc';
+ break;
+
+ case 'aif':
+ case 'aifc':
+ case 'aiff':
+ case 'cdda':
+ $type = 'audio/aiff';
+ break;
+
+ case 'bwf':
+ $type = 'audio/wav';
+ break;
+
+ case 'kar':
+ case 'mid':
+ case 'midi':
+ case 'smf':
+ $type = 'audio/midi';
+ break;
+
+ case 'm4a':
+ $type = 'audio/x-m4a';
+ break;
+
+ case 'mp3':
+ case 'swa':
+ $type = 'audio/mp3';
+ break;
+
+ case 'wav':
+ $type = 'audio/wav';
+ break;
+
+ case 'wax':
+ $type = 'audio/x-ms-wax';
+ break;
+
+ case 'wma':
+ $type = 'audio/x-ms-wma';
+ break;
+
+ // Video mime-types
+ case '3gp':
+ case '3gpp':
+ $type = 'video/3gpp';
+ break;
+
+ case '3g2':
+ case '3gp2':
+ $type = 'video/3gpp2';
+ break;
+
+ case 'asf':
+ $type = 'video/x-ms-asf';
+ break;
+
+ case 'flv':
+ $type = 'video/x-flv';
+ break;
+
+ case 'm1a':
+ case 'm1s':
+ case 'm1v':
+ case 'm15':
+ case 'm75':
+ case 'mp2':
+ case 'mpa':
+ case 'mpeg':
+ case 'mpg':
+ case 'mpm':
+ case 'mpv':
+ $type = 'video/mpeg';
+ break;
+
+ case 'm4v':
+ $type = 'video/x-m4v';
+ break;
+
+ case 'mov':
+ case 'qt':
+ $type = 'video/quicktime';
+ break;
+
+ case 'mp4':
+ case 'mpg4':
+ $type = 'video/mp4';
+ break;
+
+ case 'sdv':
+ $type = 'video/sd-video';
+ break;
+
+ case 'wm':
+ $type = 'video/x-ms-wm';
+ break;
+
+ case 'wmv':
+ $type = 'video/x-ms-wmv';
+ break;
+
+ case 'wvx':
+ $type = 'video/x-ms-wvx';
+ break;
+
+ // Flash mime-types
+ case 'spl':
+ $type = 'application/futuresplash';
+ break;
+
+ case 'swf':
+ $type = 'application/x-shockwave-flash';
+ break;
+ }
+ }
+
+ if ($find_handler)
+ {
+ if (in_array($type, $types_flash))
+ {
+ return 'flash';
+ }
+ elseif (in_array($type, $types_fmedia))
+ {
+ return 'fmedia';
+ }
+ elseif (in_array($type, $types_quicktime))
+ {
+ return 'quicktime';
+ }
+ elseif (in_array($type, $types_wmedia))
+ {
+ return 'wmedia';
+ }
+ elseif (in_array($type, $types_mp3))
+ {
+ return 'mp3';
+ }
+
+ return null;
+ }
+
+ return $type;
+ }
+}
+
+class_alias('SimplePie_Enclosure', 'SimplePie\Enclosure', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Exception.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Exception.php
new file mode 100644
index 0000000000..715cefc72b
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Exception.php
@@ -0,0 +1,53 @@
+encode($parsed['authority']), $parsed['path'], $parsed['query'], NULL);
+ }
+ $this->url = $url;
+ $this->permanent_url = $url;
+ $this->useragent = $useragent;
+ if (preg_match('/^http(s)?:\/\//i', $url))
+ {
+ if ($useragent === null)
+ {
+ $useragent = ini_get('user_agent');
+ $this->useragent = $useragent;
+ }
+ if (!is_array($headers))
+ {
+ $headers = array();
+ }
+ if (!$force_fsockopen && function_exists('curl_exec'))
+ {
+ $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_CURL;
+ $fp = curl_init();
+ $headers2 = array();
+ foreach ($headers as $key => $value)
+ {
+ $headers2[] = "$key: $value";
+ }
+ if (version_compare(SimplePie_Misc::get_curl_version(), '7.10.5', '>='))
+ {
+ curl_setopt($fp, CURLOPT_ENCODING, '');
+ }
+ curl_setopt($fp, CURLOPT_URL, $url);
+ curl_setopt($fp, CURLOPT_HEADER, 1);
+ curl_setopt($fp, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($fp, CURLOPT_FAILONERROR, 1);
+ curl_setopt($fp, CURLOPT_TIMEOUT, $timeout);
+ curl_setopt($fp, CURLOPT_CONNECTTIMEOUT, $timeout);
+ curl_setopt($fp, CURLOPT_REFERER, SimplePie_Misc::url_remove_credentials($url));
+ curl_setopt($fp, CURLOPT_USERAGENT, $useragent);
+ curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2);
+ foreach ($curl_options as $curl_param => $curl_value) {
+ curl_setopt($fp, $curl_param, $curl_value);
+ }
+
+ $this->headers = curl_exec($fp);
+ if (curl_errno($fp) === 23 || curl_errno($fp) === 61)
+ {
+ curl_setopt($fp, CURLOPT_ENCODING, 'none');
+ $this->headers = curl_exec($fp);
+ }
+ $this->status_code = curl_getinfo($fp, CURLINFO_HTTP_CODE);
+ if (curl_errno($fp))
+ {
+ $this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp);
+ $this->success = false;
+ }
+ else
+ {
+ // Use the updated url provided by curl_getinfo after any redirects.
+ if ($info = curl_getinfo($fp)) {
+ $this->url = $info['url'];
+ }
+ curl_close($fp);
+ $this->headers = SimplePie_HTTP_Parser::prepareHeaders($this->headers, $info['redirect_count'] + 1);
+ $parser = new SimplePie_HTTP_Parser($this->headers);
+ if ($parser->parse())
+ {
+ $this->headers = $parser->headers;
+ $this->body = trim($parser->body);
+ $this->status_code = $parser->status_code;
+ if ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)
+ {
+ $this->redirects++;
+ $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);
+ $previousStatusCode = $this->status_code;
+ $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen, $curl_options);
+ $this->permanent_url = ($previousStatusCode == 301) ? $location : $url;
+ return;
+ }
+ }
+ }
+ }
+ else
+ {
+ $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_FSOCKOPEN;
+ $url_parts = parse_url($url);
+ $socket_host = $url_parts['host'];
+ if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https')
+ {
+ $socket_host = "ssl://$url_parts[host]";
+ $url_parts['port'] = 443;
+ }
+ if (!isset($url_parts['port']))
+ {
+ $url_parts['port'] = 80;
+ }
+ $fp = @fsockopen($socket_host, $url_parts['port'], $errno, $errstr, $timeout);
+ if (!$fp)
+ {
+ $this->error = 'fsockopen error: ' . $errstr;
+ $this->success = false;
+ }
+ else
+ {
+ stream_set_timeout($fp, $timeout);
+ if (isset($url_parts['path']))
+ {
+ if (isset($url_parts['query']))
+ {
+ $get = "$url_parts[path]?$url_parts[query]";
+ }
+ else
+ {
+ $get = $url_parts['path'];
+ }
+ }
+ else
+ {
+ $get = '/';
+ }
+ $out = "GET $get HTTP/1.1\r\n";
+ $out .= "Host: $url_parts[host]\r\n";
+ $out .= "User-Agent: $useragent\r\n";
+ if (extension_loaded('zlib'))
+ {
+ $out .= "Accept-Encoding: x-gzip,gzip,deflate\r\n";
+ }
+
+ if (isset($url_parts['user']) && isset($url_parts['pass']))
+ {
+ $out .= "Authorization: Basic " . base64_encode("$url_parts[user]:$url_parts[pass]") . "\r\n";
+ }
+ foreach ($headers as $key => $value)
+ {
+ $out .= "$key: $value\r\n";
+ }
+ $out .= "Connection: Close\r\n\r\n";
+ fwrite($fp, $out);
+
+ $info = stream_get_meta_data($fp);
+
+ $this->headers = '';
+ while (!$info['eof'] && !$info['timed_out'])
+ {
+ $this->headers .= fread($fp, 1160);
+ $info = stream_get_meta_data($fp);
+ }
+ if (!$info['timed_out'])
+ {
+ $parser = new SimplePie_HTTP_Parser($this->headers);
+ if ($parser->parse())
+ {
+ $this->headers = $parser->headers;
+ $this->body = $parser->body;
+ $this->status_code = $parser->status_code;
+ if ((in_array($this->status_code, array(300, 301, 302, 303, 307)) || $this->status_code > 307 && $this->status_code < 400) && isset($this->headers['location']) && $this->redirects < $redirects)
+ {
+ $this->redirects++;
+ $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url);
+ $previousStatusCode = $this->status_code;
+ $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen, $curl_options);
+ $this->permanent_url = ($previousStatusCode == 301) ? $location : $url;
+ return;
+ }
+ if (isset($this->headers['content-encoding']))
+ {
+ // Hey, we act dumb elsewhere, so let's do that here too
+ switch (strtolower(trim($this->headers['content-encoding'], "\x09\x0A\x0D\x20")))
+ {
+ case 'gzip':
+ case 'x-gzip':
+ $decoder = new SimplePie_gzdecode($this->body);
+ if (!$decoder->parse())
+ {
+ $this->error = 'Unable to decode HTTP "gzip" stream';
+ $this->success = false;
+ }
+ else
+ {
+ $this->body = trim($decoder->data);
+ }
+ break;
+
+ case 'deflate':
+ if (($decompressed = gzinflate($this->body)) !== false)
+ {
+ $this->body = $decompressed;
+ }
+ else if (($decompressed = gzuncompress($this->body)) !== false)
+ {
+ $this->body = $decompressed;
+ }
+ else if (function_exists('gzdecode') && ($decompressed = gzdecode($this->body)) !== false)
+ {
+ $this->body = $decompressed;
+ }
+ else
+ {
+ $this->error = 'Unable to decode HTTP "deflate" stream';
+ $this->success = false;
+ }
+ break;
+
+ default:
+ $this->error = 'Unknown content coding';
+ $this->success = false;
+ }
+ }
+ }
+ }
+ else
+ {
+ $this->error = 'fsocket timed out';
+ $this->success = false;
+ }
+ fclose($fp);
+ }
+ }
+ }
+ else
+ {
+ $this->method = SIMPLEPIE_FILE_SOURCE_LOCAL | SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS;
+ if (empty($url) || !($this->body = trim(file_get_contents($url))))
+ {
+ $this->error = 'file_get_contents could not read the file';
+ $this->success = false;
+ }
+ }
+ }
+}
+
+class_alias('SimplePie_File', 'SimplePie\File', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/HTTP/Parser.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/HTTP/Parser.php
new file mode 100644
index 0000000000..b0f0f4a8be
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/HTTP/Parser.php
@@ -0,0 +1,522 @@
+data = $data;
+ $this->data_length = strlen($this->data);
+ }
+
+ /**
+ * Parse the input data
+ *
+ * @return bool true on success, false on failure
+ */
+ public function parse()
+ {
+ while ($this->state && $this->state !== 'emit' && $this->has_data())
+ {
+ $state = $this->state;
+ $this->$state();
+ }
+ $this->data = '';
+ if ($this->state === 'emit' || $this->state === 'body')
+ {
+ return true;
+ }
+
+ $this->http_version = '';
+ $this->status_code = '';
+ $this->reason = '';
+ $this->headers = array();
+ $this->body = '';
+ return false;
+ }
+
+ /**
+ * Check whether there is data beyond the pointer
+ *
+ * @return bool true if there is further data, false if not
+ */
+ protected function has_data()
+ {
+ return (bool) ($this->position < $this->data_length);
+ }
+
+ /**
+ * See if the next character is LWS
+ *
+ * @return bool true if the next character is LWS, false if not
+ */
+ protected function is_linear_whitespace()
+ {
+ return (bool) ($this->data[$this->position] === "\x09"
+ || $this->data[$this->position] === "\x20"
+ || ($this->data[$this->position] === "\x0A"
+ && isset($this->data[$this->position + 1])
+ && ($this->data[$this->position + 1] === "\x09" || $this->data[$this->position + 1] === "\x20")));
+ }
+
+ /**
+ * Parse the HTTP version
+ */
+ protected function http_version()
+ {
+ if (strpos($this->data, "\x0A") !== false && strtoupper(substr($this->data, 0, 5)) === 'HTTP/')
+ {
+ $len = strspn($this->data, '0123456789.', 5);
+ $this->http_version = substr($this->data, 5, $len);
+ $this->position += 5 + $len;
+ if (substr_count($this->http_version, '.') <= 1)
+ {
+ $this->http_version = (float) $this->http_version;
+ $this->position += strspn($this->data, "\x09\x20", $this->position);
+ $this->state = 'status';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ /**
+ * Parse the status code
+ */
+ protected function status()
+ {
+ if ($len = strspn($this->data, '0123456789', $this->position))
+ {
+ $this->status_code = (int) substr($this->data, $this->position, $len);
+ $this->position += $len;
+ $this->state = 'reason';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ /**
+ * Parse the reason phrase
+ */
+ protected function reason()
+ {
+ $len = strcspn($this->data, "\x0A", $this->position);
+ $this->reason = trim(substr($this->data, $this->position, $len), "\x09\x0D\x20");
+ $this->position += $len + 1;
+ $this->state = 'new_line';
+ }
+
+ /**
+ * Deal with a new line, shifting data around as needed
+ */
+ protected function new_line()
+ {
+ $this->value = trim($this->value, "\x0D\x20");
+ if ($this->name !== '' && $this->value !== '')
+ {
+ $this->name = strtolower($this->name);
+ // We should only use the last Content-Type header. c.f. issue #1
+ if (isset($this->headers[$this->name]) && $this->name !== 'content-type')
+ {
+ $this->headers[$this->name] .= ', ' . $this->value;
+ }
+ else
+ {
+ $this->headers[$this->name] = $this->value;
+ }
+ }
+ $this->name = '';
+ $this->value = '';
+ if (substr($this->data[$this->position], 0, 2) === "\x0D\x0A")
+ {
+ $this->position += 2;
+ $this->state = 'body';
+ }
+ elseif ($this->data[$this->position] === "\x0A")
+ {
+ $this->position++;
+ $this->state = 'body';
+ }
+ else
+ {
+ $this->state = 'name';
+ }
+ }
+
+ /**
+ * Parse a header name
+ */
+ protected function name()
+ {
+ $len = strcspn($this->data, "\x0A:", $this->position);
+ if (isset($this->data[$this->position + $len]))
+ {
+ if ($this->data[$this->position + $len] === "\x0A")
+ {
+ $this->position += $len;
+ $this->state = 'new_line';
+ }
+ else
+ {
+ $this->name = substr($this->data, $this->position, $len);
+ $this->position += $len + 1;
+ $this->state = 'value';
+ }
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ /**
+ * Parse LWS, replacing consecutive LWS characters with a single space
+ */
+ protected function linear_whitespace()
+ {
+ do
+ {
+ if (substr($this->data, $this->position, 2) === "\x0D\x0A")
+ {
+ $this->position += 2;
+ }
+ elseif ($this->data[$this->position] === "\x0A")
+ {
+ $this->position++;
+ }
+ $this->position += strspn($this->data, "\x09\x20", $this->position);
+ } while ($this->has_data() && $this->is_linear_whitespace());
+ $this->value .= "\x20";
+ }
+
+ /**
+ * See what state to move to while within non-quoted header values
+ */
+ protected function value()
+ {
+ if ($this->is_linear_whitespace())
+ {
+ $this->linear_whitespace();
+ }
+ else
+ {
+ switch ($this->data[$this->position])
+ {
+ case '"':
+ // Workaround for ETags: we have to include the quotes as
+ // part of the tag.
+ if (strtolower($this->name) === 'etag')
+ {
+ $this->value .= '"';
+ $this->position++;
+ $this->state = 'value_char';
+ break;
+ }
+ $this->position++;
+ $this->state = 'quote';
+ break;
+
+ case "\x0A":
+ $this->position++;
+ $this->state = 'new_line';
+ break;
+
+ default:
+ $this->state = 'value_char';
+ break;
+ }
+ }
+ }
+
+ /**
+ * Parse a header value while outside quotes
+ */
+ protected function value_char()
+ {
+ $len = strcspn($this->data, "\x09\x20\x0A\"", $this->position);
+ $this->value .= substr($this->data, $this->position, $len);
+ $this->position += $len;
+ $this->state = 'value';
+ }
+
+ /**
+ * See what state to move to while within quoted header values
+ */
+ protected function quote()
+ {
+ if ($this->is_linear_whitespace())
+ {
+ $this->linear_whitespace();
+ }
+ else
+ {
+ switch ($this->data[$this->position])
+ {
+ case '"':
+ $this->position++;
+ $this->state = 'value';
+ break;
+
+ case "\x0A":
+ $this->position++;
+ $this->state = 'new_line';
+ break;
+
+ case '\\':
+ $this->position++;
+ $this->state = 'quote_escaped';
+ break;
+
+ default:
+ $this->state = 'quote_char';
+ break;
+ }
+ }
+ }
+
+ /**
+ * Parse a header value while within quotes
+ */
+ protected function quote_char()
+ {
+ $len = strcspn($this->data, "\x09\x20\x0A\"\\", $this->position);
+ $this->value .= substr($this->data, $this->position, $len);
+ $this->position += $len;
+ $this->state = 'value';
+ }
+
+ /**
+ * Parse an escaped character within quotes
+ */
+ protected function quote_escaped()
+ {
+ $this->value .= $this->data[$this->position];
+ $this->position++;
+ $this->state = 'quote';
+ }
+
+ /**
+ * Parse the body
+ */
+ protected function body()
+ {
+ $this->body = substr($this->data, $this->position);
+ if (!empty($this->headers['transfer-encoding']))
+ {
+ unset($this->headers['transfer-encoding']);
+ $this->state = 'chunked';
+ }
+ else
+ {
+ $this->state = 'emit';
+ }
+ }
+
+ /**
+ * Parsed a "Transfer-Encoding: chunked" body
+ */
+ protected function chunked()
+ {
+ if (!preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', trim($this->body)))
+ {
+ $this->state = 'emit';
+ return;
+ }
+
+ $decoded = '';
+ $encoded = $this->body;
+
+ while (true)
+ {
+ $is_chunked = (bool) preg_match( '/^([0-9a-f]+)[^\r\n]*\r\n/i', $encoded, $matches );
+ if (!$is_chunked)
+ {
+ // Looks like it's not chunked after all
+ $this->state = 'emit';
+ return;
+ }
+
+ $length = hexdec(trim($matches[1]));
+ if ($length === 0)
+ {
+ // Ignore trailer headers
+ $this->state = 'emit';
+ $this->body = $decoded;
+ return;
+ }
+
+ $chunk_length = strlen($matches[0]);
+ $decoded .= $part = substr($encoded, $chunk_length, $length);
+ $encoded = substr($encoded, $chunk_length + $length + 2);
+
+ if (trim($encoded) === '0' || empty($encoded))
+ {
+ $this->state = 'emit';
+ $this->body = $decoded;
+ return;
+ }
+ }
+ }
+
+ /**
+ * Prepare headers (take care of proxies headers)
+ *
+ * @param string $headers Raw headers
+ * @param integer $count Redirection count. Default to 1.
+ *
+ * @return string
+ */
+ static public function prepareHeaders($headers, $count = 1)
+ {
+ $data = explode("\r\n\r\n", $headers, $count);
+ $data = array_pop($data);
+ if (false !== stripos($data, "HTTP/1.0 200 Connection established\r\n")) {
+ $exploded = explode("\r\n\r\n", $data, 2);
+ $data = end($exploded);
+ }
+ if (false !== stripos($data, "HTTP/1.1 200 Connection established\r\n")) {
+ $exploded = explode("\r\n\r\n", $data, 2);
+ $data = end($exploded);
+ }
+ return $data;
+ }
+}
+
+class_alias('SimplePie_HTTP_Parser', 'SimplePie\HTTP\Parser', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/IRI.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/IRI.php
new file mode 100644
index 0000000000..6cd27ddba5
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/IRI.php
@@ -0,0 +1,1238 @@
+ array(
+ 'port' => 674
+ ),
+ 'dict' => array(
+ 'port' => 2628
+ ),
+ 'file' => array(
+ 'ihost' => 'localhost'
+ ),
+ 'http' => array(
+ 'port' => 80,
+ 'ipath' => '/'
+ ),
+ 'https' => array(
+ 'port' => 443,
+ 'ipath' => '/'
+ ),
+ );
+
+ /**
+ * Return the entire IRI when you try and read the object as a string
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->get_iri();
+ }
+
+ /**
+ * Overload __set() to provide access via properties
+ *
+ * @param string $name Property name
+ * @param mixed $value Property value
+ */
+ public function __set($name, $value)
+ {
+ if (method_exists($this, 'set_' . $name))
+ {
+ call_user_func(array($this, 'set_' . $name), $value);
+ }
+ elseif (
+ $name === 'iauthority'
+ || $name === 'iuserinfo'
+ || $name === 'ihost'
+ || $name === 'ipath'
+ || $name === 'iquery'
+ || $name === 'ifragment'
+ )
+ {
+ call_user_func(array($this, 'set_' . substr($name, 1)), $value);
+ }
+ }
+
+ /**
+ * Overload __get() to provide access via properties
+ *
+ * @param string $name Property name
+ * @return mixed
+ */
+ public function __get($name)
+ {
+ // isset() returns false for null, we don't want to do that
+ // Also why we use array_key_exists below instead of isset()
+ $props = get_object_vars($this);
+
+ if (
+ $name === 'iri' ||
+ $name === 'uri' ||
+ $name === 'iauthority' ||
+ $name === 'authority'
+ )
+ {
+ $return = $this->{"get_$name"}();
+ }
+ elseif (array_key_exists($name, $props))
+ {
+ $return = $this->$name;
+ }
+ // host -> ihost
+ elseif (($prop = 'i' . $name) && array_key_exists($prop, $props))
+ {
+ $name = $prop;
+ $return = $this->$prop;
+ }
+ // ischeme -> scheme
+ elseif (($prop = substr($name, 1)) && array_key_exists($prop, $props))
+ {
+ $name = $prop;
+ $return = $this->$prop;
+ }
+ else
+ {
+ trigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE);
+ $return = null;
+ }
+
+ if ($return === null && isset($this->normalization[$this->scheme][$name]))
+ {
+ return $this->normalization[$this->scheme][$name];
+ }
+
+ return $return;
+ }
+
+ /**
+ * Overload __isset() to provide access via properties
+ *
+ * @param string $name Property name
+ * @return bool
+ */
+ public function __isset($name)
+ {
+ return method_exists($this, 'get_' . $name) || isset($this->$name);
+ }
+
+ /**
+ * Overload __unset() to provide access via properties
+ *
+ * @param string $name Property name
+ */
+ public function __unset($name)
+ {
+ if (method_exists($this, 'set_' . $name))
+ {
+ call_user_func(array($this, 'set_' . $name), '');
+ }
+ }
+
+ /**
+ * Create a new IRI object, from a specified string
+ *
+ * @param string $iri
+ */
+ public function __construct($iri = null)
+ {
+ $this->set_iri($iri);
+ }
+
+ /**
+ * Clean up
+ */
+ public function __destruct() {
+ $this->set_iri(null, true);
+ $this->set_path(null, true);
+ $this->set_authority(null, true);
+ }
+
+ /**
+ * Create a new IRI object by resolving a relative IRI
+ *
+ * Returns false if $base is not absolute, otherwise an IRI.
+ *
+ * @param IRI|string $base (Absolute) Base IRI
+ * @param IRI|string $relative Relative IRI
+ * @return IRI|false
+ */
+ public static function absolutize($base, $relative)
+ {
+ if (!($relative instanceof SimplePie_IRI))
+ {
+ $relative = new SimplePie_IRI($relative);
+ }
+ if (!$relative->is_valid())
+ {
+ return false;
+ }
+ elseif ($relative->scheme !== null)
+ {
+ return clone $relative;
+ }
+ else
+ {
+ if (!($base instanceof SimplePie_IRI))
+ {
+ $base = new SimplePie_IRI($base);
+ }
+ if ($base->scheme !== null && $base->is_valid())
+ {
+ if ($relative->get_iri() !== '')
+ {
+ if ($relative->iuserinfo !== null || $relative->ihost !== null || $relative->port !== null)
+ {
+ $target = clone $relative;
+ $target->scheme = $base->scheme;
+ }
+ else
+ {
+ $target = new SimplePie_IRI;
+ $target->scheme = $base->scheme;
+ $target->iuserinfo = $base->iuserinfo;
+ $target->ihost = $base->ihost;
+ $target->port = $base->port;
+ if ($relative->ipath !== '')
+ {
+ if ($relative->ipath[0] === '/')
+ {
+ $target->ipath = $relative->ipath;
+ }
+ elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '')
+ {
+ $target->ipath = '/' . $relative->ipath;
+ }
+ elseif (($last_segment = strrpos($base->ipath, '/')) !== false)
+ {
+ $target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath;
+ }
+ else
+ {
+ $target->ipath = $relative->ipath;
+ }
+ $target->ipath = $target->remove_dot_segments($target->ipath);
+ $target->iquery = $relative->iquery;
+ }
+ else
+ {
+ $target->ipath = $base->ipath;
+ if ($relative->iquery !== null)
+ {
+ $target->iquery = $relative->iquery;
+ }
+ elseif ($base->iquery !== null)
+ {
+ $target->iquery = $base->iquery;
+ }
+ }
+ $target->ifragment = $relative->ifragment;
+ }
+ }
+ else
+ {
+ $target = clone $base;
+ $target->ifragment = null;
+ }
+ $target->scheme_normalization();
+ return $target;
+ }
+
+ return false;
+ }
+ }
+
+ /**
+ * Parse an IRI into scheme/authority/path/query/fragment segments
+ *
+ * @param string $iri
+ * @return array
+ */
+ protected function parse_iri($iri)
+ {
+ $iri = trim($iri, "\x20\x09\x0A\x0C\x0D");
+ if (preg_match('/^((?P[^:\/?#]+):)?(\/\/(?P[^\/?#]*))?(?P[^?#]*)(\?(?P[^#]*))?(#(?P.*))?$/', $iri, $match))
+ {
+ if ($match[1] === '')
+ {
+ $match['scheme'] = null;
+ }
+ if (!isset($match[3]) || $match[3] === '')
+ {
+ $match['authority'] = null;
+ }
+ if (!isset($match[5]))
+ {
+ $match['path'] = '';
+ }
+ if (!isset($match[6]) || $match[6] === '')
+ {
+ $match['query'] = null;
+ }
+ if (!isset($match[8]) || $match[8] === '')
+ {
+ $match['fragment'] = null;
+ }
+ return $match;
+ }
+
+ // This can occur when a paragraph is accidentally parsed as a URI
+ return false;
+ }
+
+ /**
+ * Remove dot segments from a path
+ *
+ * @param string $input
+ * @return string
+ */
+ protected function remove_dot_segments($input)
+ {
+ $output = '';
+ while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..')
+ {
+ // A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise,
+ if (strpos($input, '../') === 0)
+ {
+ $input = substr($input, 3);
+ }
+ elseif (strpos($input, './') === 0)
+ {
+ $input = substr($input, 2);
+ }
+ // B: if the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise,
+ elseif (strpos($input, '/./') === 0)
+ {
+ $input = substr($input, 2);
+ }
+ elseif ($input === '/.')
+ {
+ $input = '/';
+ }
+ // C: if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise,
+ elseif (strpos($input, '/../') === 0)
+ {
+ $input = substr($input, 3);
+ $output = substr_replace($output, '', strrpos($output, '/'));
+ }
+ elseif ($input === '/..')
+ {
+ $input = '/';
+ $output = substr_replace($output, '', strrpos($output, '/'));
+ }
+ // D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise,
+ elseif ($input === '.' || $input === '..')
+ {
+ $input = '';
+ }
+ // E: move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer
+ elseif (($pos = strpos($input, '/', 1)) !== false)
+ {
+ $output .= substr($input, 0, $pos);
+ $input = substr_replace($input, '', 0, $pos);
+ }
+ else
+ {
+ $output .= $input;
+ $input = '';
+ }
+ }
+ return $output . $input;
+ }
+
+ /**
+ * Replace invalid character with percent encoding
+ *
+ * @param string $string Input string
+ * @param string $extra_chars Valid characters not in iunreserved or
+ * iprivate (this is ASCII-only)
+ * @param bool $iprivate Allow iprivate
+ * @return string
+ */
+ protected function replace_invalid_with_pct_encoding($string, $extra_chars, $iprivate = false)
+ {
+ // Normalize as many pct-encoded sections as possible
+ $string = preg_replace_callback('/(?:%[A-Fa-f0-9]{2})+/', array($this, 'remove_iunreserved_percent_encoded'), $string);
+
+ // Replace invalid percent characters
+ $string = preg_replace('/%(?![A-Fa-f0-9]{2})/', '%25', $string);
+
+ // Add unreserved and % to $extra_chars (the latter is safe because all
+ // pct-encoded sections are now valid).
+ $extra_chars .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~%';
+
+ // Now replace any bytes that aren't allowed with their pct-encoded versions
+ $position = 0;
+ $strlen = strlen($string);
+ while (($position += strspn($string, $extra_chars, $position)) < $strlen)
+ {
+ $value = ord($string[$position]);
+
+ // Start position
+ $start = $position;
+
+ // By default we are valid
+ $valid = true;
+
+ // No one byte sequences are valid due to the while.
+ // Two byte sequence:
+ if (($value & 0xE0) === 0xC0)
+ {
+ $character = ($value & 0x1F) << 6;
+ $length = 2;
+ $remaining = 1;
+ }
+ // Three byte sequence:
+ elseif (($value & 0xF0) === 0xE0)
+ {
+ $character = ($value & 0x0F) << 12;
+ $length = 3;
+ $remaining = 2;
+ }
+ // Four byte sequence:
+ elseif (($value & 0xF8) === 0xF0)
+ {
+ $character = ($value & 0x07) << 18;
+ $length = 4;
+ $remaining = 3;
+ }
+ // Invalid byte:
+ else
+ {
+ $valid = false;
+ $length = 1;
+ $remaining = 0;
+ }
+
+ if ($remaining)
+ {
+ if ($position + $length <= $strlen)
+ {
+ for ($position++; $remaining; $position++)
+ {
+ $value = ord($string[$position]);
+
+ // Check that the byte is valid, then add it to the character:
+ if (($value & 0xC0) === 0x80)
+ {
+ $character |= ($value & 0x3F) << (--$remaining * 6);
+ }
+ // If it is invalid, count the sequence as invalid and reprocess the current byte:
+ else
+ {
+ $valid = false;
+ $position--;
+ break;
+ }
+ }
+ }
+ else
+ {
+ $position = $strlen - 1;
+ $valid = false;
+ }
+ }
+
+ // Percent encode anything invalid or not in ucschar
+ if (
+ // Invalid sequences
+ !$valid
+ // Non-shortest form sequences are invalid
+ || $length > 1 && $character <= 0x7F
+ || $length > 2 && $character <= 0x7FF
+ || $length > 3 && $character <= 0xFFFF
+ // Outside of range of ucschar codepoints
+ // Noncharacters
+ || ($character & 0xFFFE) === 0xFFFE
+ || $character >= 0xFDD0 && $character <= 0xFDEF
+ || (
+ // Everything else not in ucschar
+ $character > 0xD7FF && $character < 0xF900
+ || $character < 0xA0
+ || $character > 0xEFFFD
+ )
+ && (
+ // Everything not in iprivate, if it applies
+ !$iprivate
+ || $character < 0xE000
+ || $character > 0x10FFFD
+ )
+ )
+ {
+ // If we were a character, pretend we weren't, but rather an error.
+ if ($valid)
+ $position--;
+
+ for ($j = $start; $j <= $position; $j++)
+ {
+ $string = substr_replace($string, sprintf('%%%02X', ord($string[$j])), $j, 1);
+ $j += 2;
+ $position += 2;
+ $strlen += 2;
+ }
+ }
+ }
+
+ return $string;
+ }
+
+ /**
+ * Callback function for preg_replace_callback.
+ *
+ * Removes sequences of percent encoded bytes that represent UTF-8
+ * encoded characters in iunreserved
+ *
+ * @param array $match PCRE match
+ * @return string Replacement
+ */
+ protected function remove_iunreserved_percent_encoded($match)
+ {
+ // As we just have valid percent encoded sequences we can just explode
+ // and ignore the first member of the returned array (an empty string).
+ $bytes = explode('%', $match[0]);
+
+ // Initialize the new string (this is what will be returned) and that
+ // there are no bytes remaining in the current sequence (unsurprising
+ // at the first byte!).
+ $string = '';
+ $remaining = 0;
+
+ // Loop over each and every byte, and set $value to its value
+ for ($i = 1, $len = count($bytes); $i < $len; $i++)
+ {
+ $value = hexdec($bytes[$i]);
+
+ // If we're the first byte of sequence:
+ if (!$remaining)
+ {
+ // Start position
+ $start = $i;
+
+ // By default we are valid
+ $valid = true;
+
+ // One byte sequence:
+ if ($value <= 0x7F)
+ {
+ $character = $value;
+ $length = 1;
+ }
+ // Two byte sequence:
+ elseif (($value & 0xE0) === 0xC0)
+ {
+ $character = ($value & 0x1F) << 6;
+ $length = 2;
+ $remaining = 1;
+ }
+ // Three byte sequence:
+ elseif (($value & 0xF0) === 0xE0)
+ {
+ $character = ($value & 0x0F) << 12;
+ $length = 3;
+ $remaining = 2;
+ }
+ // Four byte sequence:
+ elseif (($value & 0xF8) === 0xF0)
+ {
+ $character = ($value & 0x07) << 18;
+ $length = 4;
+ $remaining = 3;
+ }
+ // Invalid byte:
+ else
+ {
+ $valid = false;
+ $remaining = 0;
+ }
+ }
+ // Continuation byte:
+ else
+ {
+ // Check that the byte is valid, then add it to the character:
+ if (($value & 0xC0) === 0x80)
+ {
+ $remaining--;
+ $character |= ($value & 0x3F) << ($remaining * 6);
+ }
+ // If it is invalid, count the sequence as invalid and reprocess the current byte as the start of a sequence:
+ else
+ {
+ $valid = false;
+ $remaining = 0;
+ $i--;
+ }
+ }
+
+ // If we've reached the end of the current byte sequence, append it to Unicode::$data
+ if (!$remaining)
+ {
+ // Percent encode anything invalid or not in iunreserved
+ if (
+ // Invalid sequences
+ !$valid
+ // Non-shortest form sequences are invalid
+ || $length > 1 && $character <= 0x7F
+ || $length > 2 && $character <= 0x7FF
+ || $length > 3 && $character <= 0xFFFF
+ // Outside of range of iunreserved codepoints
+ || $character < 0x2D
+ || $character > 0xEFFFD
+ // Noncharacters
+ || ($character & 0xFFFE) === 0xFFFE
+ || $character >= 0xFDD0 && $character <= 0xFDEF
+ // Everything else not in iunreserved (this is all BMP)
+ || $character === 0x2F
+ || $character > 0x39 && $character < 0x41
+ || $character > 0x5A && $character < 0x61
+ || $character > 0x7A && $character < 0x7E
+ || $character > 0x7E && $character < 0xA0
+ || $character > 0xD7FF && $character < 0xF900
+ )
+ {
+ for ($j = $start; $j <= $i; $j++)
+ {
+ $string .= '%' . strtoupper($bytes[$j]);
+ }
+ }
+ else
+ {
+ for ($j = $start; $j <= $i; $j++)
+ {
+ $string .= chr(hexdec($bytes[$j]));
+ }
+ }
+ }
+ }
+
+ // If we have any bytes left over they are invalid (i.e., we are
+ // mid-way through a multi-byte sequence)
+ if ($remaining)
+ {
+ for ($j = $start; $j < $len; $j++)
+ {
+ $string .= '%' . strtoupper($bytes[$j]);
+ }
+ }
+
+ return $string;
+ }
+
+ protected function scheme_normalization()
+ {
+ if (isset($this->normalization[$this->scheme]['iuserinfo']) && $this->iuserinfo === $this->normalization[$this->scheme]['iuserinfo'])
+ {
+ $this->iuserinfo = null;
+ }
+ if (isset($this->normalization[$this->scheme]['ihost']) && $this->ihost === $this->normalization[$this->scheme]['ihost'])
+ {
+ $this->ihost = null;
+ }
+ if (isset($this->normalization[$this->scheme]['port']) && $this->port === $this->normalization[$this->scheme]['port'])
+ {
+ $this->port = null;
+ }
+ if (isset($this->normalization[$this->scheme]['ipath']) && $this->ipath === $this->normalization[$this->scheme]['ipath'])
+ {
+ $this->ipath = '';
+ }
+ if (isset($this->normalization[$this->scheme]['iquery']) && $this->iquery === $this->normalization[$this->scheme]['iquery'])
+ {
+ $this->iquery = null;
+ }
+ if (isset($this->normalization[$this->scheme]['ifragment']) && $this->ifragment === $this->normalization[$this->scheme]['ifragment'])
+ {
+ $this->ifragment = null;
+ }
+ }
+
+ /**
+ * Check if the object represents a valid IRI. This needs to be done on each
+ * call as some things change depending on another part of the IRI.
+ *
+ * @return bool
+ */
+ public function is_valid()
+ {
+ if ($this->ipath === '') return true;
+
+ $isauthority = $this->iuserinfo !== null || $this->ihost !== null ||
+ $this->port !== null;
+ if ($isauthority && $this->ipath[0] === '/') return true;
+
+ if (!$isauthority && (substr($this->ipath, 0, 2) === '//')) return false;
+
+ // Relative urls cannot have a colon in the first path segment (and the
+ // slashes themselves are not included so skip the first character).
+ if (!$this->scheme && !$isauthority &&
+ strpos($this->ipath, ':') !== false &&
+ strpos($this->ipath, '/', 1) !== false &&
+ strpos($this->ipath, ':') < strpos($this->ipath, '/', 1)) return false;
+
+ return true;
+ }
+
+ /**
+ * Set the entire IRI. Returns true on success, false on failure (if there
+ * are any invalid characters).
+ *
+ * @param string $iri
+ * @return bool
+ */
+ public function set_iri($iri, $clear_cache = false)
+ {
+ static $cache;
+ if ($clear_cache)
+ {
+ $cache = null;
+ return;
+ }
+ if (!$cache)
+ {
+ $cache = array();
+ }
+
+ if ($iri === null)
+ {
+ return true;
+ }
+ elseif (isset($cache[$iri]))
+ {
+ list($this->scheme,
+ $this->iuserinfo,
+ $this->ihost,
+ $this->port,
+ $this->ipath,
+ $this->iquery,
+ $this->ifragment,
+ $return) = $cache[$iri];
+ return $return;
+ }
+
+ $parsed = $this->parse_iri((string) $iri);
+ if (!$parsed)
+ {
+ return false;
+ }
+
+ $return = $this->set_scheme($parsed['scheme'])
+ && $this->set_authority($parsed['authority'])
+ && $this->set_path($parsed['path'])
+ && $this->set_query($parsed['query'])
+ && $this->set_fragment($parsed['fragment']);
+
+ $cache[$iri] = array($this->scheme,
+ $this->iuserinfo,
+ $this->ihost,
+ $this->port,
+ $this->ipath,
+ $this->iquery,
+ $this->ifragment,
+ $return);
+ return $return;
+ }
+
+ /**
+ * Set the scheme. Returns true on success, false on failure (if there are
+ * any invalid characters).
+ *
+ * @param string $scheme
+ * @return bool
+ */
+ public function set_scheme($scheme)
+ {
+ if ($scheme === null)
+ {
+ $this->scheme = null;
+ }
+ elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme))
+ {
+ $this->scheme = null;
+ return false;
+ }
+ else
+ {
+ $this->scheme = strtolower($scheme);
+ }
+ return true;
+ }
+
+ /**
+ * Set the authority. Returns true on success, false on failure (if there are
+ * any invalid characters).
+ *
+ * @param string $authority
+ * @return bool
+ */
+ public function set_authority($authority, $clear_cache = false)
+ {
+ static $cache;
+ if ($clear_cache)
+ {
+ $cache = null;
+ return;
+ }
+ if (!$cache)
+ $cache = array();
+
+ if ($authority === null)
+ {
+ $this->iuserinfo = null;
+ $this->ihost = null;
+ $this->port = null;
+ return true;
+ }
+ elseif (isset($cache[$authority]))
+ {
+ list($this->iuserinfo,
+ $this->ihost,
+ $this->port,
+ $return) = $cache[$authority];
+
+ return $return;
+ }
+
+ $remaining = $authority;
+ if (($iuserinfo_end = strrpos($remaining, '@')) !== false)
+ {
+ $iuserinfo = substr($remaining, 0, $iuserinfo_end);
+ $remaining = substr($remaining, $iuserinfo_end + 1);
+ }
+ else
+ {
+ $iuserinfo = null;
+ }
+ if (($port_start = strpos($remaining, ':', strpos($remaining, ']'))) !== false)
+ {
+ if (($port = substr($remaining, $port_start + 1)) === false)
+ {
+ $port = null;
+ }
+ $remaining = substr($remaining, 0, $port_start);
+ }
+ else
+ {
+ $port = null;
+ }
+
+ $return = $this->set_userinfo($iuserinfo) &&
+ $this->set_host($remaining) &&
+ $this->set_port($port);
+
+ $cache[$authority] = array($this->iuserinfo,
+ $this->ihost,
+ $this->port,
+ $return);
+
+ return $return;
+ }
+
+ /**
+ * Set the iuserinfo.
+ *
+ * @param string $iuserinfo
+ * @return bool
+ */
+ public function set_userinfo($iuserinfo)
+ {
+ if ($iuserinfo === null)
+ {
+ $this->iuserinfo = null;
+ }
+ else
+ {
+ $this->iuserinfo = $this->replace_invalid_with_pct_encoding($iuserinfo, '!$&\'()*+,;=:');
+ $this->scheme_normalization();
+ }
+
+ return true;
+ }
+
+ /**
+ * Set the ihost. Returns true on success, false on failure (if there are
+ * any invalid characters).
+ *
+ * @param string $ihost
+ * @return bool
+ */
+ public function set_host($ihost)
+ {
+ if ($ihost === null)
+ {
+ $this->ihost = null;
+ return true;
+ }
+ elseif (substr($ihost, 0, 1) === '[' && substr($ihost, -1) === ']')
+ {
+ if (SimplePie_Net_IPv6::check_ipv6(substr($ihost, 1, -1)))
+ {
+ $this->ihost = '[' . SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)) . ']';
+ }
+ else
+ {
+ $this->ihost = null;
+ return false;
+ }
+ }
+ else
+ {
+ $ihost = $this->replace_invalid_with_pct_encoding($ihost, '!$&\'()*+,;=');
+
+ // Lowercase, but ignore pct-encoded sections (as they should
+ // remain uppercase). This must be done after the previous step
+ // as that can add unescaped characters.
+ $position = 0;
+ $strlen = strlen($ihost);
+ while (($position += strcspn($ihost, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ%', $position)) < $strlen)
+ {
+ if ($ihost[$position] === '%')
+ {
+ $position += 3;
+ }
+ else
+ {
+ $ihost[$position] = strtolower($ihost[$position]);
+ $position++;
+ }
+ }
+
+ $this->ihost = $ihost;
+ }
+
+ $this->scheme_normalization();
+
+ return true;
+ }
+
+ /**
+ * Set the port. Returns true on success, false on failure (if there are
+ * any invalid characters).
+ *
+ * @param string $port
+ * @return bool
+ */
+ public function set_port($port)
+ {
+ if ($port === null)
+ {
+ $this->port = null;
+ return true;
+ }
+ elseif (strspn($port, '0123456789') === strlen($port))
+ {
+ $this->port = (int) $port;
+ $this->scheme_normalization();
+ return true;
+ }
+
+ $this->port = null;
+ return false;
+ }
+
+ /**
+ * Set the ipath.
+ *
+ * @param string $ipath
+ * @return bool
+ */
+ public function set_path($ipath, $clear_cache = false)
+ {
+ static $cache;
+ if ($clear_cache)
+ {
+ $cache = null;
+ return;
+ }
+ if (!$cache)
+ {
+ $cache = array();
+ }
+
+ $ipath = (string) $ipath;
+
+ if (isset($cache[$ipath]))
+ {
+ $this->ipath = $cache[$ipath][(int) ($this->scheme !== null)];
+ }
+ else
+ {
+ $valid = $this->replace_invalid_with_pct_encoding($ipath, '!$&\'()*+,;=@:/');
+ $removed = $this->remove_dot_segments($valid);
+
+ $cache[$ipath] = array($valid, $removed);
+ $this->ipath = ($this->scheme !== null) ? $removed : $valid;
+ }
+
+ $this->scheme_normalization();
+ return true;
+ }
+
+ /**
+ * Set the iquery.
+ *
+ * @param string $iquery
+ * @return bool
+ */
+ public function set_query($iquery)
+ {
+ if ($iquery === null)
+ {
+ $this->iquery = null;
+ }
+ else
+ {
+ $this->iquery = $this->replace_invalid_with_pct_encoding($iquery, '!$&\'()*+,;=:@/?', true);
+ $this->scheme_normalization();
+ }
+ return true;
+ }
+
+ /**
+ * Set the ifragment.
+ *
+ * @param string $ifragment
+ * @return bool
+ */
+ public function set_fragment($ifragment)
+ {
+ if ($ifragment === null)
+ {
+ $this->ifragment = null;
+ }
+ else
+ {
+ $this->ifragment = $this->replace_invalid_with_pct_encoding($ifragment, '!$&\'()*+,;=:@/?');
+ $this->scheme_normalization();
+ }
+ return true;
+ }
+
+ /**
+ * Convert an IRI to a URI (or parts thereof)
+ *
+ * @return string
+ */
+ public function to_uri($string)
+ {
+ static $non_ascii;
+ if (!$non_ascii)
+ {
+ $non_ascii = implode('', range("\x80", "\xFF"));
+ }
+
+ $position = 0;
+ $strlen = strlen($string);
+ while (($position += strcspn($string, $non_ascii, $position)) < $strlen)
+ {
+ $string = substr_replace($string, sprintf('%%%02X', ord($string[$position])), $position, 1);
+ $position += 3;
+ $strlen += 2;
+ }
+
+ return $string;
+ }
+
+ /**
+ * Get the complete IRI
+ *
+ * @return string
+ */
+ public function get_iri()
+ {
+ if (!$this->is_valid())
+ {
+ return false;
+ }
+
+ $iri = '';
+ if ($this->scheme !== null)
+ {
+ $iri .= $this->scheme . ':';
+ }
+ if (($iauthority = $this->get_iauthority()) !== null)
+ {
+ $iri .= '//' . $iauthority;
+ }
+ if ($this->ipath !== '')
+ {
+ $iri .= $this->ipath;
+ }
+ elseif (!empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '')
+ {
+ $iri .= $this->normalization[$this->scheme]['ipath'];
+ }
+ if ($this->iquery !== null)
+ {
+ $iri .= '?' . $this->iquery;
+ }
+ if ($this->ifragment !== null)
+ {
+ $iri .= '#' . $this->ifragment;
+ }
+
+ return $iri;
+ }
+
+ /**
+ * Get the complete URI
+ *
+ * @return string
+ */
+ public function get_uri()
+ {
+ return $this->to_uri($this->get_iri());
+ }
+
+ /**
+ * Get the complete iauthority
+ *
+ * @return string
+ */
+ protected function get_iauthority()
+ {
+ if ($this->iuserinfo !== null || $this->ihost !== null || $this->port !== null)
+ {
+ $iauthority = '';
+ if ($this->iuserinfo !== null)
+ {
+ $iauthority .= $this->iuserinfo . '@';
+ }
+ if ($this->ihost !== null)
+ {
+ $iauthority .= $this->ihost;
+ }
+ if ($this->port !== null && $this->port !== 0)
+ {
+ $iauthority .= ':' . $this->port;
+ }
+ return $iauthority;
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the complete authority
+ *
+ * @return string
+ */
+ protected function get_authority()
+ {
+ $iauthority = $this->get_iauthority();
+ if (is_string($iauthority))
+ return $this->to_uri($iauthority);
+
+ return $iauthority;
+ }
+}
+
+class_alias('SimplePie_IRI', 'SimplePie\IRI', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Item.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Item.php
new file mode 100644
index 0000000000..02f158bfc6
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Item.php
@@ -0,0 +1,2969 @@
+feed = $feed;
+ $this->data = $data;
+ }
+
+ /**
+ * Set the registry handler
+ *
+ * This is usually used by {@see SimplePie_Registry::create}
+ *
+ * @since 1.3
+ * @param SimplePie_Registry $registry
+ */
+ public function set_registry(SimplePie_Registry $registry)
+ {
+ $this->registry = $registry;
+ }
+
+ /**
+ * Get a string representation of the item
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return md5(serialize($this->data));
+ }
+
+ /**
+ * Remove items that link back to this before destroying this object
+ */
+ public function __destruct()
+ {
+ if (!gc_enabled())
+ {
+ unset($this->feed);
+ }
+ }
+
+ /**
+ * Get data for an item-level element
+ *
+ * This method allows you to get access to ANY element/attribute that is a
+ * sub-element of the item/entry tag.
+ *
+ * See {@see SimplePie::get_feed_tags()} for a description of the return value
+ *
+ * @since 1.0
+ * @see http://simplepie.org/wiki/faq/supported_xml_namespaces
+ * @param string $namespace The URL of the XML namespace of the elements you're trying to access
+ * @param string $tag Tag name
+ * @return array
+ */
+ public function get_item_tags($namespace, $tag)
+ {
+ if (isset($this->data['child'][$namespace][$tag]))
+ {
+ return $this->data['child'][$namespace][$tag];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the base URL value from the parent feed
+ *
+ * Uses ``
+ *
+ * @param array $element
+ * @return string
+ */
+ public function get_base($element = array())
+ {
+ return $this->feed->get_base($element);
+ }
+
+ /**
+ * Sanitize feed data
+ *
+ * @access private
+ * @see SimplePie::sanitize()
+ * @param string $data Data to sanitize
+ * @param int $type One of the SIMPLEPIE_CONSTRUCT_* constants
+ * @param string $base Base URL to resolve URLs against
+ * @return string Sanitized data
+ */
+ public function sanitize($data, $type, $base = '')
+ {
+ return $this->feed->sanitize($data, $type, $base);
+ }
+
+ /**
+ * Get the parent feed
+ *
+ * Note: this may not work as you think for multifeeds!
+ *
+ * @link http://simplepie.org/faq/typical_multifeed_gotchas#missing_data_from_feed
+ * @since 1.0
+ * @return SimplePie
+ */
+ public function get_feed()
+ {
+ return $this->feed;
+ }
+
+ /**
+ * Get the unique identifier for the item
+ *
+ * This is usually used when writing code to check for new items in a feed.
+ *
+ * Uses ``, ``, `` or the `about` attribute
+ * for RDF. If none of these are supplied (or `$hash` is true), creates an
+ * MD5 hash based on the permalink, title and content.
+ *
+ * @since Beta 2
+ * @param boolean $hash Should we force using a hash instead of the supplied ID?
+ * @param string|false $fn User-supplied function to generate an hash
+ * @return string|null
+ */
+ public function get_id($hash = false, $fn = 'md5')
+ {
+ if (!$hash)
+ {
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'id'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'id'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'identifier'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'identifier'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif (isset($this->data['attribs'][SIMPLEPIE_NAMESPACE_RDF]['about']))
+ {
+ return $this->sanitize($this->data['attribs'][SIMPLEPIE_NAMESPACE_RDF]['about'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ }
+ if ($fn === false)
+ {
+ return null;
+ }
+ elseif (!is_callable($fn))
+ {
+ trigger_error('User-supplied function $fn must be callable', E_USER_WARNING);
+ $fn = 'md5';
+ }
+ return call_user_func($fn,
+ $this->get_permalink().$this->get_title().$this->get_content());
+ }
+
+ /**
+ * Get the title of the item
+ *
+ * Uses ``, `` or ``
+ *
+ * @since Beta 2 (previously called `get_item_title` since 0.8)
+ * @return string|null
+ */
+ public function get_title()
+ {
+ if (!isset($this->data['title']))
+ {
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title'))
+ {
+ $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $this->data['title'] = null;
+ }
+ }
+ return $this->data['title'];
+ }
+
+ /**
+ * Get the content for the item
+ *
+ * Prefers summaries over full content , but will return full content if a
+ * summary does not exist.
+ *
+ * To prefer full content instead, use {@see get_content}
+ *
+ * Uses ``, ``, `` or
+ * ``
+ *
+ * @since 0.8
+ * @param boolean $description_only Should we avoid falling back to the content?
+ * @return string|null
+ */
+ public function get_description($description_only = false)
+ {
+ if (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'summary')) &&
+ ($return = $this->sanitize($tags[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($tags[0]['attribs'])), $this->get_base($tags[0]))))
+ {
+ return $return;
+ }
+ elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'summary')) &&
+ ($return = $this->sanitize($tags[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($tags[0]['attribs'])), $this->get_base($tags[0]))))
+ {
+ return $return;
+ }
+ elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) &&
+ ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($tags[0]))))
+ {
+ return $return;
+ }
+ elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) &&
+ ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($tags[0]))))
+ {
+ return $return;
+ }
+ elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) &&
+ ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)))
+ {
+ return $return;
+ }
+ elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) &&
+ ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)))
+ {
+ return $return;
+ }
+ elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) &&
+ ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($tags[0]))))
+ {
+ return $return;
+ }
+ elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) &&
+ ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)))
+ {
+ return $return;
+ }
+ elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description')) &&
+ ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_HTML)))
+ {
+ return $return;
+ }
+
+ elseif (!$description_only)
+ {
+ return $this->get_content(true);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the content for the item
+ *
+ * Prefers full content over summaries, but will return a summary if full
+ * content does not exist.
+ *
+ * To prefer summaries instead, use {@see get_description}
+ *
+ * Uses `` or `` (RSS 1.0 Content Module)
+ *
+ * @since 1.0
+ * @param boolean $content_only Should we avoid falling back to the description?
+ * @return string|null
+ */
+ public function get_content($content_only = false)
+ {
+ if (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'content')) &&
+ ($return = $this->sanitize($tags[0]['data'], $this->registry->call('Misc', 'atom_10_content_construct_type', array($tags[0]['attribs'])), $this->get_base($tags[0]))))
+ {
+ return $return;
+ }
+ elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'content')) &&
+ ($return = $this->sanitize($tags[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($tags[0]['attribs'])), $this->get_base($tags[0]))))
+ {
+ return $return;
+ }
+ elseif (($tags = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT, 'encoded')) &&
+ ($return = $this->sanitize($tags[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($tags[0]))))
+ {
+ return $return;
+ }
+ elseif (!$content_only)
+ {
+ return $this->get_description(true);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the media:thumbnail of the item
+ *
+ * Uses ``
+ *
+ *
+ * @return array|null
+ */
+ public function get_thumbnail()
+ {
+ if (!isset($this->data['thumbnail']))
+ {
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail'))
+ {
+ $this->data['thumbnail'] = $return[0]['attribs'][''];
+ }
+ else
+ {
+ $this->data['thumbnail'] = null;
+ }
+ }
+ return $this->data['thumbnail'];
+ }
+
+ /**
+ * Get a category for the item
+ *
+ * @since Beta 3 (previously called `get_categories()` since Beta 2)
+ * @param int $key The category that you want to return. Remember that arrays begin with 0, not 1
+ * @return SimplePie_Category|null
+ */
+ public function get_category($key = 0)
+ {
+ $categories = $this->get_categories();
+ if (isset($categories[$key]))
+ {
+ return $categories[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get all categories for the item
+ *
+ * Uses ``, `` or ``
+ *
+ * @since Beta 3
+ * @return SimplePie_Category[]|null List of {@see SimplePie_Category} objects
+ */
+ public function get_categories()
+ {
+ $categories = array();
+
+ $type = 'category';
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, $type) as $category)
+ {
+ $term = null;
+ $scheme = null;
+ $label = null;
+ if (isset($category['attribs']['']['term']))
+ {
+ $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['scheme']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['label']))
+ {
+ $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories[] = $this->registry->create('Category', array($term, $scheme, $label, $type));
+ }
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, $type) as $category)
+ {
+ // This is really the label, but keep this as the term also for BC.
+ // Label will also work on retrieving because that falls back to term.
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ if (isset($category['attribs']['']['domain']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = null;
+ }
+ $categories[] = $this->registry->create('Category', array($term, $scheme, null, $type));
+ }
+
+ $type = 'subject';
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, $type) as $category)
+ {
+ $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null, $type));
+ }
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, $type) as $category)
+ {
+ $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null, $type));
+ }
+
+ if (!empty($categories))
+ {
+ return array_unique($categories);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get an author for the item
+ *
+ * @since Beta 2
+ * @param int $key The author that you want to return. Remember that arrays begin with 0, not 1
+ * @return SimplePie_Author|null
+ */
+ public function get_author($key = 0)
+ {
+ $authors = $this->get_authors();
+ if (isset($authors[$key]))
+ {
+ return $authors[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get a contributor for the item
+ *
+ * @since 1.1
+ * @param int $key The contrbutor that you want to return. Remember that arrays begin with 0, not 1
+ * @return SimplePie_Author|null
+ */
+ public function get_contributor($key = 0)
+ {
+ $contributors = $this->get_contributors();
+ if (isset($contributors[$key]))
+ {
+ return $contributors[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get all contributors for the item
+ *
+ * Uses ``
+ *
+ * @since 1.1
+ * @return SimplePie_Author[]|null List of {@see SimplePie_Author} objects
+ */
+ public function get_contributors()
+ {
+ $contributors = array();
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)
+ {
+ $name = null;
+ $uri = null;
+ $email = null;
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
+ {
+ $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
+ {
+ $uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
+ {
+ $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $uri !== null)
+ {
+ $contributors[] = $this->registry->create('Author', array($name, $uri, $email));
+ }
+ }
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor)
+ {
+ $name = null;
+ $url = null;
+ $email = null;
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
+ {
+ $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
+ {
+ $url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
+ {
+ $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $url !== null)
+ {
+ $contributors[] = $this->registry->create('Author', array($name, $url, $email));
+ }
+ }
+
+ if (!empty($contributors))
+ {
+ return array_unique($contributors);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get all authors for the item
+ *
+ * Uses ``, ``, `` or ``
+ *
+ * @since Beta 2
+ * @return SimplePie_Author[]|null List of {@see SimplePie_Author} objects
+ */
+ public function get_authors()
+ {
+ $authors = array();
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)
+ {
+ $name = null;
+ $uri = null;
+ $email = null;
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
+ {
+ $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
+ {
+ $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
+ }
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
+ {
+ $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $uri !== null)
+ {
+ $authors[] = $this->registry->create('Author', array($name, $uri, $email));
+ }
+ }
+ if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
+ {
+ $name = null;
+ $url = null;
+ $email = null;
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
+ {
+ $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
+ {
+ $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
+ }
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
+ {
+ $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $url !== null)
+ {
+ $authors[] = $this->registry->create('Author', array($name, $url, $email));
+ }
+ }
+ if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'author'))
+ {
+ $authors[] = $this->registry->create('Author', array(null, null, $this->sanitize($author[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)));
+ }
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author)
+ {
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
+ }
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author)
+ {
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
+ }
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author)
+ {
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
+ }
+
+ if (!empty($authors))
+ {
+ return array_unique($authors);
+ }
+ elseif (($source = $this->get_source()) && ($authors = $source->get_authors()))
+ {
+ return $authors;
+ }
+ elseif ($authors = $this->feed->get_authors())
+ {
+ return $authors;
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the copyright info for the item
+ *
+ * Uses `` or ``
+ *
+ * @since 1.1
+ * @return string
+ */
+ public function get_copyright()
+ {
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the posting date/time for the item
+ *
+ * Uses ``, ``, ``,
+ * ``, `` or ``
+ *
+ * Note: obeys PHP's timezone setting. To get a UTC date/time, use
+ * {@see get_gmdate}
+ *
+ * @since Beta 2 (previously called `get_item_date` since 0.8)
+ *
+ * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data)
+ * @return int|string|null
+ */
+ public function get_date($date_format = 'j F Y, g:i a')
+ {
+ if (!isset($this->data['date']))
+ {
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'published'))
+ {
+ $this->data['date']['raw'] = $return[0]['data'];
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate'))
+ {
+ $this->data['date']['raw'] = $return[0]['data'];
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date'))
+ {
+ $this->data['date']['raw'] = $return[0]['data'];
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date'))
+ {
+ $this->data['date']['raw'] = $return[0]['data'];
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated'))
+ {
+ $this->data['date']['raw'] = $return[0]['data'];
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued'))
+ {
+ $this->data['date']['raw'] = $return[0]['data'];
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created'))
+ {
+ $this->data['date']['raw'] = $return[0]['data'];
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified'))
+ {
+ $this->data['date']['raw'] = $return[0]['data'];
+ }
+
+ if (!empty($this->data['date']['raw']))
+ {
+ $parser = $this->registry->call('Parse_Date', 'get');
+ $this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']);
+ }
+ else
+ {
+ $this->data['date'] = null;
+ }
+ }
+ if ($this->data['date'])
+ {
+ $date_format = (string) $date_format;
+ switch ($date_format)
+ {
+ case '':
+ return $this->sanitize($this->data['date']['raw'], SIMPLEPIE_CONSTRUCT_TEXT);
+
+ case 'U':
+ return $this->data['date']['parsed'];
+
+ default:
+ return date($date_format, $this->data['date']['parsed']);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the update date/time for the item
+ *
+ * Uses ``
+ *
+ * Note: obeys PHP's timezone setting. To get a UTC date/time, use
+ * {@see get_gmdate}
+ *
+ * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data)
+ * @return int|string|null
+ */
+ public function get_updated_date($date_format = 'j F Y, g:i a')
+ {
+ if (!isset($this->data['updated']))
+ {
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated'))
+ {
+ $this->data['updated']['raw'] = $return[0]['data'];
+ }
+
+ if (!empty($this->data['updated']['raw']))
+ {
+ $parser = $this->registry->call('Parse_Date', 'get');
+ $this->data['updated']['parsed'] = $parser->parse($this->data['updated']['raw']);
+ }
+ else
+ {
+ $this->data['updated'] = null;
+ }
+ }
+ if ($this->data['updated'])
+ {
+ $date_format = (string) $date_format;
+ switch ($date_format)
+ {
+ case '':
+ return $this->sanitize($this->data['updated']['raw'], SIMPLEPIE_CONSTRUCT_TEXT);
+
+ case 'U':
+ return $this->data['updated']['parsed'];
+
+ default:
+ return date($date_format, $this->data['updated']['parsed']);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the localized posting date/time for the item
+ *
+ * Returns the date formatted in the localized language. To display in
+ * languages other than the server's default, you need to change the locale
+ * with {@link http://php.net/setlocale setlocale()}. The available
+ * localizations depend on which ones are installed on your web server.
+ *
+ * @since 1.0
+ *
+ * @param string $date_format Supports any PHP date format from {@see http://php.net/strftime} (empty for the raw data)
+ * @return int|string|null
+ */
+ public function get_local_date($date_format = '%c')
+ {
+ if (!$date_format)
+ {
+ return $this->sanitize($this->get_date(''), SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif (($date = $this->get_date('U')) !== null && $date !== false)
+ {
+ return strftime($date_format, $date);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the posting date/time for the item (UTC time)
+ *
+ * @see get_date
+ * @param string $date_format Supports any PHP date format from {@see http://php.net/date}
+ * @return int|string|null
+ */
+ public function get_gmdate($date_format = 'j F Y, g:i a')
+ {
+ $date = $this->get_date('U');
+ if ($date === null)
+ {
+ return null;
+ }
+
+ return gmdate($date_format, $date);
+ }
+
+ /**
+ * Get the update date/time for the item (UTC time)
+ *
+ * @see get_updated_date
+ * @param string $date_format Supports any PHP date format from {@see http://php.net/date}
+ * @return int|string|null
+ */
+ public function get_updated_gmdate($date_format = 'j F Y, g:i a')
+ {
+ $date = $this->get_updated_date('U');
+ if ($date === null)
+ {
+ return null;
+ }
+
+ return gmdate($date_format, $date);
+ }
+
+ /**
+ * Get the permalink for the item
+ *
+ * Returns the first link available with a relationship of "alternate".
+ * Identical to {@see get_link()} with key 0
+ *
+ * @see get_link
+ * @since 0.8
+ * @return string|null Permalink URL
+ */
+ public function get_permalink()
+ {
+ $link = $this->get_link();
+ $enclosure = $this->get_enclosure(0);
+ if ($link !== null)
+ {
+ return $link;
+ }
+ elseif ($enclosure !== null)
+ {
+ return $enclosure->get_link();
+ }
+
+ return null;
+ }
+
+ /**
+ * Get a single link for the item
+ *
+ * @since Beta 3
+ * @param int $key The link that you want to return. Remember that arrays begin with 0, not 1
+ * @param string $rel The relationship of the link to return
+ * @return string|null Link URL
+ */
+ public function get_link($key = 0, $rel = 'alternate')
+ {
+ $links = $this->get_links($rel);
+ if ($links && $links[$key] !== null)
+ {
+ return $links[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get all links for the item
+ *
+ * Uses ``, ` ` or ``
+ *
+ * @since Beta 2
+ * @param string $rel The relationship of links to return
+ * @return array|null Links found for the item (strings)
+ */
+ public function get_links($rel = 'alternate')
+ {
+ if (!isset($this->data['links']))
+ {
+ $this->data['links'] = array();
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link)
+ {
+ if (isset($link['attribs']['']['href']))
+ {
+ $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
+ $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
+
+ }
+ }
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link)
+ {
+ if (isset($link['attribs']['']['href']))
+ {
+ $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
+ $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
+ }
+ }
+ if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link'))
+ {
+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
+ }
+ if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link'))
+ {
+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
+ }
+ if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
+ {
+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
+ }
+ if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid'))
+ {
+ if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true')
+ {
+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
+ }
+ }
+
+ $keys = array_keys($this->data['links']);
+ foreach ($keys as $key)
+ {
+ if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
+ {
+ if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
+ {
+ $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);
+ $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];
+ }
+ else
+ {
+ $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
+ }
+ }
+ elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
+ {
+ $this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
+ }
+ $this->data['links'][$key] = array_unique($this->data['links'][$key]);
+ }
+ }
+ if (isset($this->data['links'][$rel]))
+ {
+ return $this->data['links'][$rel];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get an enclosure from the item
+ *
+ * Supports the RSS tag, as well as Media RSS and iTunes RSS.
+ *
+ * @since Beta 2
+ * @todo Add ability to prefer one type of content over another (in a media group).
+ * @param int $key The enclosure that you want to return. Remember that arrays begin with 0, not 1
+ * @return SimplePie_Enclosure|null
+ */
+ public function get_enclosure($key = 0, $prefer = null)
+ {
+ $enclosures = $this->get_enclosures();
+ if (isset($enclosures[$key]))
+ {
+ return $enclosures[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get all available enclosures (podcasts, etc.)
+ *
+ * Supports the RSS tag, as well as Media RSS and iTunes RSS.
+ *
+ * At this point, we're pretty much assuming that all enclosures for an item
+ * are the same content. Anything else is too complicated to
+ * properly support.
+ *
+ * @since Beta 2
+ * @todo Add support for end-user defined sorting of enclosures by type/handler (so we can prefer the faster-loading FLV over MP4).
+ * @todo If an element exists at a level, but its value is empty, we should fall back to the value from the parent (if it exists).
+ * @return SimplePie_Enclosure[]|null List of SimplePie_Enclosure items
+ */
+ public function get_enclosures()
+ {
+ if (!isset($this->data['enclosures']))
+ {
+ $this->data['enclosures'] = array();
+
+ // Elements
+ $captions_parent = null;
+ $categories_parent = null;
+ $copyrights_parent = null;
+ $credits_parent = null;
+ $description_parent = null;
+ $duration_parent = null;
+ $hashes_parent = null;
+ $keywords_parent = null;
+ $player_parent = null;
+ $ratings_parent = null;
+ $restrictions_parent = null;
+ $thumbnails_parent = null;
+ $title_parent = null;
+
+ // Let's do the channel and item-level ones first, and just re-use them if we need to.
+ $parent = $this->get_feed();
+
+ // CAPTIONS
+ if ($captions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text'))
+ {
+ foreach ($captions as $caption)
+ {
+ $caption_type = null;
+ $caption_lang = null;
+ $caption_startTime = null;
+ $caption_endTime = null;
+ $caption_text = null;
+ if (isset($caption['attribs']['']['type']))
+ {
+ $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['lang']))
+ {
+ $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['start']))
+ {
+ $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['end']))
+ {
+ $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['data']))
+ {
+ $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $captions_parent[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
+ }
+ }
+ elseif ($captions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text'))
+ {
+ foreach ($captions as $caption)
+ {
+ $caption_type = null;
+ $caption_lang = null;
+ $caption_startTime = null;
+ $caption_endTime = null;
+ $caption_text = null;
+ if (isset($caption['attribs']['']['type']))
+ {
+ $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['lang']))
+ {
+ $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['start']))
+ {
+ $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['end']))
+ {
+ $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['data']))
+ {
+ $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $captions_parent[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
+ }
+ }
+ if (is_array($captions_parent))
+ {
+ $captions_parent = array_values(array_unique($captions_parent));
+ }
+
+ // CATEGORIES
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'category') as $category)
+ {
+ $term = null;
+ $scheme = null;
+ $label = null;
+ if (isset($category['data']))
+ {
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['scheme']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = 'http://search.yahoo.com/mrss/category_schema';
+ }
+ if (isset($category['attribs']['']['label']))
+ {
+ $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label));
+ }
+ foreach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'category') as $category)
+ {
+ $term = null;
+ $scheme = null;
+ $label = null;
+ if (isset($category['data']))
+ {
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['scheme']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = 'http://search.yahoo.com/mrss/category_schema';
+ }
+ if (isset($category['attribs']['']['label']))
+ {
+ $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label));
+ }
+ foreach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'category') as $category)
+ {
+ $term = null;
+ $scheme = 'http://www.itunes.com/dtds/podcast-1.0.dtd';
+ $label = null;
+ if (isset($category['attribs']['']['text']))
+ {
+ $label = $this->sanitize($category['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label));
+
+ if (isset($category['child'][SIMPLEPIE_NAMESPACE_ITUNES]['category']))
+ {
+ foreach ((array) $category['child'][SIMPLEPIE_NAMESPACE_ITUNES]['category'] as $subcategory)
+ {
+ if (isset($subcategory['attribs']['']['text']))
+ {
+ $label = $this->sanitize($subcategory['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label));
+ }
+ }
+ }
+ if (is_array($categories_parent))
+ {
+ $categories_parent = array_values(array_unique($categories_parent));
+ }
+
+ // COPYRIGHT
+ if ($copyright = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright'))
+ {
+ $copyright_url = null;
+ $copyright_label = null;
+ if (isset($copyright[0]['attribs']['']['url']))
+ {
+ $copyright_url = $this->sanitize($copyright[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($copyright[0]['data']))
+ {
+ $copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $copyrights_parent = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
+ }
+ elseif ($copyright = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright'))
+ {
+ $copyright_url = null;
+ $copyright_label = null;
+ if (isset($copyright[0]['attribs']['']['url']))
+ {
+ $copyright_url = $this->sanitize($copyright[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($copyright[0]['data']))
+ {
+ $copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $copyrights_parent = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
+ }
+
+ // CREDITS
+ if ($credits = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit'))
+ {
+ foreach ($credits as $credit)
+ {
+ $credit_role = null;
+ $credit_scheme = null;
+ $credit_name = null;
+ if (isset($credit['attribs']['']['role']))
+ {
+ $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($credit['attribs']['']['scheme']))
+ {
+ $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $credit_scheme = 'urn:ebu';
+ }
+ if (isset($credit['data']))
+ {
+ $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $credits_parent[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));
+ }
+ }
+ elseif ($credits = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit'))
+ {
+ foreach ($credits as $credit)
+ {
+ $credit_role = null;
+ $credit_scheme = null;
+ $credit_name = null;
+ if (isset($credit['attribs']['']['role']))
+ {
+ $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($credit['attribs']['']['scheme']))
+ {
+ $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $credit_scheme = 'urn:ebu';
+ }
+ if (isset($credit['data']))
+ {
+ $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $credits_parent[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));
+ }
+ }
+ if (is_array($credits_parent))
+ {
+ $credits_parent = array_values(array_unique($credits_parent));
+ }
+
+ // DESCRIPTION
+ if ($description_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description'))
+ {
+ if (isset($description_parent[0]['data']))
+ {
+ $description_parent = $this->sanitize($description_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ }
+ elseif ($description_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description'))
+ {
+ if (isset($description_parent[0]['data']))
+ {
+ $description_parent = $this->sanitize($description_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ }
+
+ // DURATION
+ if ($duration_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'duration'))
+ {
+ $seconds = null;
+ $minutes = null;
+ $hours = null;
+ if (isset($duration_parent[0]['data']))
+ {
+ $temp = explode(':', $this->sanitize($duration_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
+ if (sizeof($temp) > 0)
+ {
+ $seconds = (int) array_pop($temp);
+ }
+ if (sizeof($temp) > 0)
+ {
+ $minutes = (int) array_pop($temp);
+ $seconds += $minutes * 60;
+ }
+ if (sizeof($temp) > 0)
+ {
+ $hours = (int) array_pop($temp);
+ $seconds += $hours * 3600;
+ }
+ unset($temp);
+ $duration_parent = $seconds;
+ }
+ }
+
+ // HASHES
+ if ($hashes_iterator = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash'))
+ {
+ foreach ($hashes_iterator as $hash)
+ {
+ $value = null;
+ $algo = null;
+ if (isset($hash['data']))
+ {
+ $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($hash['attribs']['']['algo']))
+ {
+ $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $algo = 'md5';
+ }
+ $hashes_parent[] = $algo.':'.$value;
+ }
+ }
+ elseif ($hashes_iterator = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash'))
+ {
+ foreach ($hashes_iterator as $hash)
+ {
+ $value = null;
+ $algo = null;
+ if (isset($hash['data']))
+ {
+ $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($hash['attribs']['']['algo']))
+ {
+ $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $algo = 'md5';
+ }
+ $hashes_parent[] = $algo.':'.$value;
+ }
+ }
+ if (is_array($hashes_parent))
+ {
+ $hashes_parent = array_values(array_unique($hashes_parent));
+ }
+
+ // KEYWORDS
+ if ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords'))
+ {
+ if (isset($keywords[0]['data']))
+ {
+ $temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
+ foreach ($temp as $word)
+ {
+ $keywords_parent[] = trim($word);
+ }
+ }
+ unset($temp);
+ }
+ elseif ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords'))
+ {
+ if (isset($keywords[0]['data']))
+ {
+ $temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
+ foreach ($temp as $word)
+ {
+ $keywords_parent[] = trim($word);
+ }
+ }
+ unset($temp);
+ }
+ elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords'))
+ {
+ if (isset($keywords[0]['data']))
+ {
+ $temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
+ foreach ($temp as $word)
+ {
+ $keywords_parent[] = trim($word);
+ }
+ }
+ unset($temp);
+ }
+ elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords'))
+ {
+ if (isset($keywords[0]['data']))
+ {
+ $temp = explode(',', $this->sanitize($keywords[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
+ foreach ($temp as $word)
+ {
+ $keywords_parent[] = trim($word);
+ }
+ }
+ unset($temp);
+ }
+ if (is_array($keywords_parent))
+ {
+ $keywords_parent = array_values(array_unique($keywords_parent));
+ }
+
+ // PLAYER
+ if ($player_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player'))
+ {
+ if (isset($player_parent[0]['attribs']['']['url']))
+ {
+ $player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ }
+ elseif ($player_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player'))
+ {
+ if (isset($player_parent[0]['attribs']['']['url']))
+ {
+ $player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ }
+
+ // RATINGS
+ if ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating'))
+ {
+ foreach ($ratings as $rating)
+ {
+ $rating_scheme = null;
+ $rating_value = null;
+ if (isset($rating['attribs']['']['scheme']))
+ {
+ $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $rating_scheme = 'urn:simple';
+ }
+ if (isset($rating['data']))
+ {
+ $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
+ }
+ }
+ elseif ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit'))
+ {
+ foreach ($ratings as $rating)
+ {
+ $rating_scheme = 'urn:itunes';
+ $rating_value = null;
+ if (isset($rating['data']))
+ {
+ $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
+ }
+ }
+ elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating'))
+ {
+ foreach ($ratings as $rating)
+ {
+ $rating_scheme = null;
+ $rating_value = null;
+ if (isset($rating['attribs']['']['scheme']))
+ {
+ $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $rating_scheme = 'urn:simple';
+ }
+ if (isset($rating['data']))
+ {
+ $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
+ }
+ }
+ elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit'))
+ {
+ foreach ($ratings as $rating)
+ {
+ $rating_scheme = 'urn:itunes';
+ $rating_value = null;
+ if (isset($rating['data']))
+ {
+ $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
+ }
+ }
+ if (is_array($ratings_parent))
+ {
+ $ratings_parent = array_values(array_unique($ratings_parent));
+ }
+
+ // RESTRICTIONS
+ if ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction'))
+ {
+ foreach ($restrictions as $restriction)
+ {
+ $restriction_relationship = null;
+ $restriction_type = null;
+ $restriction_value = null;
+ if (isset($restriction['attribs']['']['relationship']))
+ {
+ $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['attribs']['']['type']))
+ {
+ $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['data']))
+ {
+ $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
+ }
+ }
+ elseif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))
+ {
+ foreach ($restrictions as $restriction)
+ {
+ $restriction_relationship = 'allow';
+ $restriction_type = null;
+ $restriction_value = 'itunes';
+ if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes')
+ {
+ $restriction_relationship = 'deny';
+ }
+ $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
+ }
+ }
+ elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction'))
+ {
+ foreach ($restrictions as $restriction)
+ {
+ $restriction_relationship = null;
+ $restriction_type = null;
+ $restriction_value = null;
+ if (isset($restriction['attribs']['']['relationship']))
+ {
+ $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['attribs']['']['type']))
+ {
+ $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['data']))
+ {
+ $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
+ }
+ }
+ elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))
+ {
+ foreach ($restrictions as $restriction)
+ {
+ $restriction_relationship = 'allow';
+ $restriction_type = null;
+ $restriction_value = 'itunes';
+ if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes')
+ {
+ $restriction_relationship = 'deny';
+ }
+ $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
+ }
+ }
+ if (is_array($restrictions_parent))
+ {
+ $restrictions_parent = array_values(array_unique($restrictions_parent));
+ }
+ else
+ {
+ $restrictions_parent = array(new SimplePie_Restriction('allow', null, 'default'));
+ }
+
+ // THUMBNAILS
+ if ($thumbnails = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail'))
+ {
+ foreach ($thumbnails as $thumbnail)
+ {
+ if (isset($thumbnail['attribs']['']['url']))
+ {
+ $thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ }
+ }
+ elseif ($thumbnails = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail'))
+ {
+ foreach ($thumbnails as $thumbnail)
+ {
+ if (isset($thumbnail['attribs']['']['url']))
+ {
+ $thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ }
+ }
+
+ // TITLES
+ if ($title_parent = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title'))
+ {
+ if (isset($title_parent[0]['data']))
+ {
+ $title_parent = $this->sanitize($title_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ }
+ elseif ($title_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title'))
+ {
+ if (isset($title_parent[0]['data']))
+ {
+ $title_parent = $this->sanitize($title_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ }
+
+ // Clear the memory
+ unset($parent);
+
+ // Attributes
+ $bitrate = null;
+ $channels = null;
+ $duration = null;
+ $expression = null;
+ $framerate = null;
+ $height = null;
+ $javascript = null;
+ $lang = null;
+ $length = null;
+ $medium = null;
+ $samplingrate = null;
+ $type = null;
+ $url = null;
+ $width = null;
+
+ // Elements
+ $captions = null;
+ $categories = null;
+ $copyrights = null;
+ $credits = null;
+ $description = null;
+ $hashes = null;
+ $keywords = null;
+ $player = null;
+ $ratings = null;
+ $restrictions = null;
+ $thumbnails = null;
+ $title = null;
+
+ // If we have media:group tags, loop through them.
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group') as $group)
+ {
+ if(isset($group['child']) && isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content']))
+ {
+ // If we have media:content tags, loop through them.
+ foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content)
+ {
+ if (isset($content['attribs']['']['url']))
+ {
+ // Attributes
+ $bitrate = null;
+ $channels = null;
+ $duration = null;
+ $expression = null;
+ $framerate = null;
+ $height = null;
+ $javascript = null;
+ $lang = null;
+ $length = null;
+ $medium = null;
+ $samplingrate = null;
+ $type = null;
+ $url = null;
+ $width = null;
+
+ // Elements
+ $captions = null;
+ $categories = null;
+ $copyrights = null;
+ $credits = null;
+ $description = null;
+ $hashes = null;
+ $keywords = null;
+ $player = null;
+ $ratings = null;
+ $restrictions = null;
+ $thumbnails = null;
+ $title = null;
+
+ // Start checking the attributes of media:content
+ if (isset($content['attribs']['']['bitrate']))
+ {
+ $bitrate = $this->sanitize($content['attribs']['']['bitrate'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['channels']))
+ {
+ $channels = $this->sanitize($content['attribs']['']['channels'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['duration']))
+ {
+ $duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $duration = $duration_parent;
+ }
+ if (isset($content['attribs']['']['expression']))
+ {
+ $expression = $this->sanitize($content['attribs']['']['expression'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['framerate']))
+ {
+ $framerate = $this->sanitize($content['attribs']['']['framerate'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['height']))
+ {
+ $height = $this->sanitize($content['attribs']['']['height'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['lang']))
+ {
+ $lang = $this->sanitize($content['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['fileSize']))
+ {
+ $length = intval($content['attribs']['']['fileSize']);
+ }
+ if (isset($content['attribs']['']['medium']))
+ {
+ $medium = $this->sanitize($content['attribs']['']['medium'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['samplingrate']))
+ {
+ $samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['type']))
+ {
+ $type = $this->sanitize($content['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['width']))
+ {
+ $width = $this->sanitize($content['attribs']['']['width'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $url = $this->sanitize($content['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+
+ // Checking the other optional media: elements. Priority: media:content, media:group, item, channel
+
+ // CAPTIONS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)
+ {
+ $caption_type = null;
+ $caption_lang = null;
+ $caption_startTime = null;
+ $caption_endTime = null;
+ $caption_text = null;
+ if (isset($caption['attribs']['']['type']))
+ {
+ $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['lang']))
+ {
+ $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['start']))
+ {
+ $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['end']))
+ {
+ $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['data']))
+ {
+ $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $captions[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
+ }
+ if (is_array($captions))
+ {
+ $captions = array_values(array_unique($captions));
+ }
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))
+ {
+ foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)
+ {
+ $caption_type = null;
+ $caption_lang = null;
+ $caption_startTime = null;
+ $caption_endTime = null;
+ $caption_text = null;
+ if (isset($caption['attribs']['']['type']))
+ {
+ $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['lang']))
+ {
+ $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['start']))
+ {
+ $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['end']))
+ {
+ $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['data']))
+ {
+ $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $captions[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
+ }
+ if (is_array($captions))
+ {
+ $captions = array_values(array_unique($captions));
+ }
+ }
+ else
+ {
+ $captions = $captions_parent;
+ }
+
+ // CATEGORIES
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))
+ {
+ foreach ((array) $content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)
+ {
+ $term = null;
+ $scheme = null;
+ $label = null;
+ if (isset($category['data']))
+ {
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['scheme']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = 'http://search.yahoo.com/mrss/category_schema';
+ }
+ if (isset($category['attribs']['']['label']))
+ {
+ $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories[] = $this->registry->create('Category', array($term, $scheme, $label));
+ }
+ }
+ if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))
+ {
+ foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)
+ {
+ $term = null;
+ $scheme = null;
+ $label = null;
+ if (isset($category['data']))
+ {
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['scheme']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = 'http://search.yahoo.com/mrss/category_schema';
+ }
+ if (isset($category['attribs']['']['label']))
+ {
+ $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories[] = $this->registry->create('Category', array($term, $scheme, $label));
+ }
+ }
+ if (is_array($categories) && is_array($categories_parent))
+ {
+ $categories = array_values(array_unique(array_merge($categories, $categories_parent)));
+ }
+ elseif (is_array($categories))
+ {
+ $categories = array_values(array_unique($categories));
+ }
+ elseif (is_array($categories_parent))
+ {
+ $categories = array_values(array_unique($categories_parent));
+ }
+
+ // COPYRIGHTS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))
+ {
+ $copyright_url = null;
+ $copyright_label = null;
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))
+ {
+ $copyright_url = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))
+ {
+ $copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))
+ {
+ $copyright_url = null;
+ $copyright_label = null;
+ if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))
+ {
+ $copyright_url = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))
+ {
+ $copyright_label = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
+ }
+ else
+ {
+ $copyrights = $copyrights_parent;
+ }
+
+ // CREDITS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)
+ {
+ $credit_role = null;
+ $credit_scheme = null;
+ $credit_name = null;
+ if (isset($credit['attribs']['']['role']))
+ {
+ $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($credit['attribs']['']['scheme']))
+ {
+ $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $credit_scheme = 'urn:ebu';
+ }
+ if (isset($credit['data']))
+ {
+ $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $credits[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));
+ }
+ if (is_array($credits))
+ {
+ $credits = array_values(array_unique($credits));
+ }
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))
+ {
+ foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)
+ {
+ $credit_role = null;
+ $credit_scheme = null;
+ $credit_name = null;
+ if (isset($credit['attribs']['']['role']))
+ {
+ $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($credit['attribs']['']['scheme']))
+ {
+ $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $credit_scheme = 'urn:ebu';
+ }
+ if (isset($credit['data']))
+ {
+ $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $credits[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));
+ }
+ if (is_array($credits))
+ {
+ $credits = array_values(array_unique($credits));
+ }
+ }
+ else
+ {
+ $credits = $credits_parent;
+ }
+
+ // DESCRIPTION
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))
+ {
+ $description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))
+ {
+ $description = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $description = $description_parent;
+ }
+
+ // HASHES
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)
+ {
+ $value = null;
+ $algo = null;
+ if (isset($hash['data']))
+ {
+ $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($hash['attribs']['']['algo']))
+ {
+ $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $algo = 'md5';
+ }
+ $hashes[] = $algo.':'.$value;
+ }
+ if (is_array($hashes))
+ {
+ $hashes = array_values(array_unique($hashes));
+ }
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))
+ {
+ foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)
+ {
+ $value = null;
+ $algo = null;
+ if (isset($hash['data']))
+ {
+ $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($hash['attribs']['']['algo']))
+ {
+ $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $algo = 'md5';
+ }
+ $hashes[] = $algo.':'.$value;
+ }
+ if (is_array($hashes))
+ {
+ $hashes = array_values(array_unique($hashes));
+ }
+ }
+ else
+ {
+ $hashes = $hashes_parent;
+ }
+
+ // KEYWORDS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))
+ {
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))
+ {
+ $temp = explode(',', $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
+ foreach ($temp as $word)
+ {
+ $keywords[] = trim($word);
+ }
+ unset($temp);
+ }
+ if (is_array($keywords))
+ {
+ $keywords = array_values(array_unique($keywords));
+ }
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))
+ {
+ if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))
+ {
+ $temp = explode(',', $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
+ foreach ($temp as $word)
+ {
+ $keywords[] = trim($word);
+ }
+ unset($temp);
+ }
+ if (is_array($keywords))
+ {
+ $keywords = array_values(array_unique($keywords));
+ }
+ }
+ else
+ {
+ $keywords = $keywords_parent;
+ }
+
+ // PLAYER
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))
+ {
+ $player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))
+ {
+ $player = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ else
+ {
+ $player = $player_parent;
+ }
+
+ // RATINGS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)
+ {
+ $rating_scheme = null;
+ $rating_value = null;
+ if (isset($rating['attribs']['']['scheme']))
+ {
+ $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $rating_scheme = 'urn:simple';
+ }
+ if (isset($rating['data']))
+ {
+ $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $ratings[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
+ }
+ if (is_array($ratings))
+ {
+ $ratings = array_values(array_unique($ratings));
+ }
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))
+ {
+ foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)
+ {
+ $rating_scheme = null;
+ $rating_value = null;
+ if (isset($rating['attribs']['']['scheme']))
+ {
+ $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $rating_scheme = 'urn:simple';
+ }
+ if (isset($rating['data']))
+ {
+ $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $ratings[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
+ }
+ if (is_array($ratings))
+ {
+ $ratings = array_values(array_unique($ratings));
+ }
+ }
+ else
+ {
+ $ratings = $ratings_parent;
+ }
+
+ // RESTRICTIONS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)
+ {
+ $restriction_relationship = null;
+ $restriction_type = null;
+ $restriction_value = null;
+ if (isset($restriction['attribs']['']['relationship']))
+ {
+ $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['attribs']['']['type']))
+ {
+ $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['data']))
+ {
+ $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $restrictions[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
+ }
+ if (is_array($restrictions))
+ {
+ $restrictions = array_values(array_unique($restrictions));
+ }
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))
+ {
+ foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)
+ {
+ $restriction_relationship = null;
+ $restriction_type = null;
+ $restriction_value = null;
+ if (isset($restriction['attribs']['']['relationship']))
+ {
+ $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['attribs']['']['type']))
+ {
+ $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['data']))
+ {
+ $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $restrictions[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
+ }
+ if (is_array($restrictions))
+ {
+ $restrictions = array_values(array_unique($restrictions));
+ }
+ }
+ else
+ {
+ $restrictions = $restrictions_parent;
+ }
+
+ // THUMBNAILS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)
+ {
+ $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ if (is_array($thumbnails))
+ {
+ $thumbnails = array_values(array_unique($thumbnails));
+ }
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))
+ {
+ foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)
+ {
+ $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ if (is_array($thumbnails))
+ {
+ $thumbnails = array_values(array_unique($thumbnails));
+ }
+ }
+ else
+ {
+ $thumbnails = $thumbnails_parent;
+ }
+
+ // TITLES
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))
+ {
+ $title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))
+ {
+ $title = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $title = $title_parent;
+ }
+
+ $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width));
+ }
+ }
+ }
+ }
+
+ // If we have standalone media:content tags, loop through them.
+ if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content']))
+ {
+ foreach ((array) $this->data['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content)
+ {
+ if (isset($content['attribs']['']['url']) || isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))
+ {
+ // Attributes
+ $bitrate = null;
+ $channels = null;
+ $duration = null;
+ $expression = null;
+ $framerate = null;
+ $height = null;
+ $javascript = null;
+ $lang = null;
+ $length = null;
+ $medium = null;
+ $samplingrate = null;
+ $type = null;
+ $url = null;
+ $width = null;
+
+ // Elements
+ $captions = null;
+ $categories = null;
+ $copyrights = null;
+ $credits = null;
+ $description = null;
+ $hashes = null;
+ $keywords = null;
+ $player = null;
+ $ratings = null;
+ $restrictions = null;
+ $thumbnails = null;
+ $title = null;
+
+ // Start checking the attributes of media:content
+ if (isset($content['attribs']['']['bitrate']))
+ {
+ $bitrate = $this->sanitize($content['attribs']['']['bitrate'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['channels']))
+ {
+ $channels = $this->sanitize($content['attribs']['']['channels'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['duration']))
+ {
+ $duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $duration = $duration_parent;
+ }
+ if (isset($content['attribs']['']['expression']))
+ {
+ $expression = $this->sanitize($content['attribs']['']['expression'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['framerate']))
+ {
+ $framerate = $this->sanitize($content['attribs']['']['framerate'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['height']))
+ {
+ $height = $this->sanitize($content['attribs']['']['height'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['lang']))
+ {
+ $lang = $this->sanitize($content['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['fileSize']))
+ {
+ $length = intval($content['attribs']['']['fileSize']);
+ }
+ if (isset($content['attribs']['']['medium']))
+ {
+ $medium = $this->sanitize($content['attribs']['']['medium'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['samplingrate']))
+ {
+ $samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['type']))
+ {
+ $type = $this->sanitize($content['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['width']))
+ {
+ $width = $this->sanitize($content['attribs']['']['width'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['attribs']['']['url']))
+ {
+ $url = $this->sanitize($content['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ // Checking the other optional media: elements. Priority: media:content, media:group, item, channel
+
+ // CAPTIONS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption)
+ {
+ $caption_type = null;
+ $caption_lang = null;
+ $caption_startTime = null;
+ $caption_endTime = null;
+ $caption_text = null;
+ if (isset($caption['attribs']['']['type']))
+ {
+ $caption_type = $this->sanitize($caption['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['lang']))
+ {
+ $caption_lang = $this->sanitize($caption['attribs']['']['lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['start']))
+ {
+ $caption_startTime = $this->sanitize($caption['attribs']['']['start'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['attribs']['']['end']))
+ {
+ $caption_endTime = $this->sanitize($caption['attribs']['']['end'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($caption['data']))
+ {
+ $caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $captions[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
+ }
+ if (is_array($captions))
+ {
+ $captions = array_values(array_unique($captions));
+ }
+ }
+ else
+ {
+ $captions = $captions_parent;
+ }
+
+ // CATEGORIES
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))
+ {
+ foreach ((array) $content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category'] as $category)
+ {
+ $term = null;
+ $scheme = null;
+ $label = null;
+ if (isset($category['data']))
+ {
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['scheme']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = 'http://search.yahoo.com/mrss/category_schema';
+ }
+ if (isset($category['attribs']['']['label']))
+ {
+ $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories[] = $this->registry->create('Category', array($term, $scheme, $label));
+ }
+ }
+ if (is_array($categories) && is_array($categories_parent))
+ {
+ $categories = array_values(array_unique(array_merge($categories, $categories_parent)));
+ }
+ elseif (is_array($categories))
+ {
+ $categories = array_values(array_unique($categories));
+ }
+ elseif (is_array($categories_parent))
+ {
+ $categories = array_values(array_unique($categories_parent));
+ }
+ else
+ {
+ $categories = null;
+ }
+
+ // COPYRIGHTS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))
+ {
+ $copyright_url = null;
+ $copyright_label = null;
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url']))
+ {
+ $copyright_url = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data']))
+ {
+ $copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
+ }
+ else
+ {
+ $copyrights = $copyrights_parent;
+ }
+
+ // CREDITS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit)
+ {
+ $credit_role = null;
+ $credit_scheme = null;
+ $credit_name = null;
+ if (isset($credit['attribs']['']['role']))
+ {
+ $credit_role = $this->sanitize($credit['attribs']['']['role'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($credit['attribs']['']['scheme']))
+ {
+ $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $credit_scheme = 'urn:ebu';
+ }
+ if (isset($credit['data']))
+ {
+ $credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $credits[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));
+ }
+ if (is_array($credits))
+ {
+ $credits = array_values(array_unique($credits));
+ }
+ }
+ else
+ {
+ $credits = $credits_parent;
+ }
+
+ // DESCRIPTION
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description']))
+ {
+ $description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $description = $description_parent;
+ }
+
+ // HASHES
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash)
+ {
+ $value = null;
+ $algo = null;
+ if (isset($hash['data']))
+ {
+ $value = $this->sanitize($hash['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($hash['attribs']['']['algo']))
+ {
+ $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $algo = 'md5';
+ }
+ $hashes[] = $algo.':'.$value;
+ }
+ if (is_array($hashes))
+ {
+ $hashes = array_values(array_unique($hashes));
+ }
+ }
+ else
+ {
+ $hashes = $hashes_parent;
+ }
+
+ // KEYWORDS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))
+ {
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data']))
+ {
+ $temp = explode(',', $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
+ foreach ($temp as $word)
+ {
+ $keywords[] = trim($word);
+ }
+ unset($temp);
+ }
+ if (is_array($keywords))
+ {
+ $keywords = array_values(array_unique($keywords));
+ }
+ }
+ else
+ {
+ $keywords = $keywords_parent;
+ }
+
+ // PLAYER
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player']))
+ {
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'])) {
+ $player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ }
+ else
+ {
+ $player = $player_parent;
+ }
+
+ // RATINGS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating)
+ {
+ $rating_scheme = null;
+ $rating_value = null;
+ if (isset($rating['attribs']['']['scheme']))
+ {
+ $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $rating_scheme = 'urn:simple';
+ }
+ if (isset($rating['data']))
+ {
+ $rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $ratings[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
+ }
+ if (is_array($ratings))
+ {
+ $ratings = array_values(array_unique($ratings));
+ }
+ }
+ else
+ {
+ $ratings = $ratings_parent;
+ }
+
+ // RESTRICTIONS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction)
+ {
+ $restriction_relationship = null;
+ $restriction_type = null;
+ $restriction_value = null;
+ if (isset($restriction['attribs']['']['relationship']))
+ {
+ $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['attribs']['']['type']))
+ {
+ $restriction_type = $this->sanitize($restriction['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($restriction['data']))
+ {
+ $restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $restrictions[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
+ }
+ if (is_array($restrictions))
+ {
+ $restrictions = array_values(array_unique($restrictions));
+ }
+ }
+ else
+ {
+ $restrictions = $restrictions_parent;
+ }
+
+ // THUMBNAILS
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))
+ {
+ foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail)
+ {
+ if (isset($thumbnail['attribs']['']['url'])) {
+ $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ }
+ if (is_array($thumbnails))
+ {
+ $thumbnails = array_values(array_unique($thumbnails));
+ }
+ }
+ else
+ {
+ $thumbnails = $thumbnails_parent;
+ }
+
+ // TITLES
+ if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title']))
+ {
+ $title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $title = $title_parent;
+ }
+
+ $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width));
+ }
+ }
+ }
+
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link)
+ {
+ if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')
+ {
+ // Attributes
+ $bitrate = null;
+ $channels = null;
+ $duration = null;
+ $expression = null;
+ $framerate = null;
+ $height = null;
+ $javascript = null;
+ $lang = null;
+ $length = null;
+ $medium = null;
+ $samplingrate = null;
+ $type = null;
+ $url = null;
+ $width = null;
+
+ $url = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
+ if (isset($link['attribs']['']['type']))
+ {
+ $type = $this->sanitize($link['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($link['attribs']['']['length']))
+ {
+ $length = intval($link['attribs']['']['length']);
+ }
+ if (isset($link['attribs']['']['title']))
+ {
+ $title = $this->sanitize($link['attribs']['']['title'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $title = $title_parent;
+ }
+
+ // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
+ $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title, $width));
+ }
+ }
+
+ foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link)
+ {
+ if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure')
+ {
+ // Attributes
+ $bitrate = null;
+ $channels = null;
+ $duration = null;
+ $expression = null;
+ $framerate = null;
+ $height = null;
+ $javascript = null;
+ $lang = null;
+ $length = null;
+ $medium = null;
+ $samplingrate = null;
+ $type = null;
+ $url = null;
+ $width = null;
+
+ $url = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
+ if (isset($link['attribs']['']['type']))
+ {
+ $type = $this->sanitize($link['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($link['attribs']['']['length']))
+ {
+ $length = intval($link['attribs']['']['length']);
+ }
+
+ // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
+ $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));
+ }
+ }
+
+ if ($enclosure = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'enclosure'))
+ {
+ if (isset($enclosure[0]['attribs']['']['url']))
+ {
+ // Attributes
+ $bitrate = null;
+ $channels = null;
+ $duration = null;
+ $expression = null;
+ $framerate = null;
+ $height = null;
+ $javascript = null;
+ $lang = null;
+ $length = null;
+ $medium = null;
+ $samplingrate = null;
+ $type = null;
+ $url = null;
+ $width = null;
+
+ $url = $this->sanitize($enclosure[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($enclosure[0]));
+ $url = $this->feed->sanitize->https_url($url);
+ if (isset($enclosure[0]['attribs']['']['type']))
+ {
+ $type = $this->sanitize($enclosure[0]['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($enclosure[0]['attribs']['']['length']))
+ {
+ $length = intval($enclosure[0]['attribs']['']['length']);
+ }
+
+ // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
+ $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));
+ }
+ }
+
+ if (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width))
+ {
+ // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
+ $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));
+ }
+
+ $this->data['enclosures'] = array_values(array_unique($this->data['enclosures']));
+ }
+ if (!empty($this->data['enclosures']))
+ {
+ return $this->data['enclosures'];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the latitude coordinates for the item
+ *
+ * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications
+ *
+ * Uses `` or ``
+ *
+ * @since 1.0
+ * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
+ * @link http://www.georss.org/ GeoRSS
+ * @return string|null
+ */
+ public function get_latitude()
+ {
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat'))
+ {
+ return (float) $return[0]['data'];
+ }
+ elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
+ {
+ return (float) $match[1];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the longitude coordinates for the item
+ *
+ * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications
+ *
+ * Uses ``, `` or ``
+ *
+ * @since 1.0
+ * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
+ * @link http://www.georss.org/ GeoRSS
+ * @return string|null
+ */
+ public function get_longitude()
+ {
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long'))
+ {
+ return (float) $return[0]['data'];
+ }
+ elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon'))
+ {
+ return (float) $return[0]['data'];
+ }
+ elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
+ {
+ return (float) $match[2];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the `` for the item
+ *
+ * @since 1.1
+ * @return SimplePie_Source|null
+ */
+ public function get_source()
+ {
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'source'))
+ {
+ return $this->registry->create('Source', array($this, $return[0]));
+ }
+
+ return null;
+ }
+}
+
+class_alias('SimplePie_Item', 'SimplePie\Item', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Locator.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Locator.php
new file mode 100644
index 0000000000..12961dd3dc
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Locator.php
@@ -0,0 +1,434 @@
+file = $file;
+ $this->useragent = $useragent;
+ $this->timeout = $timeout;
+ $this->max_checked_feeds = $max_checked_feeds;
+ $this->force_fsockopen = $force_fsockopen;
+ $this->curl_options = $curl_options;
+
+ if (class_exists('DOMDocument') && $this->file->body != '')
+ {
+ $this->dom = new DOMDocument();
+
+ set_error_handler(array('SimplePie_Misc', 'silence_errors'));
+ try
+ {
+ $this->dom->loadHTML($this->file->body);
+ }
+ catch (Throwable $ex)
+ {
+ $this->dom = null;
+ }
+ restore_error_handler();
+ }
+ else
+ {
+ $this->dom = null;
+ }
+ }
+
+ public function set_registry(SimplePie_Registry $registry)
+ {
+ $this->registry = $registry;
+ }
+
+ public function find($type = SIMPLEPIE_LOCATOR_ALL, &$working = null)
+ {
+ if ($this->is_feed($this->file))
+ {
+ return $this->file;
+ }
+
+ if ($this->file->method & SIMPLEPIE_FILE_SOURCE_REMOTE)
+ {
+ $sniffer = $this->registry->create('Content_Type_Sniffer', array($this->file));
+ if ($sniffer->get_type() !== 'text/html')
+ {
+ return null;
+ }
+ }
+
+ if ($type & ~SIMPLEPIE_LOCATOR_NONE)
+ {
+ $this->get_base();
+ }
+
+ if ($type & SIMPLEPIE_LOCATOR_AUTODISCOVERY && $working = $this->autodiscovery())
+ {
+ return $working[0];
+ }
+
+ if ($type & (SIMPLEPIE_LOCATOR_LOCAL_EXTENSION | SIMPLEPIE_LOCATOR_LOCAL_BODY | SIMPLEPIE_LOCATOR_REMOTE_EXTENSION | SIMPLEPIE_LOCATOR_REMOTE_BODY) && $this->get_links())
+ {
+ if ($type & SIMPLEPIE_LOCATOR_LOCAL_EXTENSION && $working = $this->extension($this->local))
+ {
+ return $working[0];
+ }
+
+ if ($type & SIMPLEPIE_LOCATOR_LOCAL_BODY && $working = $this->body($this->local))
+ {
+ return $working[0];
+ }
+
+ if ($type & SIMPLEPIE_LOCATOR_REMOTE_EXTENSION && $working = $this->extension($this->elsewhere))
+ {
+ return $working[0];
+ }
+
+ if ($type & SIMPLEPIE_LOCATOR_REMOTE_BODY && $working = $this->body($this->elsewhere))
+ {
+ return $working[0];
+ }
+ }
+ return null;
+ }
+
+ public function is_feed($file, $check_html = false)
+ {
+ if ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE)
+ {
+ $sniffer = $this->registry->create('Content_Type_Sniffer', array($file));
+ $sniffed = $sniffer->get_type();
+ $mime_types = array('application/rss+xml', 'application/rdf+xml',
+ 'text/rdf', 'application/atom+xml', 'text/xml',
+ 'application/xml', 'application/x-rss+xml');
+ if ($check_html)
+ {
+ $mime_types[] = 'text/html';
+ }
+
+ return in_array($sniffed, $mime_types);
+ }
+ elseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public function get_base()
+ {
+ if ($this->dom === null)
+ {
+ throw new SimplePie_Exception('DOMDocument not found, unable to use locator');
+ }
+ $this->http_base = $this->file->url;
+ $this->base = $this->http_base;
+ $elements = $this->dom->getElementsByTagName('base');
+ foreach ($elements as $element)
+ {
+ if ($element->hasAttribute('href'))
+ {
+ $base = $this->registry->call('Misc', 'absolutize_url', array(trim($element->getAttribute('href')), $this->http_base));
+ if ($base === false)
+ {
+ continue;
+ }
+ $this->base = $base;
+ $this->base_location = method_exists($element, 'getLineNo') ? $element->getLineNo() : 0;
+ break;
+ }
+ }
+ }
+
+ public function autodiscovery()
+ {
+ $done = array();
+ $feeds = array();
+ $feeds = array_merge($feeds, $this->search_elements_by_tag('link', $done, $feeds));
+ $feeds = array_merge($feeds, $this->search_elements_by_tag('a', $done, $feeds));
+ $feeds = array_merge($feeds, $this->search_elements_by_tag('area', $done, $feeds));
+
+ if (!empty($feeds))
+ {
+ return array_values($feeds);
+ }
+
+ return null;
+ }
+
+ protected function search_elements_by_tag($name, &$done, $feeds)
+ {
+ if ($this->dom === null)
+ {
+ throw new SimplePie_Exception('DOMDocument not found, unable to use locator');
+ }
+
+ $links = $this->dom->getElementsByTagName($name);
+ foreach ($links as $link)
+ {
+ if ($this->checked_feeds === $this->max_checked_feeds)
+ {
+ break;
+ }
+ if ($link->hasAttribute('href') && $link->hasAttribute('rel'))
+ {
+ $rel = array_unique($this->registry->call('Misc', 'space_separated_tokens', array(strtolower($link->getAttribute('rel')))));
+ $line = method_exists($link, 'getLineNo') ? $link->getLineNo() : 1;
+
+ if ($this->base_location < $line)
+ {
+ $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base));
+ }
+ else
+ {
+ $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base));
+ }
+ if ($href === false)
+ {
+ continue;
+ }
+
+ if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !in_array('stylesheet', $rel) && $link->hasAttribute('type') && in_array(strtolower($this->registry->call('Misc', 'parse_mime', array($link->getAttribute('type')))), array('text/html', 'application/rss+xml', 'application/atom+xml'))) && !isset($feeds[$href]))
+ {
+ $this->checked_feeds++;
+ $headers = array(
+ 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',
+ );
+ $feed = $this->registry->create('File', array($href, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options));
+ if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed, true))
+ {
+ $feeds[$href] = $feed;
+ }
+ }
+ $done[] = $href;
+ }
+ }
+
+ return $feeds;
+ }
+
+ public function get_links()
+ {
+ if ($this->dom === null)
+ {
+ throw new SimplePie_Exception('DOMDocument not found, unable to use locator');
+ }
+
+ $links = $this->dom->getElementsByTagName('a');
+ foreach ($links as $link)
+ {
+ if ($link->hasAttribute('href'))
+ {
+ $href = trim($link->getAttribute('href'));
+ $parsed = $this->registry->call('Misc', 'parse_url', array($href));
+ if ($parsed['scheme'] === '' || preg_match('/^(https?|feed)?$/i', $parsed['scheme']))
+ {
+ if (method_exists($link, 'getLineNo') && $this->base_location < $link->getLineNo())
+ {
+ $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base));
+ }
+ else
+ {
+ $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base));
+ }
+ if ($href === false)
+ {
+ continue;
+ }
+
+ $current = $this->registry->call('Misc', 'parse_url', array($this->file->url));
+
+ if ($parsed['authority'] === '' || $parsed['authority'] === $current['authority'])
+ {
+ $this->local[] = $href;
+ }
+ else
+ {
+ $this->elsewhere[] = $href;
+ }
+ }
+ }
+ }
+ $this->local = array_unique($this->local);
+ $this->elsewhere = array_unique($this->elsewhere);
+ if (!empty($this->local) || !empty($this->elsewhere))
+ {
+ return true;
+ }
+ return null;
+ }
+
+ public function get_rel_link($rel)
+ {
+ if ($this->dom === null)
+ {
+ throw new SimplePie_Exception('DOMDocument not found, unable to use '.
+ 'locator');
+ }
+ if (!class_exists('DOMXpath'))
+ {
+ throw new SimplePie_Exception('DOMXpath not found, unable to use '.
+ 'get_rel_link');
+ }
+
+ $xpath = new DOMXpath($this->dom);
+ $query = '//a[@rel and @href] | //link[@rel and @href]';
+ foreach ($xpath->query($query) as $link)
+ {
+ $href = trim($link->getAttribute('href'));
+ $parsed = $this->registry->call('Misc', 'parse_url', array($href));
+ if ($parsed['scheme'] === '' ||
+ preg_match('/^https?$/i', $parsed['scheme']))
+ {
+ if (method_exists($link, 'getLineNo') &&
+ $this->base_location < $link->getLineNo())
+ {
+ $href =
+ $this->registry->call('Misc', 'absolutize_url',
+ array(trim($link->getAttribute('href')),
+ $this->base));
+ }
+ else
+ {
+ $href =
+ $this->registry->call('Misc', 'absolutize_url',
+ array(trim($link->getAttribute('href')),
+ $this->http_base));
+ }
+ if ($href === false)
+ {
+ return null;
+ }
+ $rel_values = explode(' ', strtolower($link->getAttribute('rel')));
+ if (in_array($rel, $rel_values))
+ {
+ return $href;
+ }
+ }
+ }
+ return null;
+ }
+
+ public function extension(&$array)
+ {
+ foreach ($array as $key => $value)
+ {
+ if ($this->checked_feeds === $this->max_checked_feeds)
+ {
+ break;
+ }
+ if (in_array(strtolower(strrchr($value, '.')), array('.rss', '.rdf', '.atom', '.xml')))
+ {
+ $this->checked_feeds++;
+
+ $headers = array(
+ 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',
+ );
+ $feed = $this->registry->create('File', array($value, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options));
+ if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed))
+ {
+ return array($feed);
+ }
+ else
+ {
+ unset($array[$key]);
+ }
+ }
+ }
+ return null;
+ }
+
+ public function body(&$array)
+ {
+ foreach ($array as $key => $value)
+ {
+ if ($this->checked_feeds === $this->max_checked_feeds)
+ {
+ break;
+ }
+ if (preg_match('/(feed|rss|rdf|atom|xml)/i', $value))
+ {
+ $this->checked_feeds++;
+ $headers = array(
+ 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1',
+ );
+ $feed = $this->registry->create('File', array($value, $this->timeout, 5, null, $this->useragent, $this->force_fsockopen, $this->curl_options));
+ if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed))
+ {
+ return array($feed);
+ }
+ else
+ {
+ unset($array[$key]);
+ }
+ }
+ }
+ return null;
+ }
+}
+
+class_alias('SimplePie_Locator', 'SimplePie\Locator', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Misc.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Misc.php
new file mode 100644
index 0000000000..4318573bae
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Misc.php
@@ -0,0 +1,2275 @@
+ 0)
+ {
+ $time .= $hours.':';
+ }
+
+ $minutes = floor($remainder / 60);
+ $seconds = $remainder % 60;
+ if ($minutes < 10 && $hours > 0)
+ {
+ $minutes = '0' . $minutes;
+ }
+ if ($seconds < 10)
+ {
+ $seconds = '0' . $seconds;
+ }
+
+ $time .= $minutes.':';
+ $time .= $seconds;
+
+ return $time;
+ }
+
+ public static function absolutize_url($relative, $base)
+ {
+ $iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative);
+ if ($iri === false)
+ {
+ return false;
+ }
+ return $iri->get_uri();
+ }
+
+ /**
+ * Get a HTML/XML element from a HTML string
+ *
+ * @deprecated Use DOMDocument instead (parsing HTML with regex is bad!)
+ * @param string $realname Element name (including namespace prefix if applicable)
+ * @param string $string HTML document
+ * @return array
+ */
+ public static function get_element($realname, $string)
+ {
+ $return = array();
+ $name = preg_quote($realname, '/');
+ if (preg_match_all("/<($name)" . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . "(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE))
+ {
+ for ($i = 0, $total_matches = count($matches); $i < $total_matches; $i++)
+ {
+ $return[$i]['tag'] = $realname;
+ $return[$i]['full'] = $matches[$i][0][0];
+ $return[$i]['offset'] = $matches[$i][0][1];
+ if (strlen($matches[$i][3][0]) <= 2)
+ {
+ $return[$i]['self_closing'] = true;
+ }
+ else
+ {
+ $return[$i]['self_closing'] = false;
+ $return[$i]['content'] = $matches[$i][4][0];
+ }
+ $return[$i]['attribs'] = array();
+ if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' ' . $matches[$i][2][0] . ' ', $attribs, PREG_SET_ORDER))
+ {
+ for ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++)
+ {
+ if (count($attribs[$j]) === 2)
+ {
+ $attribs[$j][2] = $attribs[$j][1];
+ }
+ $return[$i]['attribs'][strtolower($attribs[$j][1])]['data'] = SimplePie_Misc::entities_decode(end($attribs[$j]));
+ }
+ }
+ }
+ }
+ return $return;
+ }
+
+ public static function element_implode($element)
+ {
+ $full = "<$element[tag]";
+ foreach ($element['attribs'] as $key => $value)
+ {
+ $key = strtolower($key);
+ $full .= " $key=\"" . htmlspecialchars($value['data'], ENT_COMPAT, 'UTF-8') . '"';
+ }
+ if ($element['self_closing'])
+ {
+ $full .= ' />';
+ }
+ else
+ {
+ $full .= ">$element[content]$element[tag]>";
+ }
+ return $full;
+ }
+
+ public static function error($message, $level, $file, $line)
+ {
+ if ((ini_get('error_reporting') & $level) > 0)
+ {
+ switch ($level)
+ {
+ case E_USER_ERROR:
+ $note = 'PHP Error';
+ break;
+ case E_USER_WARNING:
+ $note = 'PHP Warning';
+ break;
+ case E_USER_NOTICE:
+ $note = 'PHP Notice';
+ break;
+ default:
+ $note = 'Unknown Error';
+ break;
+ }
+
+ $log_error = true;
+ if (!function_exists('error_log'))
+ {
+ $log_error = false;
+ }
+
+ $log_file = @ini_get('error_log');
+ if (!empty($log_file) && ('syslog' !== $log_file) && !@is_writable($log_file))
+ {
+ $log_error = false;
+ }
+
+ if ($log_error)
+ {
+ @error_log("$note: $message in $file on line $line", 0);
+ }
+ }
+
+ return $message;
+ }
+
+ public static function fix_protocol($url, $http = 1)
+ {
+ $url = SimplePie_Misc::normalize_url($url);
+ $parsed = SimplePie_Misc::parse_url($url);
+ if ($parsed['scheme'] !== '' && $parsed['scheme'] !== 'http' && $parsed['scheme'] !== 'https')
+ {
+ return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['authority'], $parsed['path'], $parsed['query'], $parsed['fragment']), $http);
+ }
+
+ if ($parsed['scheme'] === '' && $parsed['authority'] === '' && !file_exists($url))
+ {
+ return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['path'], '', $parsed['query'], $parsed['fragment']), $http);
+ }
+
+ if ($http === 2 && $parsed['scheme'] !== '')
+ {
+ return "feed:$url";
+ }
+ elseif ($http === 3 && strtolower($parsed['scheme']) === 'http')
+ {
+ return substr_replace($url, 'podcast', 0, 4);
+ }
+ elseif ($http === 4 && strtolower($parsed['scheme']) === 'http')
+ {
+ return substr_replace($url, 'itpc', 0, 4);
+ }
+
+ return $url;
+ }
+
+ public static function array_merge_recursive($array1, $array2)
+ {
+ foreach ($array2 as $key => $value)
+ {
+ if (is_array($value))
+ {
+ $array1[$key] = SimplePie_Misc::array_merge_recursive($array1[$key], $value);
+ }
+ else
+ {
+ $array1[$key] = $value;
+ }
+ }
+
+ return $array1;
+ }
+
+ public static function parse_url($url)
+ {
+ $iri = new SimplePie_IRI($url);
+ return array(
+ 'scheme' => (string) $iri->scheme,
+ 'authority' => (string) $iri->authority,
+ 'path' => (string) $iri->path,
+ 'query' => (string) $iri->query,
+ 'fragment' => (string) $iri->fragment
+ );
+ }
+
+ public static function compress_parse_url($scheme = '', $authority = '', $path = '', $query = '', $fragment = '')
+ {
+ $iri = new SimplePie_IRI('');
+ $iri->scheme = $scheme;
+ $iri->authority = $authority;
+ $iri->path = $path;
+ $iri->query = $query;
+ $iri->fragment = $fragment;
+ return $iri->get_uri();
+ }
+
+ public static function normalize_url($url)
+ {
+ $iri = new SimplePie_IRI($url);
+ return $iri->get_uri();
+ }
+
+ public static function percent_encoding_normalization($match)
+ {
+ $integer = hexdec($match[1]);
+ if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E)
+ {
+ return chr($integer);
+ }
+
+ return strtoupper($match[0]);
+ }
+
+ /**
+ * Converts a Windows-1252 encoded string to a UTF-8 encoded string
+ *
+ * @static
+ * @param string $string Windows-1252 encoded string
+ * @return string UTF-8 encoded string
+ */
+ public static function windows_1252_to_utf8($string)
+ {
+ static $convert_table = array("\x80" => "\xE2\x82\xAC", "\x81" => "\xEF\xBF\xBD", "\x82" => "\xE2\x80\x9A", "\x83" => "\xC6\x92", "\x84" => "\xE2\x80\x9E", "\x85" => "\xE2\x80\xA6", "\x86" => "\xE2\x80\xA0", "\x87" => "\xE2\x80\xA1", "\x88" => "\xCB\x86", "\x89" => "\xE2\x80\xB0", "\x8A" => "\xC5\xA0", "\x8B" => "\xE2\x80\xB9", "\x8C" => "\xC5\x92", "\x8D" => "\xEF\xBF\xBD", "\x8E" => "\xC5\xBD", "\x8F" => "\xEF\xBF\xBD", "\x90" => "\xEF\xBF\xBD", "\x91" => "\xE2\x80\x98", "\x92" => "\xE2\x80\x99", "\x93" => "\xE2\x80\x9C", "\x94" => "\xE2\x80\x9D", "\x95" => "\xE2\x80\xA2", "\x96" => "\xE2\x80\x93", "\x97" => "\xE2\x80\x94", "\x98" => "\xCB\x9C", "\x99" => "\xE2\x84\xA2", "\x9A" => "\xC5\xA1", "\x9B" => "\xE2\x80\xBA", "\x9C" => "\xC5\x93", "\x9D" => "\xEF\xBF\xBD", "\x9E" => "\xC5\xBE", "\x9F" => "\xC5\xB8", "\xA0" => "\xC2\xA0", "\xA1" => "\xC2\xA1", "\xA2" => "\xC2\xA2", "\xA3" => "\xC2\xA3", "\xA4" => "\xC2\xA4", "\xA5" => "\xC2\xA5", "\xA6" => "\xC2\xA6", "\xA7" => "\xC2\xA7", "\xA8" => "\xC2\xA8", "\xA9" => "\xC2\xA9", "\xAA" => "\xC2\xAA", "\xAB" => "\xC2\xAB", "\xAC" => "\xC2\xAC", "\xAD" => "\xC2\xAD", "\xAE" => "\xC2\xAE", "\xAF" => "\xC2\xAF", "\xB0" => "\xC2\xB0", "\xB1" => "\xC2\xB1", "\xB2" => "\xC2\xB2", "\xB3" => "\xC2\xB3", "\xB4" => "\xC2\xB4", "\xB5" => "\xC2\xB5", "\xB6" => "\xC2\xB6", "\xB7" => "\xC2\xB7", "\xB8" => "\xC2\xB8", "\xB9" => "\xC2\xB9", "\xBA" => "\xC2\xBA", "\xBB" => "\xC2\xBB", "\xBC" => "\xC2\xBC", "\xBD" => "\xC2\xBD", "\xBE" => "\xC2\xBE", "\xBF" => "\xC2\xBF", "\xC0" => "\xC3\x80", "\xC1" => "\xC3\x81", "\xC2" => "\xC3\x82", "\xC3" => "\xC3\x83", "\xC4" => "\xC3\x84", "\xC5" => "\xC3\x85", "\xC6" => "\xC3\x86", "\xC7" => "\xC3\x87", "\xC8" => "\xC3\x88", "\xC9" => "\xC3\x89", "\xCA" => "\xC3\x8A", "\xCB" => "\xC3\x8B", "\xCC" => "\xC3\x8C", "\xCD" => "\xC3\x8D", "\xCE" => "\xC3\x8E", "\xCF" => "\xC3\x8F", "\xD0" => "\xC3\x90", "\xD1" => "\xC3\x91", "\xD2" => "\xC3\x92", "\xD3" => "\xC3\x93", "\xD4" => "\xC3\x94", "\xD5" => "\xC3\x95", "\xD6" => "\xC3\x96", "\xD7" => "\xC3\x97", "\xD8" => "\xC3\x98", "\xD9" => "\xC3\x99", "\xDA" => "\xC3\x9A", "\xDB" => "\xC3\x9B", "\xDC" => "\xC3\x9C", "\xDD" => "\xC3\x9D", "\xDE" => "\xC3\x9E", "\xDF" => "\xC3\x9F", "\xE0" => "\xC3\xA0", "\xE1" => "\xC3\xA1", "\xE2" => "\xC3\xA2", "\xE3" => "\xC3\xA3", "\xE4" => "\xC3\xA4", "\xE5" => "\xC3\xA5", "\xE6" => "\xC3\xA6", "\xE7" => "\xC3\xA7", "\xE8" => "\xC3\xA8", "\xE9" => "\xC3\xA9", "\xEA" => "\xC3\xAA", "\xEB" => "\xC3\xAB", "\xEC" => "\xC3\xAC", "\xED" => "\xC3\xAD", "\xEE" => "\xC3\xAE", "\xEF" => "\xC3\xAF", "\xF0" => "\xC3\xB0", "\xF1" => "\xC3\xB1", "\xF2" => "\xC3\xB2", "\xF3" => "\xC3\xB3", "\xF4" => "\xC3\xB4", "\xF5" => "\xC3\xB5", "\xF6" => "\xC3\xB6", "\xF7" => "\xC3\xB7", "\xF8" => "\xC3\xB8", "\xF9" => "\xC3\xB9", "\xFA" => "\xC3\xBA", "\xFB" => "\xC3\xBB", "\xFC" => "\xC3\xBC", "\xFD" => "\xC3\xBD", "\xFE" => "\xC3\xBE", "\xFF" => "\xC3\xBF");
+
+ return strtr($string, $convert_table);
+ }
+
+ /**
+ * Change a string from one encoding to another
+ *
+ * @param string $data Raw data in $input encoding
+ * @param string $input Encoding of $data
+ * @param string $output Encoding you want
+ * @return string|boolean False if we can't convert it
+ */
+ public static function change_encoding($data, $input, $output)
+ {
+ $input = SimplePie_Misc::encoding($input);
+ $output = SimplePie_Misc::encoding($output);
+
+ // We fail to fail on non US-ASCII bytes
+ if ($input === 'US-ASCII')
+ {
+ static $non_ascii_octects = '';
+ if (!$non_ascii_octects)
+ {
+ for ($i = 0x80; $i <= 0xFF; $i++)
+ {
+ $non_ascii_octects .= chr($i);
+ }
+ }
+ $data = substr($data, 0, strcspn($data, $non_ascii_octects));
+ }
+
+ // This is first, as behaviour of this is completely predictable
+ if ($input === 'windows-1252' && $output === 'UTF-8')
+ {
+ return SimplePie_Misc::windows_1252_to_utf8($data);
+ }
+ // This is second, as behaviour of this varies only with PHP version (the middle part of this expression checks the encoding is supported).
+ elseif (function_exists('mb_convert_encoding') && ($return = SimplePie_Misc::change_encoding_mbstring($data, $input, $output)))
+ {
+ return $return;
+ }
+ // This is third, as behaviour of this varies with OS userland and PHP version
+ elseif (function_exists('iconv') && ($return = SimplePie_Misc::change_encoding_iconv($data, $input, $output)))
+ {
+ return $return;
+ }
+ // This is last, as behaviour of this varies with OS userland and PHP version
+ elseif (class_exists('\UConverter') && ($return = SimplePie_Misc::change_encoding_uconverter($data, $input, $output)))
+ {
+ return $return;
+ }
+
+ // If we can't do anything, just fail
+ return false;
+ }
+
+ protected static function change_encoding_mbstring($data, $input, $output)
+ {
+ if ($input === 'windows-949')
+ {
+ $input = 'EUC-KR';
+ }
+ if ($output === 'windows-949')
+ {
+ $output = 'EUC-KR';
+ }
+ if ($input === 'Windows-31J')
+ {
+ $input = 'SJIS';
+ }
+ if ($output === 'Windows-31J')
+ {
+ $output = 'SJIS';
+ }
+
+ // Check that the encoding is supported
+ if (!in_array($input, mb_list_encodings()))
+ {
+ return false;
+ }
+
+ if (@mb_convert_encoding("\x80", 'UTF-16BE', $input) === "\x00\x80")
+ {
+ return false;
+ }
+
+ // Let's do some conversion
+ if ($return = @mb_convert_encoding($data, $output, $input))
+ {
+ return $return;
+ }
+
+ return false;
+ }
+
+ protected static function change_encoding_iconv($data, $input, $output)
+ {
+ return @iconv($input, $output, $data);
+ }
+
+ /**
+ * @param string $data
+ * @param string $input
+ * @param string $output
+ * @return string|false
+ */
+ protected static function change_encoding_uconverter($data, $input, $output)
+ {
+ return @\UConverter::transcode($data, $output, $input);
+ }
+
+ /**
+ * Normalize an encoding name
+ *
+ * This is automatically generated by create.php
+ *
+ * To generate it, run `php create.php` on the command line, and copy the
+ * output to replace this function.
+ *
+ * @param string $charset Character set to standardise
+ * @return string Standardised name
+ */
+ public static function encoding($charset)
+ {
+ // Normalization from UTS #22
+ switch (strtolower(preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset)))
+ {
+ case 'adobestandardencoding':
+ case 'csadobestandardencoding':
+ return 'Adobe-Standard-Encoding';
+
+ case 'adobesymbolencoding':
+ case 'cshppsmath':
+ return 'Adobe-Symbol-Encoding';
+
+ case 'ami1251':
+ case 'amiga1251':
+ return 'Amiga-1251';
+
+ case 'ansix31101983':
+ case 'csat5001983':
+ case 'csiso99naplps':
+ case 'isoir99':
+ case 'naplps':
+ return 'ANSI_X3.110-1983';
+
+ case 'arabic7':
+ case 'asmo449':
+ case 'csiso89asmo449':
+ case 'iso9036':
+ case 'isoir89':
+ return 'ASMO_449';
+
+ case 'big5':
+ case 'csbig5':
+ return 'Big5';
+
+ case 'big5hkscs':
+ return 'Big5-HKSCS';
+
+ case 'bocu1':
+ case 'csbocu1':
+ return 'BOCU-1';
+
+ case 'brf':
+ case 'csbrf':
+ return 'BRF';
+
+ case 'bs4730':
+ case 'csiso4unitedkingdom':
+ case 'gb':
+ case 'iso646gb':
+ case 'isoir4':
+ case 'uk':
+ return 'BS_4730';
+
+ case 'bsviewdata':
+ case 'csiso47bsviewdata':
+ case 'isoir47':
+ return 'BS_viewdata';
+
+ case 'cesu8':
+ case 'cscesu8':
+ return 'CESU-8';
+
+ case 'ca':
+ case 'csa71':
+ case 'csaz243419851':
+ case 'csiso121canadian1':
+ case 'iso646ca':
+ case 'isoir121':
+ return 'CSA_Z243.4-1985-1';
+
+ case 'csa72':
+ case 'csaz243419852':
+ case 'csiso122canadian2':
+ case 'iso646ca2':
+ case 'isoir122':
+ return 'CSA_Z243.4-1985-2';
+
+ case 'csaz24341985gr':
+ case 'csiso123csaz24341985gr':
+ case 'isoir123':
+ return 'CSA_Z243.4-1985-gr';
+
+ case 'csiso139csn369103':
+ case 'csn369103':
+ case 'isoir139':
+ return 'CSN_369103';
+
+ case 'csdecmcs':
+ case 'dec':
+ case 'decmcs':
+ return 'DEC-MCS';
+
+ case 'csiso21german':
+ case 'de':
+ case 'din66003':
+ case 'iso646de':
+ case 'isoir21':
+ return 'DIN_66003';
+
+ case 'csdkus':
+ case 'dkus':
+ return 'dk-us';
+
+ case 'csiso646danish':
+ case 'dk':
+ case 'ds2089':
+ case 'iso646dk':
+ return 'DS_2089';
+
+ case 'csibmebcdicatde':
+ case 'ebcdicatde':
+ return 'EBCDIC-AT-DE';
+
+ case 'csebcdicatdea':
+ case 'ebcdicatdea':
+ return 'EBCDIC-AT-DE-A';
+
+ case 'csebcdiccafr':
+ case 'ebcdiccafr':
+ return 'EBCDIC-CA-FR';
+
+ case 'csebcdicdkno':
+ case 'ebcdicdkno':
+ return 'EBCDIC-DK-NO';
+
+ case 'csebcdicdknoa':
+ case 'ebcdicdknoa':
+ return 'EBCDIC-DK-NO-A';
+
+ case 'csebcdices':
+ case 'ebcdices':
+ return 'EBCDIC-ES';
+
+ case 'csebcdicesa':
+ case 'ebcdicesa':
+ return 'EBCDIC-ES-A';
+
+ case 'csebcdicess':
+ case 'ebcdicess':
+ return 'EBCDIC-ES-S';
+
+ case 'csebcdicfise':
+ case 'ebcdicfise':
+ return 'EBCDIC-FI-SE';
+
+ case 'csebcdicfisea':
+ case 'ebcdicfisea':
+ return 'EBCDIC-FI-SE-A';
+
+ case 'csebcdicfr':
+ case 'ebcdicfr':
+ return 'EBCDIC-FR';
+
+ case 'csebcdicit':
+ case 'ebcdicit':
+ return 'EBCDIC-IT';
+
+ case 'csebcdicpt':
+ case 'ebcdicpt':
+ return 'EBCDIC-PT';
+
+ case 'csebcdicuk':
+ case 'ebcdicuk':
+ return 'EBCDIC-UK';
+
+ case 'csebcdicus':
+ case 'ebcdicus':
+ return 'EBCDIC-US';
+
+ case 'csiso111ecmacyrillic':
+ case 'ecmacyrillic':
+ case 'isoir111':
+ case 'koi8e':
+ return 'ECMA-cyrillic';
+
+ case 'csiso17spanish':
+ case 'es':
+ case 'iso646es':
+ case 'isoir17':
+ return 'ES';
+
+ case 'csiso85spanish2':
+ case 'es2':
+ case 'iso646es2':
+ case 'isoir85':
+ return 'ES2';
+
+ case 'cseucpkdfmtjapanese':
+ case 'eucjp':
+ case 'extendedunixcodepackedformatforjapanese':
+ return 'EUC-JP';
+
+ case 'cseucfixwidjapanese':
+ case 'extendedunixcodefixedwidthforjapanese':
+ return 'Extended_UNIX_Code_Fixed_Width_for_Japanese';
+
+ case 'gb18030':
+ return 'GB18030';
+
+ case 'chinese':
+ case 'cp936':
+ case 'csgb2312':
+ case 'csiso58gb231280':
+ case 'gb2312':
+ case 'gb231280':
+ case 'gbk':
+ case 'isoir58':
+ case 'ms936':
+ case 'windows936':
+ return 'GBK';
+
+ case 'cn':
+ case 'csiso57gb1988':
+ case 'gb198880':
+ case 'iso646cn':
+ case 'isoir57':
+ return 'GB_1988-80';
+
+ case 'csiso153gost1976874':
+ case 'gost1976874':
+ case 'isoir153':
+ case 'stsev35888':
+ return 'GOST_19768-74';
+
+ case 'csiso150':
+ case 'csiso150greekccitt':
+ case 'greekccitt':
+ case 'isoir150':
+ return 'greek-ccitt';
+
+ case 'csiso88greek7':
+ case 'greek7':
+ case 'isoir88':
+ return 'greek7';
+
+ case 'csiso18greek7old':
+ case 'greek7old':
+ case 'isoir18':
+ return 'greek7-old';
+
+ case 'cshpdesktop':
+ case 'hpdesktop':
+ return 'HP-DeskTop';
+
+ case 'cshplegal':
+ case 'hplegal':
+ return 'HP-Legal';
+
+ case 'cshpmath8':
+ case 'hpmath8':
+ return 'HP-Math8';
+
+ case 'cshppifont':
+ case 'hppifont':
+ return 'HP-Pi-font';
+
+ case 'cshproman8':
+ case 'hproman8':
+ case 'r8':
+ case 'roman8':
+ return 'hp-roman8';
+
+ case 'hzgb2312':
+ return 'HZ-GB-2312';
+
+ case 'csibmsymbols':
+ case 'ibmsymbols':
+ return 'IBM-Symbols';
+
+ case 'csibmthai':
+ case 'ibmthai':
+ return 'IBM-Thai';
+
+ case 'cp37':
+ case 'csibm37':
+ case 'ebcdiccpca':
+ case 'ebcdiccpnl':
+ case 'ebcdiccpus':
+ case 'ebcdiccpwt':
+ case 'ibm37':
+ return 'IBM037';
+
+ case 'cp38':
+ case 'csibm38':
+ case 'ebcdicint':
+ case 'ibm38':
+ return 'IBM038';
+
+ case 'cp273':
+ case 'csibm273':
+ case 'ibm273':
+ return 'IBM273';
+
+ case 'cp274':
+ case 'csibm274':
+ case 'ebcdicbe':
+ case 'ibm274':
+ return 'IBM274';
+
+ case 'cp275':
+ case 'csibm275':
+ case 'ebcdicbr':
+ case 'ibm275':
+ return 'IBM275';
+
+ case 'csibm277':
+ case 'ebcdiccpdk':
+ case 'ebcdiccpno':
+ case 'ibm277':
+ return 'IBM277';
+
+ case 'cp278':
+ case 'csibm278':
+ case 'ebcdiccpfi':
+ case 'ebcdiccpse':
+ case 'ibm278':
+ return 'IBM278';
+
+ case 'cp280':
+ case 'csibm280':
+ case 'ebcdiccpit':
+ case 'ibm280':
+ return 'IBM280';
+
+ case 'cp281':
+ case 'csibm281':
+ case 'ebcdicjpe':
+ case 'ibm281':
+ return 'IBM281';
+
+ case 'cp284':
+ case 'csibm284':
+ case 'ebcdiccpes':
+ case 'ibm284':
+ return 'IBM284';
+
+ case 'cp285':
+ case 'csibm285':
+ case 'ebcdiccpgb':
+ case 'ibm285':
+ return 'IBM285';
+
+ case 'cp290':
+ case 'csibm290':
+ case 'ebcdicjpkana':
+ case 'ibm290':
+ return 'IBM290';
+
+ case 'cp297':
+ case 'csibm297':
+ case 'ebcdiccpfr':
+ case 'ibm297':
+ return 'IBM297';
+
+ case 'cp420':
+ case 'csibm420':
+ case 'ebcdiccpar1':
+ case 'ibm420':
+ return 'IBM420';
+
+ case 'cp423':
+ case 'csibm423':
+ case 'ebcdiccpgr':
+ case 'ibm423':
+ return 'IBM423';
+
+ case 'cp424':
+ case 'csibm424':
+ case 'ebcdiccphe':
+ case 'ibm424':
+ return 'IBM424';
+
+ case '437':
+ case 'cp437':
+ case 'cspc8codepage437':
+ case 'ibm437':
+ return 'IBM437';
+
+ case 'cp500':
+ case 'csibm500':
+ case 'ebcdiccpbe':
+ case 'ebcdiccpch':
+ case 'ibm500':
+ return 'IBM500';
+
+ case 'cp775':
+ case 'cspc775baltic':
+ case 'ibm775':
+ return 'IBM775';
+
+ case '850':
+ case 'cp850':
+ case 'cspc850multilingual':
+ case 'ibm850':
+ return 'IBM850';
+
+ case '851':
+ case 'cp851':
+ case 'csibm851':
+ case 'ibm851':
+ return 'IBM851';
+
+ case '852':
+ case 'cp852':
+ case 'cspcp852':
+ case 'ibm852':
+ return 'IBM852';
+
+ case '855':
+ case 'cp855':
+ case 'csibm855':
+ case 'ibm855':
+ return 'IBM855';
+
+ case '857':
+ case 'cp857':
+ case 'csibm857':
+ case 'ibm857':
+ return 'IBM857';
+
+ case 'ccsid858':
+ case 'cp858':
+ case 'ibm858':
+ case 'pcmultilingual850euro':
+ return 'IBM00858';
+
+ case '860':
+ case 'cp860':
+ case 'csibm860':
+ case 'ibm860':
+ return 'IBM860';
+
+ case '861':
+ case 'cp861':
+ case 'cpis':
+ case 'csibm861':
+ case 'ibm861':
+ return 'IBM861';
+
+ case '862':
+ case 'cp862':
+ case 'cspc862latinhebrew':
+ case 'ibm862':
+ return 'IBM862';
+
+ case '863':
+ case 'cp863':
+ case 'csibm863':
+ case 'ibm863':
+ return 'IBM863';
+
+ case 'cp864':
+ case 'csibm864':
+ case 'ibm864':
+ return 'IBM864';
+
+ case '865':
+ case 'cp865':
+ case 'csibm865':
+ case 'ibm865':
+ return 'IBM865';
+
+ case '866':
+ case 'cp866':
+ case 'csibm866':
+ case 'ibm866':
+ return 'IBM866';
+
+ case 'cp868':
+ case 'cpar':
+ case 'csibm868':
+ case 'ibm868':
+ return 'IBM868';
+
+ case '869':
+ case 'cp869':
+ case 'cpgr':
+ case 'csibm869':
+ case 'ibm869':
+ return 'IBM869';
+
+ case 'cp870':
+ case 'csibm870':
+ case 'ebcdiccproece':
+ case 'ebcdiccpyu':
+ case 'ibm870':
+ return 'IBM870';
+
+ case 'cp871':
+ case 'csibm871':
+ case 'ebcdiccpis':
+ case 'ibm871':
+ return 'IBM871';
+
+ case 'cp880':
+ case 'csibm880':
+ case 'ebcdiccyrillic':
+ case 'ibm880':
+ return 'IBM880';
+
+ case 'cp891':
+ case 'csibm891':
+ case 'ibm891':
+ return 'IBM891';
+
+ case 'cp903':
+ case 'csibm903':
+ case 'ibm903':
+ return 'IBM903';
+
+ case '904':
+ case 'cp904':
+ case 'csibbm904':
+ case 'ibm904':
+ return 'IBM904';
+
+ case 'cp905':
+ case 'csibm905':
+ case 'ebcdiccptr':
+ case 'ibm905':
+ return 'IBM905';
+
+ case 'cp918':
+ case 'csibm918':
+ case 'ebcdiccpar2':
+ case 'ibm918':
+ return 'IBM918';
+
+ case 'ccsid924':
+ case 'cp924':
+ case 'ebcdiclatin9euro':
+ case 'ibm924':
+ return 'IBM00924';
+
+ case 'cp1026':
+ case 'csibm1026':
+ case 'ibm1026':
+ return 'IBM1026';
+
+ case 'ibm1047':
+ return 'IBM1047';
+
+ case 'ccsid1140':
+ case 'cp1140':
+ case 'ebcdicus37euro':
+ case 'ibm1140':
+ return 'IBM01140';
+
+ case 'ccsid1141':
+ case 'cp1141':
+ case 'ebcdicde273euro':
+ case 'ibm1141':
+ return 'IBM01141';
+
+ case 'ccsid1142':
+ case 'cp1142':
+ case 'ebcdicdk277euro':
+ case 'ebcdicno277euro':
+ case 'ibm1142':
+ return 'IBM01142';
+
+ case 'ccsid1143':
+ case 'cp1143':
+ case 'ebcdicfi278euro':
+ case 'ebcdicse278euro':
+ case 'ibm1143':
+ return 'IBM01143';
+
+ case 'ccsid1144':
+ case 'cp1144':
+ case 'ebcdicit280euro':
+ case 'ibm1144':
+ return 'IBM01144';
+
+ case 'ccsid1145':
+ case 'cp1145':
+ case 'ebcdices284euro':
+ case 'ibm1145':
+ return 'IBM01145';
+
+ case 'ccsid1146':
+ case 'cp1146':
+ case 'ebcdicgb285euro':
+ case 'ibm1146':
+ return 'IBM01146';
+
+ case 'ccsid1147':
+ case 'cp1147':
+ case 'ebcdicfr297euro':
+ case 'ibm1147':
+ return 'IBM01147';
+
+ case 'ccsid1148':
+ case 'cp1148':
+ case 'ebcdicinternational500euro':
+ case 'ibm1148':
+ return 'IBM01148';
+
+ case 'ccsid1149':
+ case 'cp1149':
+ case 'ebcdicis871euro':
+ case 'ibm1149':
+ return 'IBM01149';
+
+ case 'csiso143iecp271':
+ case 'iecp271':
+ case 'isoir143':
+ return 'IEC_P27-1';
+
+ case 'csiso49inis':
+ case 'inis':
+ case 'isoir49':
+ return 'INIS';
+
+ case 'csiso50inis8':
+ case 'inis8':
+ case 'isoir50':
+ return 'INIS-8';
+
+ case 'csiso51iniscyrillic':
+ case 'iniscyrillic':
+ case 'isoir51':
+ return 'INIS-cyrillic';
+
+ case 'csinvariant':
+ case 'invariant':
+ return 'INVARIANT';
+
+ case 'iso2022cn':
+ return 'ISO-2022-CN';
+
+ case 'iso2022cnext':
+ return 'ISO-2022-CN-EXT';
+
+ case 'csiso2022jp':
+ case 'iso2022jp':
+ return 'ISO-2022-JP';
+
+ case 'csiso2022jp2':
+ case 'iso2022jp2':
+ return 'ISO-2022-JP-2';
+
+ case 'csiso2022kr':
+ case 'iso2022kr':
+ return 'ISO-2022-KR';
+
+ case 'cswindows30latin1':
+ case 'iso88591windows30latin1':
+ return 'ISO-8859-1-Windows-3.0-Latin-1';
+
+ case 'cswindows31latin1':
+ case 'iso88591windows31latin1':
+ return 'ISO-8859-1-Windows-3.1-Latin-1';
+
+ case 'csisolatin2':
+ case 'iso88592':
+ case 'iso885921987':
+ case 'isoir101':
+ case 'l2':
+ case 'latin2':
+ return 'ISO-8859-2';
+
+ case 'cswindows31latin2':
+ case 'iso88592windowslatin2':
+ return 'ISO-8859-2-Windows-Latin-2';
+
+ case 'csisolatin3':
+ case 'iso88593':
+ case 'iso885931988':
+ case 'isoir109':
+ case 'l3':
+ case 'latin3':
+ return 'ISO-8859-3';
+
+ case 'csisolatin4':
+ case 'iso88594':
+ case 'iso885941988':
+ case 'isoir110':
+ case 'l4':
+ case 'latin4':
+ return 'ISO-8859-4';
+
+ case 'csisolatincyrillic':
+ case 'cyrillic':
+ case 'iso88595':
+ case 'iso885951988':
+ case 'isoir144':
+ return 'ISO-8859-5';
+
+ case 'arabic':
+ case 'asmo708':
+ case 'csisolatinarabic':
+ case 'ecma114':
+ case 'iso88596':
+ case 'iso885961987':
+ case 'isoir127':
+ return 'ISO-8859-6';
+
+ case 'csiso88596e':
+ case 'iso88596e':
+ return 'ISO-8859-6-E';
+
+ case 'csiso88596i':
+ case 'iso88596i':
+ return 'ISO-8859-6-I';
+
+ case 'csisolatingreek':
+ case 'ecma118':
+ case 'elot928':
+ case 'greek':
+ case 'greek8':
+ case 'iso88597':
+ case 'iso885971987':
+ case 'isoir126':
+ return 'ISO-8859-7';
+
+ case 'csisolatinhebrew':
+ case 'hebrew':
+ case 'iso88598':
+ case 'iso885981988':
+ case 'isoir138':
+ return 'ISO-8859-8';
+
+ case 'csiso88598e':
+ case 'iso88598e':
+ return 'ISO-8859-8-E';
+
+ case 'csiso88598i':
+ case 'iso88598i':
+ return 'ISO-8859-8-I';
+
+ case 'cswindows31latin5':
+ case 'iso88599windowslatin5':
+ return 'ISO-8859-9-Windows-Latin-5';
+
+ case 'csisolatin6':
+ case 'iso885910':
+ case 'iso8859101992':
+ case 'isoir157':
+ case 'l6':
+ case 'latin6':
+ return 'ISO-8859-10';
+
+ case 'iso885913':
+ return 'ISO-8859-13';
+
+ case 'iso885914':
+ case 'iso8859141998':
+ case 'isoceltic':
+ case 'isoir199':
+ case 'l8':
+ case 'latin8':
+ return 'ISO-8859-14';
+
+ case 'iso885915':
+ case 'latin9':
+ return 'ISO-8859-15';
+
+ case 'iso885916':
+ case 'iso8859162001':
+ case 'isoir226':
+ case 'l10':
+ case 'latin10':
+ return 'ISO-8859-16';
+
+ case 'iso10646j1':
+ return 'ISO-10646-J-1';
+
+ case 'csunicode':
+ case 'iso10646ucs2':
+ return 'ISO-10646-UCS-2';
+
+ case 'csucs4':
+ case 'iso10646ucs4':
+ return 'ISO-10646-UCS-4';
+
+ case 'csunicodeascii':
+ case 'iso10646ucsbasic':
+ return 'ISO-10646-UCS-Basic';
+
+ case 'csunicodelatin1':
+ case 'iso10646':
+ case 'iso10646unicodelatin1':
+ return 'ISO-10646-Unicode-Latin1';
+
+ case 'csiso10646utf1':
+ case 'iso10646utf1':
+ return 'ISO-10646-UTF-1';
+
+ case 'csiso115481':
+ case 'iso115481':
+ case 'isotr115481':
+ return 'ISO-11548-1';
+
+ case 'csiso90':
+ case 'isoir90':
+ return 'iso-ir-90';
+
+ case 'csunicodeibm1261':
+ case 'isounicodeibm1261':
+ return 'ISO-Unicode-IBM-1261';
+
+ case 'csunicodeibm1264':
+ case 'isounicodeibm1264':
+ return 'ISO-Unicode-IBM-1264';
+
+ case 'csunicodeibm1265':
+ case 'isounicodeibm1265':
+ return 'ISO-Unicode-IBM-1265';
+
+ case 'csunicodeibm1268':
+ case 'isounicodeibm1268':
+ return 'ISO-Unicode-IBM-1268';
+
+ case 'csunicodeibm1276':
+ case 'isounicodeibm1276':
+ return 'ISO-Unicode-IBM-1276';
+
+ case 'csiso646basic1983':
+ case 'iso646basic1983':
+ case 'ref':
+ return 'ISO_646.basic:1983';
+
+ case 'csiso2intlrefversion':
+ case 'irv':
+ case 'iso646irv1983':
+ case 'isoir2':
+ return 'ISO_646.irv:1983';
+
+ case 'csiso2033':
+ case 'e13b':
+ case 'iso20331983':
+ case 'isoir98':
+ return 'ISO_2033-1983';
+
+ case 'csiso5427cyrillic':
+ case 'iso5427':
+ case 'isoir37':
+ return 'ISO_5427';
+
+ case 'iso5427cyrillic1981':
+ case 'iso54271981':
+ case 'isoir54':
+ return 'ISO_5427:1981';
+
+ case 'csiso5428greek':
+ case 'iso54281980':
+ case 'isoir55':
+ return 'ISO_5428:1980';
+
+ case 'csiso6937add':
+ case 'iso6937225':
+ case 'isoir152':
+ return 'ISO_6937-2-25';
+
+ case 'csisotextcomm':
+ case 'iso69372add':
+ case 'isoir142':
+ return 'ISO_6937-2-add';
+
+ case 'csiso8859supp':
+ case 'iso8859supp':
+ case 'isoir154':
+ case 'latin125':
+ return 'ISO_8859-supp';
+
+ case 'csiso10367box':
+ case 'iso10367box':
+ case 'isoir155':
+ return 'ISO_10367-box';
+
+ case 'csiso15italian':
+ case 'iso646it':
+ case 'isoir15':
+ case 'it':
+ return 'IT';
+
+ case 'csiso13jisc6220jp':
+ case 'isoir13':
+ case 'jisc62201969':
+ case 'jisc62201969jp':
+ case 'katakana':
+ case 'x2017':
+ return 'JIS_C6220-1969-jp';
+
+ case 'csiso14jisc6220ro':
+ case 'iso646jp':
+ case 'isoir14':
+ case 'jisc62201969ro':
+ case 'jp':
+ return 'JIS_C6220-1969-ro';
+
+ case 'csiso42jisc62261978':
+ case 'isoir42':
+ case 'jisc62261978':
+ return 'JIS_C6226-1978';
+
+ case 'csiso87jisx208':
+ case 'isoir87':
+ case 'jisc62261983':
+ case 'jisx2081983':
+ case 'x208':
+ return 'JIS_C6226-1983';
+
+ case 'csiso91jisc62291984a':
+ case 'isoir91':
+ case 'jisc62291984a':
+ case 'jpocra':
+ return 'JIS_C6229-1984-a';
+
+ case 'csiso92jisc62991984b':
+ case 'iso646jpocrb':
+ case 'isoir92':
+ case 'jisc62291984b':
+ case 'jpocrb':
+ return 'JIS_C6229-1984-b';
+
+ case 'csiso93jis62291984badd':
+ case 'isoir93':
+ case 'jisc62291984badd':
+ case 'jpocrbadd':
+ return 'JIS_C6229-1984-b-add';
+
+ case 'csiso94jis62291984hand':
+ case 'isoir94':
+ case 'jisc62291984hand':
+ case 'jpocrhand':
+ return 'JIS_C6229-1984-hand';
+
+ case 'csiso95jis62291984handadd':
+ case 'isoir95':
+ case 'jisc62291984handadd':
+ case 'jpocrhandadd':
+ return 'JIS_C6229-1984-hand-add';
+
+ case 'csiso96jisc62291984kana':
+ case 'isoir96':
+ case 'jisc62291984kana':
+ return 'JIS_C6229-1984-kana';
+
+ case 'csjisencoding':
+ case 'jisencoding':
+ return 'JIS_Encoding';
+
+ case 'cshalfwidthkatakana':
+ case 'jisx201':
+ case 'x201':
+ return 'JIS_X0201';
+
+ case 'csiso159jisx2121990':
+ case 'isoir159':
+ case 'jisx2121990':
+ case 'x212':
+ return 'JIS_X0212-1990';
+
+ case 'csiso141jusib1002':
+ case 'iso646yu':
+ case 'isoir141':
+ case 'js':
+ case 'jusib1002':
+ case 'yu':
+ return 'JUS_I.B1.002';
+
+ case 'csiso147macedonian':
+ case 'isoir147':
+ case 'jusib1003mac':
+ case 'macedonian':
+ return 'JUS_I.B1.003-mac';
+
+ case 'csiso146serbian':
+ case 'isoir146':
+ case 'jusib1003serb':
+ case 'serbian':
+ return 'JUS_I.B1.003-serb';
+
+ case 'koi7switched':
+ return 'KOI7-switched';
+
+ case 'cskoi8r':
+ case 'koi8r':
+ return 'KOI8-R';
+
+ case 'koi8u':
+ return 'KOI8-U';
+
+ case 'csksc5636':
+ case 'iso646kr':
+ case 'ksc5636':
+ return 'KSC5636';
+
+ case 'cskz1048':
+ case 'kz1048':
+ case 'rk1048':
+ case 'strk10482002':
+ return 'KZ-1048';
+
+ case 'csiso19latingreek':
+ case 'isoir19':
+ case 'latingreek':
+ return 'latin-greek';
+
+ case 'csiso27latingreek1':
+ case 'isoir27':
+ case 'latingreek1':
+ return 'Latin-greek-1';
+
+ case 'csiso158lap':
+ case 'isoir158':
+ case 'lap':
+ case 'latinlap':
+ return 'latin-lap';
+
+ case 'csmacintosh':
+ case 'mac':
+ case 'macintosh':
+ return 'macintosh';
+
+ case 'csmicrosoftpublishing':
+ case 'microsoftpublishing':
+ return 'Microsoft-Publishing';
+
+ case 'csmnem':
+ case 'mnem':
+ return 'MNEM';
+
+ case 'csmnemonic':
+ case 'mnemonic':
+ return 'MNEMONIC';
+
+ case 'csiso86hungarian':
+ case 'hu':
+ case 'iso646hu':
+ case 'isoir86':
+ case 'msz77953':
+ return 'MSZ_7795.3';
+
+ case 'csnatsdano':
+ case 'isoir91':
+ case 'natsdano':
+ return 'NATS-DANO';
+
+ case 'csnatsdanoadd':
+ case 'isoir92':
+ case 'natsdanoadd':
+ return 'NATS-DANO-ADD';
+
+ case 'csnatssefi':
+ case 'isoir81':
+ case 'natssefi':
+ return 'NATS-SEFI';
+
+ case 'csnatssefiadd':
+ case 'isoir82':
+ case 'natssefiadd':
+ return 'NATS-SEFI-ADD';
+
+ case 'csiso151cuba':
+ case 'cuba':
+ case 'iso646cu':
+ case 'isoir151':
+ case 'ncnc1081':
+ return 'NC_NC00-10:81';
+
+ case 'csiso69french':
+ case 'fr':
+ case 'iso646fr':
+ case 'isoir69':
+ case 'nfz62010':
+ return 'NF_Z_62-010';
+
+ case 'csiso25french':
+ case 'iso646fr1':
+ case 'isoir25':
+ case 'nfz620101973':
+ return 'NF_Z_62-010_(1973)';
+
+ case 'csiso60danishnorwegian':
+ case 'csiso60norwegian1':
+ case 'iso646no':
+ case 'isoir60':
+ case 'no':
+ case 'ns45511':
+ return 'NS_4551-1';
+
+ case 'csiso61norwegian2':
+ case 'iso646no2':
+ case 'isoir61':
+ case 'no2':
+ case 'ns45512':
+ return 'NS_4551-2';
+
+ case 'osdebcdicdf3irv':
+ return 'OSD_EBCDIC_DF03_IRV';
+
+ case 'osdebcdicdf41':
+ return 'OSD_EBCDIC_DF04_1';
+
+ case 'osdebcdicdf415':
+ return 'OSD_EBCDIC_DF04_15';
+
+ case 'cspc8danishnorwegian':
+ case 'pc8danishnorwegian':
+ return 'PC8-Danish-Norwegian';
+
+ case 'cspc8turkish':
+ case 'pc8turkish':
+ return 'PC8-Turkish';
+
+ case 'csiso16portuguese':
+ case 'iso646pt':
+ case 'isoir16':
+ case 'pt':
+ return 'PT';
+
+ case 'csiso84portuguese2':
+ case 'iso646pt2':
+ case 'isoir84':
+ case 'pt2':
+ return 'PT2';
+
+ case 'cp154':
+ case 'csptcp154':
+ case 'cyrillicasian':
+ case 'pt154':
+ case 'ptcp154':
+ return 'PTCP154';
+
+ case 'scsu':
+ return 'SCSU';
+
+ case 'csiso10swedish':
+ case 'fi':
+ case 'iso646fi':
+ case 'iso646se':
+ case 'isoir10':
+ case 'se':
+ case 'sen850200b':
+ return 'SEN_850200_B';
+
+ case 'csiso11swedishfornames':
+ case 'iso646se2':
+ case 'isoir11':
+ case 'se2':
+ case 'sen850200c':
+ return 'SEN_850200_C';
+
+ case 'csiso102t617bit':
+ case 'isoir102':
+ case 't617bit':
+ return 'T.61-7bit';
+
+ case 'csiso103t618bit':
+ case 'isoir103':
+ case 't61':
+ case 't618bit':
+ return 'T.61-8bit';
+
+ case 'csiso128t101g2':
+ case 'isoir128':
+ case 't101g2':
+ return 'T.101-G2';
+
+ case 'cstscii':
+ case 'tscii':
+ return 'TSCII';
+
+ case 'csunicode11':
+ case 'unicode11':
+ return 'UNICODE-1-1';
+
+ case 'csunicode11utf7':
+ case 'unicode11utf7':
+ return 'UNICODE-1-1-UTF-7';
+
+ case 'csunknown8bit':
+ case 'unknown8bit':
+ return 'UNKNOWN-8BIT';
+
+ case 'ansix341968':
+ case 'ansix341986':
+ case 'ascii':
+ case 'cp367':
+ case 'csascii':
+ case 'ibm367':
+ case 'iso646irv1991':
+ case 'iso646us':
+ case 'isoir6':
+ case 'us':
+ case 'usascii':
+ return 'US-ASCII';
+
+ case 'csusdk':
+ case 'usdk':
+ return 'us-dk';
+
+ case 'utf7':
+ return 'UTF-7';
+
+ case 'utf8':
+ return 'UTF-8';
+
+ case 'utf16':
+ return 'UTF-16';
+
+ case 'utf16be':
+ return 'UTF-16BE';
+
+ case 'utf16le':
+ return 'UTF-16LE';
+
+ case 'utf32':
+ return 'UTF-32';
+
+ case 'utf32be':
+ return 'UTF-32BE';
+
+ case 'utf32le':
+ return 'UTF-32LE';
+
+ case 'csventurainternational':
+ case 'venturainternational':
+ return 'Ventura-International';
+
+ case 'csventuramath':
+ case 'venturamath':
+ return 'Ventura-Math';
+
+ case 'csventuraus':
+ case 'venturaus':
+ return 'Ventura-US';
+
+ case 'csiso70videotexsupp1':
+ case 'isoir70':
+ case 'videotexsuppl':
+ return 'videotex-suppl';
+
+ case 'csviqr':
+ case 'viqr':
+ return 'VIQR';
+
+ case 'csviscii':
+ case 'viscii':
+ return 'VISCII';
+
+ case 'csshiftjis':
+ case 'cswindows31j':
+ case 'mskanji':
+ case 'shiftjis':
+ case 'windows31j':
+ return 'Windows-31J';
+
+ case 'iso885911':
+ case 'tis620':
+ return 'windows-874';
+
+ case 'cseuckr':
+ case 'csksc56011987':
+ case 'euckr':
+ case 'isoir149':
+ case 'korean':
+ case 'ksc5601':
+ case 'ksc56011987':
+ case 'ksc56011989':
+ case 'windows949':
+ return 'windows-949';
+
+ case 'windows1250':
+ return 'windows-1250';
+
+ case 'windows1251':
+ return 'windows-1251';
+
+ case 'cp819':
+ case 'csisolatin1':
+ case 'ibm819':
+ case 'iso88591':
+ case 'iso885911987':
+ case 'isoir100':
+ case 'l1':
+ case 'latin1':
+ case 'windows1252':
+ return 'windows-1252';
+
+ case 'windows1253':
+ return 'windows-1253';
+
+ case 'csisolatin5':
+ case 'iso88599':
+ case 'iso885991989':
+ case 'isoir148':
+ case 'l5':
+ case 'latin5':
+ case 'windows1254':
+ return 'windows-1254';
+
+ case 'windows1255':
+ return 'windows-1255';
+
+ case 'windows1256':
+ return 'windows-1256';
+
+ case 'windows1257':
+ return 'windows-1257';
+
+ case 'windows1258':
+ return 'windows-1258';
+
+ default:
+ return $charset;
+ }
+ }
+
+ public static function get_curl_version()
+ {
+ if (is_array($curl = curl_version()))
+ {
+ $curl = $curl['version'];
+ }
+ elseif (substr($curl, 0, 5) === 'curl/')
+ {
+ $curl = substr($curl, 5, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 5));
+ }
+ elseif (substr($curl, 0, 8) === 'libcurl/')
+ {
+ $curl = substr($curl, 8, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 8));
+ }
+ else
+ {
+ $curl = 0;
+ }
+ return $curl;
+ }
+
+ /**
+ * Strip HTML comments
+ *
+ * @param string $data Data to strip comments from
+ * @return string Comment stripped string
+ */
+ public static function strip_comments($data)
+ {
+ $output = '';
+ while (($start = strpos($data, '', $start)) !== false)
+ {
+ $data = substr_replace($data, '', 0, $end + 3);
+ }
+ else
+ {
+ $data = '';
+ }
+ }
+ return $output . $data;
+ }
+
+ public static function parse_date($dt)
+ {
+ $parser = SimplePie_Parse_Date::get();
+ return $parser->parse($dt);
+ }
+
+ /**
+ * Decode HTML entities
+ *
+ * @deprecated Use DOMDocument instead
+ * @param string $data Input data
+ * @return string Output data
+ */
+ public static function entities_decode($data)
+ {
+ $decoder = new SimplePie_Decode_HTML_Entities($data);
+ return $decoder->parse();
+ }
+
+ /**
+ * Remove RFC822 comments
+ *
+ * @param string $data Data to strip comments from
+ * @return string Comment stripped string
+ */
+ public static function uncomment_rfc822($string)
+ {
+ $string = (string) $string;
+ $position = 0;
+ $length = strlen($string);
+ $depth = 0;
+
+ $output = '';
+
+ while ($position < $length && ($pos = strpos($string, '(', $position)) !== false)
+ {
+ $output .= substr($string, $position, $pos - $position);
+ $position = $pos + 1;
+ if ($string[$pos - 1] !== '\\')
+ {
+ $depth++;
+ while ($depth && $position < $length)
+ {
+ $position += strcspn($string, '()', $position);
+ if ($string[$position - 1] === '\\')
+ {
+ $position++;
+ continue;
+ }
+ elseif (isset($string[$position]))
+ {
+ switch ($string[$position])
+ {
+ case '(':
+ $depth++;
+ break;
+
+ case ')':
+ $depth--;
+ break;
+ }
+ $position++;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ $output .= '(';
+ }
+ }
+ $output .= substr($string, $position);
+
+ return $output;
+ }
+
+ public static function parse_mime($mime)
+ {
+ if (($pos = strpos($mime, ';')) === false)
+ {
+ return trim($mime);
+ }
+
+ return trim(substr($mime, 0, $pos));
+ }
+
+ public static function atom_03_construct_type($attribs)
+ {
+ if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64'))
+ {
+ $mode = SIMPLEPIE_CONSTRUCT_BASE64;
+ }
+ else
+ {
+ $mode = SIMPLEPIE_CONSTRUCT_NONE;
+ }
+ if (isset($attribs['']['type']))
+ {
+ switch (strtolower(trim($attribs['']['type'])))
+ {
+ case 'text':
+ case 'text/plain':
+ return SIMPLEPIE_CONSTRUCT_TEXT | $mode;
+
+ case 'html':
+ case 'text/html':
+ return SIMPLEPIE_CONSTRUCT_HTML | $mode;
+
+ case 'xhtml':
+ case 'application/xhtml+xml':
+ return SIMPLEPIE_CONSTRUCT_XHTML | $mode;
+
+ default:
+ return SIMPLEPIE_CONSTRUCT_NONE | $mode;
+ }
+ }
+
+ return SIMPLEPIE_CONSTRUCT_TEXT | $mode;
+ }
+
+ public static function atom_10_construct_type($attribs)
+ {
+ if (isset($attribs['']['type']))
+ {
+ switch (strtolower(trim($attribs['']['type'])))
+ {
+ case 'text':
+ return SIMPLEPIE_CONSTRUCT_TEXT;
+
+ case 'html':
+ return SIMPLEPIE_CONSTRUCT_HTML;
+
+ case 'xhtml':
+ return SIMPLEPIE_CONSTRUCT_XHTML;
+
+ default:
+ return SIMPLEPIE_CONSTRUCT_NONE;
+ }
+ }
+ return SIMPLEPIE_CONSTRUCT_TEXT;
+ }
+
+ public static function atom_10_content_construct_type($attribs)
+ {
+ if (isset($attribs['']['type']))
+ {
+ $type = strtolower(trim($attribs['']['type']));
+ switch ($type)
+ {
+ case 'text':
+ return SIMPLEPIE_CONSTRUCT_TEXT;
+
+ case 'html':
+ return SIMPLEPIE_CONSTRUCT_HTML;
+
+ case 'xhtml':
+ return SIMPLEPIE_CONSTRUCT_XHTML;
+ }
+ if (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) === 'text/')
+ {
+ return SIMPLEPIE_CONSTRUCT_NONE;
+ }
+ else
+ {
+ return SIMPLEPIE_CONSTRUCT_BASE64;
+ }
+ }
+
+ return SIMPLEPIE_CONSTRUCT_TEXT;
+ }
+
+ public static function is_isegment_nz_nc($string)
+ {
+ return (bool) preg_match('/^([A-Za-z0-9\-._~\x{A0}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFEF}\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}!$&\'()*+,;=@]|(%[0-9ABCDEF]{2}))+$/u', $string);
+ }
+
+ public static function space_separated_tokens($string)
+ {
+ $space_characters = "\x20\x09\x0A\x0B\x0C\x0D";
+ $string_length = strlen($string);
+
+ $position = strspn($string, $space_characters);
+ $tokens = array();
+
+ while ($position < $string_length)
+ {
+ $len = strcspn($string, $space_characters, $position);
+ $tokens[] = substr($string, $position, $len);
+ $position += $len;
+ $position += strspn($string, $space_characters, $position);
+ }
+
+ return $tokens;
+ }
+
+ /**
+ * Converts a unicode codepoint to a UTF-8 character
+ *
+ * @static
+ * @param int $codepoint Unicode codepoint
+ * @return string UTF-8 character
+ */
+ public static function codepoint_to_utf8($codepoint)
+ {
+ $codepoint = (int) $codepoint;
+ if ($codepoint < 0)
+ {
+ return false;
+ }
+ else if ($codepoint <= 0x7f)
+ {
+ return chr($codepoint);
+ }
+ else if ($codepoint <= 0x7ff)
+ {
+ return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
+ }
+ else if ($codepoint <= 0xffff)
+ {
+ return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
+ }
+ else if ($codepoint <= 0x10ffff)
+ {
+ return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
+ }
+
+ // U+FFFD REPLACEMENT CHARACTER
+ return "\xEF\xBF\xBD";
+ }
+
+ /**
+ * Similar to parse_str()
+ *
+ * Returns an associative array of name/value pairs, where the value is an
+ * array of values that have used the same name
+ *
+ * @static
+ * @param string $str The input string.
+ * @return array
+ */
+ public static function parse_str($str)
+ {
+ $return = array();
+ $str = explode('&', $str);
+
+ foreach ($str as $section)
+ {
+ if (strpos($section, '=') !== false)
+ {
+ list($name, $value) = explode('=', $section, 2);
+ $return[urldecode($name)][] = urldecode($value);
+ }
+ else
+ {
+ $return[urldecode($section)][] = null;
+ }
+ }
+
+ return $return;
+ }
+
+ /**
+ * Detect XML encoding, as per XML 1.0 Appendix F.1
+ *
+ * @todo Add support for EBCDIC
+ * @param string $data XML data
+ * @param SimplePie_Registry $registry Class registry
+ * @return array Possible encodings
+ */
+ public static function xml_encoding($data, $registry)
+ {
+ // UTF-32 Big Endian BOM
+ if (substr($data, 0, 4) === "\x00\x00\xFE\xFF")
+ {
+ $encoding[] = 'UTF-32BE';
+ }
+ // UTF-32 Little Endian BOM
+ elseif (substr($data, 0, 4) === "\xFF\xFE\x00\x00")
+ {
+ $encoding[] = 'UTF-32LE';
+ }
+ // UTF-16 Big Endian BOM
+ elseif (substr($data, 0, 2) === "\xFE\xFF")
+ {
+ $encoding[] = 'UTF-16BE';
+ }
+ // UTF-16 Little Endian BOM
+ elseif (substr($data, 0, 2) === "\xFF\xFE")
+ {
+ $encoding[] = 'UTF-16LE';
+ }
+ // UTF-8 BOM
+ elseif (substr($data, 0, 3) === "\xEF\xBB\xBF")
+ {
+ $encoding[] = 'UTF-8';
+ }
+ // UTF-32 Big Endian Without BOM
+ elseif (substr($data, 0, 20) === "\x00\x00\x00\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C")
+ {
+ if ($pos = strpos($data, "\x00\x00\x00\x3F\x00\x00\x00\x3E"))
+ {
+ $parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8')));
+ if ($parser->parse())
+ {
+ $encoding[] = $parser->encoding;
+ }
+ }
+ $encoding[] = 'UTF-32BE';
+ }
+ // UTF-32 Little Endian Without BOM
+ elseif (substr($data, 0, 20) === "\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C\x00\x00\x00")
+ {
+ if ($pos = strpos($data, "\x3F\x00\x00\x00\x3E\x00\x00\x00"))
+ {
+ $parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8')));
+ if ($parser->parse())
+ {
+ $encoding[] = $parser->encoding;
+ }
+ }
+ $encoding[] = 'UTF-32LE';
+ }
+ // UTF-16 Big Endian Without BOM
+ elseif (substr($data, 0, 10) === "\x00\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C")
+ {
+ if ($pos = strpos($data, "\x00\x3F\x00\x3E"))
+ {
+ $parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8')));
+ if ($parser->parse())
+ {
+ $encoding[] = $parser->encoding;
+ }
+ }
+ $encoding[] = 'UTF-16BE';
+ }
+ // UTF-16 Little Endian Without BOM
+ elseif (substr($data, 0, 10) === "\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C\x00")
+ {
+ if ($pos = strpos($data, "\x3F\x00\x3E\x00"))
+ {
+ $parser = $registry->create('XML_Declaration_Parser', array(SimplePie_Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8')));
+ if ($parser->parse())
+ {
+ $encoding[] = $parser->encoding;
+ }
+ }
+ $encoding[] = 'UTF-16LE';
+ }
+ // US-ASCII (or superset)
+ elseif (substr($data, 0, 5) === "\x3C\x3F\x78\x6D\x6C")
+ {
+ if ($pos = strpos($data, "\x3F\x3E"))
+ {
+ $parser = $registry->create('XML_Declaration_Parser', array(substr($data, 5, $pos - 5)));
+ if ($parser->parse())
+ {
+ $encoding[] = $parser->encoding;
+ }
+ }
+ $encoding[] = 'UTF-8';
+ }
+ // Fallback to UTF-8
+ else
+ {
+ $encoding[] = 'UTF-8';
+ }
+ return $encoding;
+ }
+
+ public static function output_javascript()
+ {
+ if (function_exists('ob_gzhandler'))
+ {
+ ob_start('ob_gzhandler');
+ }
+ header('Content-type: text/javascript; charset: UTF-8');
+ header('Cache-Control: must-revalidate');
+ header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days
+ ?>
+function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) {
+ if (placeholder != '') {
+ document.writeln(' ');
+ }
+ else {
+ document.writeln(' ');
+ }
+}
+
+function embed_flash(bgcolor, width, height, link, loop, type) {
+ document.writeln(' ');
+}
+
+function embed_flv(width, height, link, placeholder, loop, player) {
+ document.writeln(' ');
+}
+
+function embed_wmedia(width, height, link) {
+ document.writeln(' ');
+}
+ $time)
+ {
+ $time = $mtime;
+ }
+ }
+ return $time;
+ }
+ elseif (file_exists(dirname(__FILE__) . '/Core.php'))
+ {
+ return filemtime(dirname(__FILE__) . '/Core.php');
+ }
+
+ return filemtime(__FILE__);
+ }
+
+ /**
+ * Format debugging information
+ */
+ public static function debug(&$sp)
+ {
+ $info = 'SimplePie ' . SIMPLEPIE_VERSION . ' Build ' . SIMPLEPIE_BUILD . "\n";
+ $info .= 'PHP ' . PHP_VERSION . "\n";
+ if ($sp->error() !== null)
+ {
+ $info .= 'Error occurred: ' . $sp->error() . "\n";
+ }
+ else
+ {
+ $info .= "No error found.\n";
+ }
+ $info .= "Extensions:\n";
+ $extensions = array('pcre', 'curl', 'zlib', 'mbstring', 'iconv', 'xmlreader', 'xml');
+ foreach ($extensions as $ext)
+ {
+ if (extension_loaded($ext))
+ {
+ $info .= " $ext loaded\n";
+ switch ($ext)
+ {
+ case 'pcre':
+ $info .= ' Version ' . PCRE_VERSION . "\n";
+ break;
+ case 'curl':
+ $version = curl_version();
+ $info .= ' Version ' . $version['version'] . "\n";
+ break;
+ case 'mbstring':
+ $info .= ' Overloading: ' . mb_get_info('func_overload') . "\n";
+ break;
+ case 'iconv':
+ $info .= ' Version ' . ICONV_VERSION . "\n";
+ break;
+ case 'xml':
+ $info .= ' Version ' . LIBXML_DOTTED_VERSION . "\n";
+ break;
+ }
+ }
+ else
+ {
+ $info .= " $ext not loaded\n";
+ }
+ }
+ return $info;
+ }
+
+ public static function silence_errors($num, $str)
+ {
+ // No-op
+ }
+
+ /**
+ * Sanitize a URL by removing HTTP credentials.
+ * @param string $url the URL to sanitize.
+ * @return string the same URL without HTTP credentials.
+ */
+ public static function url_remove_credentials($url)
+ {
+ return preg_replace('#^(https?://)[^/:@]+:[^/:@]+@#i', '$1', $url);
+ }
+}
+
+class_alias('SimplePie_Misc', 'SimplePie\Misc', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Net/IPv6.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Net/IPv6.php
new file mode 100644
index 0000000000..c7e466a54a
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Net/IPv6.php
@@ -0,0 +1,271 @@
+
+ * @author elfrink at introweb dot nl
+ * @author Josh Peck
+ * @author Sam Sneddon
+ */
+class SimplePie_Net_IPv6
+{
+ /**
+ * Uncompresses an IPv6 address
+ *
+ * RFC 4291 allows you to compress concecutive zero pieces in an address to
+ * '::'. This method expects a valid IPv6 address and expands the '::' to
+ * the required number of zero pieces.
+ *
+ * Example: FF01::101 -> FF01:0:0:0:0:0:0:101
+ * ::1 -> 0:0:0:0:0:0:0:1
+ *
+ * @author Alexander Merz
+ * @author elfrink at introweb dot nl
+ * @author Josh Peck
+ * @copyright 2003-2005 The PHP Group
+ * @license http://www.opensource.org/licenses/bsd-license.php
+ * @param string $ip An IPv6 address
+ * @return string The uncompressed IPv6 address
+ */
+ public static function uncompress($ip)
+ {
+ $c1 = -1;
+ $c2 = -1;
+ if (substr_count($ip, '::') === 1)
+ {
+ list($ip1, $ip2) = explode('::', $ip);
+ if ($ip1 === '')
+ {
+ $c1 = -1;
+ }
+ else
+ {
+ $c1 = substr_count($ip1, ':');
+ }
+ if ($ip2 === '')
+ {
+ $c2 = -1;
+ }
+ else
+ {
+ $c2 = substr_count($ip2, ':');
+ }
+ if (strpos($ip2, '.') !== false)
+ {
+ $c2++;
+ }
+ // ::
+ if ($c1 === -1 && $c2 === -1)
+ {
+ $ip = '0:0:0:0:0:0:0:0';
+ }
+ // ::xxx
+ else if ($c1 === -1)
+ {
+ $fill = str_repeat('0:', 7 - $c2);
+ $ip = str_replace('::', $fill, $ip);
+ }
+ // xxx::
+ else if ($c2 === -1)
+ {
+ $fill = str_repeat(':0', 7 - $c1);
+ $ip = str_replace('::', $fill, $ip);
+ }
+ // xxx::xxx
+ else
+ {
+ $fill = ':' . str_repeat('0:', 6 - $c2 - $c1);
+ $ip = str_replace('::', $fill, $ip);
+ }
+ }
+ return $ip;
+ }
+
+ /**
+ * Compresses an IPv6 address
+ *
+ * RFC 4291 allows you to compress concecutive zero pieces in an address to
+ * '::'. This method expects a valid IPv6 address and compresses consecutive
+ * zero pieces to '::'.
+ *
+ * Example: FF01:0:0:0:0:0:0:101 -> FF01::101
+ * 0:0:0:0:0:0:0:1 -> ::1
+ *
+ * @see uncompress()
+ * @param string $ip An IPv6 address
+ * @return string The compressed IPv6 address
+ */
+ public static function compress($ip)
+ {
+ // Prepare the IP to be compressed
+ $ip = self::uncompress($ip);
+ $ip_parts = self::split_v6_v4($ip);
+
+ // Replace all leading zeros
+ $ip_parts[0] = preg_replace('/(^|:)0+([0-9])/', '\1\2', $ip_parts[0]);
+
+ // Find bunches of zeros
+ if (preg_match_all('/(?:^|:)(?:0(?::|$))+/', $ip_parts[0], $matches, PREG_OFFSET_CAPTURE))
+ {
+ $max = 0;
+ $pos = null;
+ foreach ($matches[0] as $match)
+ {
+ if (strlen($match[0]) > $max)
+ {
+ $max = strlen($match[0]);
+ $pos = $match[1];
+ }
+ }
+
+ $ip_parts[0] = substr_replace($ip_parts[0], '::', $pos, $max);
+ }
+
+ if ($ip_parts[1] !== '')
+ {
+ return implode(':', $ip_parts);
+ }
+
+ return $ip_parts[0];
+ }
+
+ /**
+ * Splits an IPv6 address into the IPv6 and IPv4 representation parts
+ *
+ * RFC 4291 allows you to represent the last two parts of an IPv6 address
+ * using the standard IPv4 representation
+ *
+ * Example: 0:0:0:0:0:0:13.1.68.3
+ * 0:0:0:0:0:FFFF:129.144.52.38
+ *
+ * @param string $ip An IPv6 address
+ * @return array [0] contains the IPv6 represented part, and [1] the IPv4 represented part
+ */
+ private static function split_v6_v4($ip)
+ {
+ if (strpos($ip, '.') !== false)
+ {
+ $pos = strrpos($ip, ':');
+ $ipv6_part = substr($ip, 0, $pos);
+ $ipv4_part = substr($ip, $pos + 1);
+ return array($ipv6_part, $ipv4_part);
+ }
+
+ return array($ip, '');
+ }
+
+ /**
+ * Checks an IPv6 address
+ *
+ * Checks if the given IP is a valid IPv6 address
+ *
+ * @param string $ip An IPv6 address
+ * @return bool true if $ip is a valid IPv6 address
+ */
+ public static function check_ipv6($ip)
+ {
+ $ip = self::uncompress($ip);
+ list($ipv6, $ipv4) = self::split_v6_v4($ip);
+ $ipv6 = explode(':', $ipv6);
+ $ipv4 = explode('.', $ipv4);
+ if (count($ipv6) === 8 && count($ipv4) === 1 || count($ipv6) === 6 && count($ipv4) === 4)
+ {
+ foreach ($ipv6 as $ipv6_part)
+ {
+ // The section can't be empty
+ if ($ipv6_part === '')
+ return false;
+
+ // Nor can it be over four characters
+ if (strlen($ipv6_part) > 4)
+ return false;
+
+ // Remove leading zeros (this is safe because of the above)
+ $ipv6_part = ltrim($ipv6_part, '0');
+ if ($ipv6_part === '')
+ $ipv6_part = '0';
+
+ // Check the value is valid
+ $value = hexdec($ipv6_part);
+ if (dechex($value) !== strtolower($ipv6_part) || $value < 0 || $value > 0xFFFF)
+ return false;
+ }
+ if (count($ipv4) === 4)
+ {
+ foreach ($ipv4 as $ipv4_part)
+ {
+ $value = (int) $ipv4_part;
+ if ((string) $value !== $ipv4_part || $value < 0 || $value > 0xFF)
+ return false;
+ }
+ }
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks if the given IP is a valid IPv6 address
+ *
+ * @codeCoverageIgnore
+ * @deprecated Use {@see SimplePie_Net_IPv6::check_ipv6()} instead
+ * @see check_ipv6
+ * @param string $ip An IPv6 address
+ * @return bool true if $ip is a valid IPv6 address
+ */
+ public static function checkIPv6($ip)
+ {
+ return self::check_ipv6($ip);
+ }
+}
+
+class_alias('SimplePie_Net_IPv6', 'SimplePie\Net\IPv6', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Parse/Date.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Parse/Date.php
new file mode 100644
index 0000000000..fe7e3ea496
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Parse/Date.php
@@ -0,0 +1,1027 @@
+ ordinal day number in the week
+ *
+ * @access protected
+ * @var array
+ */
+ var $day = array(
+ // English
+ 'mon' => 1,
+ 'monday' => 1,
+ 'tue' => 2,
+ 'tuesday' => 2,
+ 'wed' => 3,
+ 'wednesday' => 3,
+ 'thu' => 4,
+ 'thursday' => 4,
+ 'fri' => 5,
+ 'friday' => 5,
+ 'sat' => 6,
+ 'saturday' => 6,
+ 'sun' => 7,
+ 'sunday' => 7,
+ // Dutch
+ 'maandag' => 1,
+ 'dinsdag' => 2,
+ 'woensdag' => 3,
+ 'donderdag' => 4,
+ 'vrijdag' => 5,
+ 'zaterdag' => 6,
+ 'zondag' => 7,
+ // French
+ 'lundi' => 1,
+ 'mardi' => 2,
+ 'mercredi' => 3,
+ 'jeudi' => 4,
+ 'vendredi' => 5,
+ 'samedi' => 6,
+ 'dimanche' => 7,
+ // German
+ 'montag' => 1,
+ 'mo' => 1,
+ 'dienstag' => 2,
+ 'di' => 2,
+ 'mittwoch' => 3,
+ 'mi' => 3,
+ 'donnerstag' => 4,
+ 'do' => 4,
+ 'freitag' => 5,
+ 'fr' => 5,
+ 'samstag' => 6,
+ 'sa' => 6,
+ 'sonnabend' => 6,
+ // AFAIK no short form for sonnabend
+ 'so' => 7,
+ 'sonntag' => 7,
+ // Italian
+ 'lunedì' => 1,
+ 'martedì' => 2,
+ 'mercoledì' => 3,
+ 'giovedì' => 4,
+ 'venerdì' => 5,
+ 'sabato' => 6,
+ 'domenica' => 7,
+ // Spanish
+ 'lunes' => 1,
+ 'martes' => 2,
+ 'miércoles' => 3,
+ 'jueves' => 4,
+ 'viernes' => 5,
+ 'sábado' => 6,
+ 'domingo' => 7,
+ // Finnish
+ 'maanantai' => 1,
+ 'tiistai' => 2,
+ 'keskiviikko' => 3,
+ 'torstai' => 4,
+ 'perjantai' => 5,
+ 'lauantai' => 6,
+ 'sunnuntai' => 7,
+ // Hungarian
+ 'hétfő' => 1,
+ 'kedd' => 2,
+ 'szerda' => 3,
+ 'csütörtok' => 4,
+ 'péntek' => 5,
+ 'szombat' => 6,
+ 'vasárnap' => 7,
+ // Greek
+ 'Δευ' => 1,
+ 'Τρι' => 2,
+ 'Τετ' => 3,
+ 'Πεμ' => 4,
+ 'Παρ' => 5,
+ 'Σαβ' => 6,
+ 'Κυρ' => 7,
+ // Russian
+ 'Пн.' => 1,
+ 'Вт.' => 2,
+ 'Ср.' => 3,
+ 'Чт.' => 4,
+ 'Пт.' => 5,
+ 'Сб.' => 6,
+ 'Вс.' => 7,
+ );
+
+ /**
+ * List of months, calendar month name => calendar month number
+ *
+ * @access protected
+ * @var array
+ */
+ var $month = array(
+ // English
+ 'jan' => 1,
+ 'january' => 1,
+ 'feb' => 2,
+ 'february' => 2,
+ 'mar' => 3,
+ 'march' => 3,
+ 'apr' => 4,
+ 'april' => 4,
+ 'may' => 5,
+ // No long form of May
+ 'jun' => 6,
+ 'june' => 6,
+ 'jul' => 7,
+ 'july' => 7,
+ 'aug' => 8,
+ 'august' => 8,
+ 'sep' => 9,
+ 'september' => 9,
+ 'oct' => 10,
+ 'october' => 10,
+ 'nov' => 11,
+ 'november' => 11,
+ 'dec' => 12,
+ 'december' => 12,
+ // Dutch
+ 'januari' => 1,
+ 'februari' => 2,
+ 'maart' => 3,
+ 'april' => 4,
+ 'mei' => 5,
+ 'juni' => 6,
+ 'juli' => 7,
+ 'augustus' => 8,
+ 'september' => 9,
+ 'oktober' => 10,
+ 'november' => 11,
+ 'december' => 12,
+ // French
+ 'janvier' => 1,
+ 'février' => 2,
+ 'mars' => 3,
+ 'avril' => 4,
+ 'mai' => 5,
+ 'juin' => 6,
+ 'juillet' => 7,
+ 'août' => 8,
+ 'septembre' => 9,
+ 'octobre' => 10,
+ 'novembre' => 11,
+ 'décembre' => 12,
+ // German
+ 'januar' => 1,
+ 'jan' => 1,
+ 'februar' => 2,
+ 'feb' => 2,
+ 'märz' => 3,
+ 'mär' => 3,
+ 'april' => 4,
+ 'apr' => 4,
+ 'mai' => 5, // no short form for may
+ 'juni' => 6,
+ 'jun' => 6,
+ 'juli' => 7,
+ 'jul' => 7,
+ 'august' => 8,
+ 'aug' => 8,
+ 'september' => 9,
+ 'sep' => 9,
+ 'oktober' => 10,
+ 'okt' => 10,
+ 'november' => 11,
+ 'nov' => 11,
+ 'dezember' => 12,
+ 'dez' => 12,
+ // Italian
+ 'gennaio' => 1,
+ 'febbraio' => 2,
+ 'marzo' => 3,
+ 'aprile' => 4,
+ 'maggio' => 5,
+ 'giugno' => 6,
+ 'luglio' => 7,
+ 'agosto' => 8,
+ 'settembre' => 9,
+ 'ottobre' => 10,
+ 'novembre' => 11,
+ 'dicembre' => 12,
+ // Spanish
+ 'enero' => 1,
+ 'febrero' => 2,
+ 'marzo' => 3,
+ 'abril' => 4,
+ 'mayo' => 5,
+ 'junio' => 6,
+ 'julio' => 7,
+ 'agosto' => 8,
+ 'septiembre' => 9,
+ 'setiembre' => 9,
+ 'octubre' => 10,
+ 'noviembre' => 11,
+ 'diciembre' => 12,
+ // Finnish
+ 'tammikuu' => 1,
+ 'helmikuu' => 2,
+ 'maaliskuu' => 3,
+ 'huhtikuu' => 4,
+ 'toukokuu' => 5,
+ 'kesäkuu' => 6,
+ 'heinäkuu' => 7,
+ 'elokuu' => 8,
+ 'suuskuu' => 9,
+ 'lokakuu' => 10,
+ 'marras' => 11,
+ 'joulukuu' => 12,
+ // Hungarian
+ 'január' => 1,
+ 'február' => 2,
+ 'március' => 3,
+ 'április' => 4,
+ 'május' => 5,
+ 'június' => 6,
+ 'július' => 7,
+ 'augusztus' => 8,
+ 'szeptember' => 9,
+ 'október' => 10,
+ 'november' => 11,
+ 'december' => 12,
+ // Greek
+ 'Ιαν' => 1,
+ 'Φεβ' => 2,
+ 'Μάώ' => 3,
+ 'Μαώ' => 3,
+ 'Απρ' => 4,
+ 'Μάι' => 5,
+ 'Μαϊ' => 5,
+ 'Μαι' => 5,
+ 'Ιούν' => 6,
+ 'Ιον' => 6,
+ 'Ιούλ' => 7,
+ 'Ιολ' => 7,
+ 'Αύγ' => 8,
+ 'Αυγ' => 8,
+ 'Σεπ' => 9,
+ 'Οκτ' => 10,
+ 'Νοέ' => 11,
+ 'Δεκ' => 12,
+ // Russian
+ 'Янв' => 1,
+ 'января' => 1,
+ 'Фев' => 2,
+ 'февраля' => 2,
+ 'Мар' => 3,
+ 'марта' => 3,
+ 'Апр' => 4,
+ 'апреля' => 4,
+ 'Май' => 5,
+ 'мая' => 5,
+ 'Июн' => 6,
+ 'июня' => 6,
+ 'Июл' => 7,
+ 'июля' => 7,
+ 'Авг' => 8,
+ 'августа' => 8,
+ 'Сен' => 9,
+ 'сентября' => 9,
+ 'Окт' => 10,
+ 'октября' => 10,
+ 'Ноя' => 11,
+ 'ноября' => 11,
+ 'Дек' => 12,
+ 'декабря' => 12,
+
+ );
+
+ /**
+ * List of timezones, abbreviation => offset from UTC
+ *
+ * @access protected
+ * @var array
+ */
+ var $timezone = array(
+ 'ACDT' => 37800,
+ 'ACIT' => 28800,
+ 'ACST' => 34200,
+ 'ACT' => -18000,
+ 'ACWDT' => 35100,
+ 'ACWST' => 31500,
+ 'AEDT' => 39600,
+ 'AEST' => 36000,
+ 'AFT' => 16200,
+ 'AKDT' => -28800,
+ 'AKST' => -32400,
+ 'AMDT' => 18000,
+ 'AMT' => -14400,
+ 'ANAST' => 46800,
+ 'ANAT' => 43200,
+ 'ART' => -10800,
+ 'AZOST' => -3600,
+ 'AZST' => 18000,
+ 'AZT' => 14400,
+ 'BIOT' => 21600,
+ 'BIT' => -43200,
+ 'BOT' => -14400,
+ 'BRST' => -7200,
+ 'BRT' => -10800,
+ 'BST' => 3600,
+ 'BTT' => 21600,
+ 'CAST' => 18000,
+ 'CAT' => 7200,
+ 'CCT' => 23400,
+ 'CDT' => -18000,
+ 'CEDT' => 7200,
+ 'CEST' => 7200,
+ 'CET' => 3600,
+ 'CGST' => -7200,
+ 'CGT' => -10800,
+ 'CHADT' => 49500,
+ 'CHAST' => 45900,
+ 'CIST' => -28800,
+ 'CKT' => -36000,
+ 'CLDT' => -10800,
+ 'CLST' => -14400,
+ 'COT' => -18000,
+ 'CST' => -21600,
+ 'CVT' => -3600,
+ 'CXT' => 25200,
+ 'DAVT' => 25200,
+ 'DTAT' => 36000,
+ 'EADT' => -18000,
+ 'EAST' => -21600,
+ 'EAT' => 10800,
+ 'ECT' => -18000,
+ 'EDT' => -14400,
+ 'EEST' => 10800,
+ 'EET' => 7200,
+ 'EGT' => -3600,
+ 'EKST' => 21600,
+ 'EST' => -18000,
+ 'FJT' => 43200,
+ 'FKDT' => -10800,
+ 'FKST' => -14400,
+ 'FNT' => -7200,
+ 'GALT' => -21600,
+ 'GEDT' => 14400,
+ 'GEST' => 10800,
+ 'GFT' => -10800,
+ 'GILT' => 43200,
+ 'GIT' => -32400,
+ 'GST' => 14400,
+ 'GST' => -7200,
+ 'GYT' => -14400,
+ 'HAA' => -10800,
+ 'HAC' => -18000,
+ 'HADT' => -32400,
+ 'HAE' => -14400,
+ 'HAP' => -25200,
+ 'HAR' => -21600,
+ 'HAST' => -36000,
+ 'HAT' => -9000,
+ 'HAY' => -28800,
+ 'HKST' => 28800,
+ 'HMT' => 18000,
+ 'HNA' => -14400,
+ 'HNC' => -21600,
+ 'HNE' => -18000,
+ 'HNP' => -28800,
+ 'HNR' => -25200,
+ 'HNT' => -12600,
+ 'HNY' => -32400,
+ 'IRDT' => 16200,
+ 'IRKST' => 32400,
+ 'IRKT' => 28800,
+ 'IRST' => 12600,
+ 'JFDT' => -10800,
+ 'JFST' => -14400,
+ 'JST' => 32400,
+ 'KGST' => 21600,
+ 'KGT' => 18000,
+ 'KOST' => 39600,
+ 'KOVST' => 28800,
+ 'KOVT' => 25200,
+ 'KRAST' => 28800,
+ 'KRAT' => 25200,
+ 'KST' => 32400,
+ 'LHDT' => 39600,
+ 'LHST' => 37800,
+ 'LINT' => 50400,
+ 'LKT' => 21600,
+ 'MAGST' => 43200,
+ 'MAGT' => 39600,
+ 'MAWT' => 21600,
+ 'MDT' => -21600,
+ 'MESZ' => 7200,
+ 'MEZ' => 3600,
+ 'MHT' => 43200,
+ 'MIT' => -34200,
+ 'MNST' => 32400,
+ 'MSDT' => 14400,
+ 'MSST' => 10800,
+ 'MST' => -25200,
+ 'MUT' => 14400,
+ 'MVT' => 18000,
+ 'MYT' => 28800,
+ 'NCT' => 39600,
+ 'NDT' => -9000,
+ 'NFT' => 41400,
+ 'NMIT' => 36000,
+ 'NOVST' => 25200,
+ 'NOVT' => 21600,
+ 'NPT' => 20700,
+ 'NRT' => 43200,
+ 'NST' => -12600,
+ 'NUT' => -39600,
+ 'NZDT' => 46800,
+ 'NZST' => 43200,
+ 'OMSST' => 25200,
+ 'OMST' => 21600,
+ 'PDT' => -25200,
+ 'PET' => -18000,
+ 'PETST' => 46800,
+ 'PETT' => 43200,
+ 'PGT' => 36000,
+ 'PHOT' => 46800,
+ 'PHT' => 28800,
+ 'PKT' => 18000,
+ 'PMDT' => -7200,
+ 'PMST' => -10800,
+ 'PONT' => 39600,
+ 'PST' => -28800,
+ 'PWT' => 32400,
+ 'PYST' => -10800,
+ 'PYT' => -14400,
+ 'RET' => 14400,
+ 'ROTT' => -10800,
+ 'SAMST' => 18000,
+ 'SAMT' => 14400,
+ 'SAST' => 7200,
+ 'SBT' => 39600,
+ 'SCDT' => 46800,
+ 'SCST' => 43200,
+ 'SCT' => 14400,
+ 'SEST' => 3600,
+ 'SGT' => 28800,
+ 'SIT' => 28800,
+ 'SRT' => -10800,
+ 'SST' => -39600,
+ 'SYST' => 10800,
+ 'SYT' => 7200,
+ 'TFT' => 18000,
+ 'THAT' => -36000,
+ 'TJT' => 18000,
+ 'TKT' => -36000,
+ 'TMT' => 18000,
+ 'TOT' => 46800,
+ 'TPT' => 32400,
+ 'TRUT' => 36000,
+ 'TVT' => 43200,
+ 'TWT' => 28800,
+ 'UYST' => -7200,
+ 'UYT' => -10800,
+ 'UZT' => 18000,
+ 'VET' => -14400,
+ 'VLAST' => 39600,
+ 'VLAT' => 36000,
+ 'VOST' => 21600,
+ 'VUT' => 39600,
+ 'WAST' => 7200,
+ 'WAT' => 3600,
+ 'WDT' => 32400,
+ 'WEST' => 3600,
+ 'WFT' => 43200,
+ 'WIB' => 25200,
+ 'WIT' => 32400,
+ 'WITA' => 28800,
+ 'WKST' => 18000,
+ 'WST' => 28800,
+ 'YAKST' => 36000,
+ 'YAKT' => 32400,
+ 'YAPT' => 36000,
+ 'YEKST' => 21600,
+ 'YEKT' => 18000,
+ );
+
+ /**
+ * Cached PCRE for SimplePie_Parse_Date::$day
+ *
+ * @access protected
+ * @var string
+ */
+ var $day_pcre;
+
+ /**
+ * Cached PCRE for SimplePie_Parse_Date::$month
+ *
+ * @access protected
+ * @var string
+ */
+ var $month_pcre;
+
+ /**
+ * Array of user-added callback methods
+ *
+ * @access private
+ * @var array
+ */
+ var $built_in = array();
+
+ /**
+ * Array of user-added callback methods
+ *
+ * @access private
+ * @var array
+ */
+ var $user = array();
+
+ /**
+ * Create new SimplePie_Parse_Date object, and set self::day_pcre,
+ * self::month_pcre, and self::built_in
+ *
+ * @access private
+ */
+ public function __construct()
+ {
+ $this->day_pcre = '(' . implode('|', array_keys($this->day)) . ')';
+ $this->month_pcre = '(' . implode('|', array_keys($this->month)) . ')';
+
+ static $cache;
+ if (!isset($cache[get_class($this)]))
+ {
+ $all_methods = get_class_methods($this);
+
+ foreach ($all_methods as $method)
+ {
+ if (strtolower(substr($method, 0, 5)) === 'date_')
+ {
+ $cache[get_class($this)][] = $method;
+ }
+ }
+ }
+
+ foreach ($cache[get_class($this)] as $method)
+ {
+ $this->built_in[] = $method;
+ }
+ }
+
+ /**
+ * Get the object
+ *
+ * @access public
+ */
+ public static function get()
+ {
+ static $object;
+ if (!$object)
+ {
+ $object = new SimplePie_Parse_Date;
+ }
+ return $object;
+ }
+
+ /**
+ * Parse a date
+ *
+ * @final
+ * @access public
+ * @param string $date Date to parse
+ * @return int Timestamp corresponding to date string, or false on failure
+ */
+ public function parse($date)
+ {
+ foreach ($this->user as $method)
+ {
+ if (($returned = call_user_func($method, $date)) !== false)
+ {
+ return $returned;
+ }
+ }
+
+ foreach ($this->built_in as $method)
+ {
+ if (($returned = call_user_func(array($this, $method), $date)) !== false)
+ {
+ return $returned;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Add a callback method to parse a date
+ *
+ * @final
+ * @access public
+ * @param callback $callback
+ */
+ public function add_callback($callback)
+ {
+ if (is_callable($callback))
+ {
+ $this->user[] = $callback;
+ }
+ else
+ {
+ trigger_error('User-supplied function must be a valid callback', E_USER_WARNING);
+ }
+ }
+
+ /**
+ * Parse a superset of W3C-DTF (allows hyphens and colons to be omitted, as
+ * well as allowing any of upper or lower case "T", horizontal tabs, or
+ * spaces to be used as the time separator (including more than one))
+ *
+ * @access protected
+ * @return int Timestamp
+ */
+ public function date_w3cdtf($date)
+ {
+ static $pcre;
+ if (!$pcre)
+ {
+ $year = '([0-9]{4})';
+ $month = $day = $hour = $minute = $second = '([0-9]{2})';
+ $decimal = '([0-9]*)';
+ $zone = '(?:(Z)|([+\-])([0-9]{1,2}):?([0-9]{1,2}))';
+ $pcre = '/^' . $year . '(?:-?' . $month . '(?:-?' . $day . '(?:[Tt\x09\x20]+' . $hour . '(?::?' . $minute . '(?::?' . $second . '(?:.' . $decimal . ')?)?)?' . $zone . ')?)?)?$/';
+ }
+ if (preg_match($pcre, $date, $match))
+ {
+ /*
+ Capturing subpatterns:
+ 1: Year
+ 2: Month
+ 3: Day
+ 4: Hour
+ 5: Minute
+ 6: Second
+ 7: Decimal fraction of a second
+ 8: Zulu
+ 9: Timezone ±
+ 10: Timezone hours
+ 11: Timezone minutes
+ */
+
+ // Fill in empty matches
+ for ($i = count($match); $i <= 3; $i++)
+ {
+ $match[$i] = '1';
+ }
+
+ for ($i = count($match); $i <= 7; $i++)
+ {
+ $match[$i] = '0';
+ }
+
+ // Numeric timezone
+ if (isset($match[9]) && $match[9] !== '')
+ {
+ $timezone = $match[10] * 3600;
+ $timezone += $match[11] * 60;
+ if ($match[9] === '-')
+ {
+ $timezone = 0 - $timezone;
+ }
+ }
+ else
+ {
+ $timezone = 0;
+ }
+
+ // Convert the number of seconds to an integer, taking decimals into account
+ $second = round((int)$match[6] + (int)$match[7] / (10 ** strlen($match[7])));
+
+ return gmmktime($match[4], $match[5], $second, $match[2], $match[3], $match[1]) - $timezone;
+ }
+
+ return false;
+ }
+
+ /**
+ * Remove RFC822 comments
+ *
+ * @access protected
+ * @param string $data Data to strip comments from
+ * @return string Comment stripped string
+ */
+ public function remove_rfc2822_comments($string)
+ {
+ $string = (string) $string;
+ $position = 0;
+ $length = strlen($string);
+ $depth = 0;
+
+ $output = '';
+
+ while ($position < $length && ($pos = strpos($string, '(', $position)) !== false)
+ {
+ $output .= substr($string, $position, $pos - $position);
+ $position = $pos + 1;
+ if ($pos === 0 || $string[$pos - 1] !== '\\')
+ {
+ $depth++;
+ while ($depth && $position < $length)
+ {
+ $position += strcspn($string, '()', $position);
+ if ($string[$position - 1] === '\\')
+ {
+ $position++;
+ continue;
+ }
+ elseif (isset($string[$position]))
+ {
+ switch ($string[$position])
+ {
+ case '(':
+ $depth++;
+ break;
+
+ case ')':
+ $depth--;
+ break;
+ }
+ $position++;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ $output .= '(';
+ }
+ }
+ $output .= substr($string, $position);
+
+ return $output;
+ }
+
+ /**
+ * Parse RFC2822's date format
+ *
+ * @access protected
+ * @return int Timestamp
+ */
+ public function date_rfc2822($date)
+ {
+ static $pcre;
+ if (!$pcre)
+ {
+ $wsp = '[\x09\x20]';
+ $fws = '(?:' . $wsp . '+|' . $wsp . '*(?:\x0D\x0A' . $wsp . '+)+)';
+ $optional_fws = $fws . '?';
+ $day_name = $this->day_pcre;
+ $month = $this->month_pcre;
+ $day = '([0-9]{1,2})';
+ $hour = $minute = $second = '([0-9]{2})';
+ $year = '([0-9]{2,4})';
+ $num_zone = '([+\-])([0-9]{2})([0-9]{2})';
+ $character_zone = '([A-Z]{1,5})';
+ $zone = '(?:' . $num_zone . '|' . $character_zone . ')';
+ $pcre = '/(?:' . $optional_fws . $day_name . $optional_fws . ',)?' . $optional_fws . $day . $fws . $month . $fws . $year . $fws . $hour . $optional_fws . ':' . $optional_fws . $minute . '(?:' . $optional_fws . ':' . $optional_fws . $second . ')?' . $fws . $zone . '/i';
+ }
+ if (preg_match($pcre, $this->remove_rfc2822_comments($date), $match))
+ {
+ /*
+ Capturing subpatterns:
+ 1: Day name
+ 2: Day
+ 3: Month
+ 4: Year
+ 5: Hour
+ 6: Minute
+ 7: Second
+ 8: Timezone ±
+ 9: Timezone hours
+ 10: Timezone minutes
+ 11: Alphabetic timezone
+ */
+
+ // Find the month number
+ $month = $this->month[strtolower($match[3])];
+
+ // Numeric timezone
+ if ($match[8] !== '')
+ {
+ $timezone = $match[9] * 3600;
+ $timezone += $match[10] * 60;
+ if ($match[8] === '-')
+ {
+ $timezone = 0 - $timezone;
+ }
+ }
+ // Character timezone
+ elseif (isset($this->timezone[strtoupper($match[11])]))
+ {
+ $timezone = $this->timezone[strtoupper($match[11])];
+ }
+ // Assume everything else to be -0000
+ else
+ {
+ $timezone = 0;
+ }
+
+ // Deal with 2/3 digit years
+ if ($match[4] < 50)
+ {
+ $match[4] += 2000;
+ }
+ elseif ($match[4] < 1000)
+ {
+ $match[4] += 1900;
+ }
+
+ // Second is optional, if it is empty set it to zero
+ if ($match[7] !== '')
+ {
+ $second = $match[7];
+ }
+ else
+ {
+ $second = 0;
+ }
+
+ return gmmktime($match[5], $match[6], $second, $month, $match[2], $match[4]) - $timezone;
+ }
+
+ return false;
+ }
+
+ /**
+ * Parse RFC850's date format
+ *
+ * @access protected
+ * @return int Timestamp
+ */
+ public function date_rfc850($date)
+ {
+ static $pcre;
+ if (!$pcre)
+ {
+ $space = '[\x09\x20]+';
+ $day_name = $this->day_pcre;
+ $month = $this->month_pcre;
+ $day = '([0-9]{1,2})';
+ $year = $hour = $minute = $second = '([0-9]{2})';
+ $zone = '([A-Z]{1,5})';
+ $pcre = '/^' . $day_name . ',' . $space . $day . '-' . $month . '-' . $year . $space . $hour . ':' . $minute . ':' . $second . $space . $zone . '$/i';
+ }
+ if (preg_match($pcre, $date, $match))
+ {
+ /*
+ Capturing subpatterns:
+ 1: Day name
+ 2: Day
+ 3: Month
+ 4: Year
+ 5: Hour
+ 6: Minute
+ 7: Second
+ 8: Timezone
+ */
+
+ // Month
+ $month = $this->month[strtolower($match[3])];
+
+ // Character timezone
+ if (isset($this->timezone[strtoupper($match[8])]))
+ {
+ $timezone = $this->timezone[strtoupper($match[8])];
+ }
+ // Assume everything else to be -0000
+ else
+ {
+ $timezone = 0;
+ }
+
+ // Deal with 2 digit year
+ if ($match[4] < 50)
+ {
+ $match[4] += 2000;
+ }
+ else
+ {
+ $match[4] += 1900;
+ }
+
+ return gmmktime($match[5], $match[6], $match[7], $month, $match[2], $match[4]) - $timezone;
+ }
+
+ return false;
+ }
+
+ /**
+ * Parse C99's asctime()'s date format
+ *
+ * @access protected
+ * @return int Timestamp
+ */
+ public function date_asctime($date)
+ {
+ static $pcre;
+ if (!$pcre)
+ {
+ $space = '[\x09\x20]+';
+ $wday_name = $this->day_pcre;
+ $mon_name = $this->month_pcre;
+ $day = '([0-9]{1,2})';
+ $hour = $sec = $min = '([0-9]{2})';
+ $year = '([0-9]{4})';
+ $terminator = '\x0A?\x00?';
+ $pcre = '/^' . $wday_name . $space . $mon_name . $space . $day . $space . $hour . ':' . $min . ':' . $sec . $space . $year . $terminator . '$/i';
+ }
+ if (preg_match($pcre, $date, $match))
+ {
+ /*
+ Capturing subpatterns:
+ 1: Day name
+ 2: Month
+ 3: Day
+ 4: Hour
+ 5: Minute
+ 6: Second
+ 7: Year
+ */
+
+ $month = $this->month[strtolower($match[2])];
+ return gmmktime($match[4], $match[5], $match[6], $month, $match[3], $match[7]);
+ }
+
+ return false;
+ }
+
+ /**
+ * Parse dates using strtotime()
+ *
+ * @access protected
+ * @return int Timestamp
+ */
+ public function date_strtotime($date)
+ {
+ $strtotime = strtotime($date);
+ if ($strtotime === -1 || $strtotime === false)
+ {
+ return false;
+ }
+
+ return $strtotime;
+ }
+}
+
+class_alias('SimplePie_Parse_Date', 'SimplePie\Parse\Date', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Parser.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Parser.php
new file mode 100644
index 0000000000..65f32d72a3
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Parser.php
@@ -0,0 +1,681 @@
+registry = $registry;
+ }
+
+ public function parse(&$data, $encoding, $url = '')
+ {
+ if (class_exists('DOMXpath') && function_exists('Mf2\parse')) {
+ $doc = new DOMDocument();
+ @$doc->loadHTML($data);
+ $xpath = new DOMXpath($doc);
+ // Check for both h-feed and h-entry, as both a feed with no entries
+ // and a list of entries without an h-feed wrapper are both valid.
+ $query = '//*[contains(concat(" ", @class, " "), " h-feed ") or '.
+ 'contains(concat(" ", @class, " "), " h-entry ")]';
+ $result = $xpath->query($query);
+ if ($result->length !== 0) {
+ return $this->parse_microformats($data, $url);
+ }
+ }
+
+ // Use UTF-8 if we get passed US-ASCII, as every US-ASCII character is a UTF-8 character
+ if (strtoupper($encoding) === 'US-ASCII')
+ {
+ $this->encoding = 'UTF-8';
+ }
+ else
+ {
+ $this->encoding = $encoding;
+ }
+
+ // Strip BOM:
+ // UTF-32 Big Endian BOM
+ if (substr($data, 0, 4) === "\x00\x00\xFE\xFF")
+ {
+ $data = substr($data, 4);
+ }
+ // UTF-32 Little Endian BOM
+ elseif (substr($data, 0, 4) === "\xFF\xFE\x00\x00")
+ {
+ $data = substr($data, 4);
+ }
+ // UTF-16 Big Endian BOM
+ elseif (substr($data, 0, 2) === "\xFE\xFF")
+ {
+ $data = substr($data, 2);
+ }
+ // UTF-16 Little Endian BOM
+ elseif (substr($data, 0, 2) === "\xFF\xFE")
+ {
+ $data = substr($data, 2);
+ }
+ // UTF-8 BOM
+ elseif (substr($data, 0, 3) === "\xEF\xBB\xBF")
+ {
+ $data = substr($data, 3);
+ }
+
+ if (substr($data, 0, 5) === '')) !== false)
+ {
+ $declaration = $this->registry->create('XML_Declaration_Parser', array(substr($data, 5, $pos - 5)));
+ if ($declaration->parse())
+ {
+ $data = substr($data, $pos + 2);
+ $data = 'version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' ."\n". $this->declare_html_entities() . $data;
+ }
+ else
+ {
+ $this->error_string = 'SimplePie bug! Please report this!';
+ return false;
+ }
+ }
+
+ $return = true;
+
+ static $xml_is_sane = null;
+ if ($xml_is_sane === null)
+ {
+ $parser_check = xml_parser_create();
+ xml_parse_into_struct($parser_check, '& ', $values);
+ xml_parser_free($parser_check);
+ $xml_is_sane = isset($values[0]['value']);
+ }
+
+ // Create the parser
+ if ($xml_is_sane)
+ {
+ $xml = xml_parser_create_ns($this->encoding, $this->separator);
+ xml_parser_set_option($xml, XML_OPTION_SKIP_WHITE, 1);
+ xml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, 0);
+ xml_set_object($xml, $this);
+ xml_set_character_data_handler($xml, 'cdata');
+ xml_set_element_handler($xml, 'tag_open', 'tag_close');
+
+ // Parse!
+ $wrapper = @is_writable(sys_get_temp_dir()) ? 'php://temp' : 'php://memory';
+ if (($stream = fopen($wrapper, 'r+')) &&
+ fwrite($stream, $data) &&
+ rewind($stream))
+ {
+ //Parse by chunks not to use too much memory
+ do
+ {
+ $stream_data = fread($stream, 1048576);
+ if (!xml_parse($xml, $stream_data === false ? '' : $stream_data, feof($stream)))
+ {
+ $this->error_code = xml_get_error_code($xml);
+ $this->error_string = xml_error_string($this->error_code);
+ $return = false;
+ break;
+ }
+ } while (!feof($stream));
+ fclose($stream);
+ }
+ else
+ {
+ $return = false;
+ }
+
+ $this->current_line = xml_get_current_line_number($xml);
+ $this->current_column = xml_get_current_column_number($xml);
+ $this->current_byte = xml_get_current_byte_index($xml);
+ xml_parser_free($xml);
+ return $return;
+ }
+
+ libxml_clear_errors();
+ $xml = new XMLReader();
+ $xml->xml($data);
+ while (@$xml->read())
+ {
+ switch ($xml->nodeType)
+ {
+
+ case constant('XMLReader::END_ELEMENT'):
+ if ($xml->namespaceURI !== '')
+ {
+ $tagName = $xml->namespaceURI . $this->separator . $xml->localName;
+ }
+ else
+ {
+ $tagName = $xml->localName;
+ }
+ $this->tag_close(null, $tagName);
+ break;
+ case constant('XMLReader::ELEMENT'):
+ $empty = $xml->isEmptyElement;
+ if ($xml->namespaceURI !== '')
+ {
+ $tagName = $xml->namespaceURI . $this->separator . $xml->localName;
+ }
+ else
+ {
+ $tagName = $xml->localName;
+ }
+ $attributes = array();
+ while ($xml->moveToNextAttribute())
+ {
+ if ($xml->namespaceURI !== '')
+ {
+ $attrName = $xml->namespaceURI . $this->separator . $xml->localName;
+ }
+ else
+ {
+ $attrName = $xml->localName;
+ }
+ $attributes[$attrName] = $xml->value;
+ }
+ $this->tag_open(null, $tagName, $attributes);
+ if ($empty)
+ {
+ $this->tag_close(null, $tagName);
+ }
+ break;
+ case constant('XMLReader::TEXT'):
+
+ case constant('XMLReader::CDATA'):
+ $this->cdata(null, $xml->value);
+ break;
+ }
+ }
+ if ($error = libxml_get_last_error())
+ {
+ $this->error_code = $error->code;
+ $this->error_string = $error->message;
+ $this->current_line = $error->line;
+ $this->current_column = $error->column;
+ return false;
+ }
+
+ return true;
+ }
+
+ public function get_error_code()
+ {
+ return $this->error_code;
+ }
+
+ public function get_error_string()
+ {
+ return $this->error_string;
+ }
+
+ public function get_current_line()
+ {
+ return $this->current_line;
+ }
+
+ public function get_current_column()
+ {
+ return $this->current_column;
+ }
+
+ public function get_current_byte()
+ {
+ return $this->current_byte;
+ }
+
+ public function get_data()
+ {
+ return $this->data;
+ }
+
+ public function tag_open($parser, $tag, $attributes)
+ {
+ list($this->namespace[], $this->element[]) = $this->split_ns($tag);
+
+ $attribs = array();
+ foreach ($attributes as $name => $value)
+ {
+ list($attrib_namespace, $attribute) = $this->split_ns($name);
+ $attribs[$attrib_namespace][$attribute] = $value;
+ }
+
+ if (isset($attribs[SIMPLEPIE_NAMESPACE_XML]['base']))
+ {
+ $base = $this->registry->call('Misc', 'absolutize_url', array($attribs[SIMPLEPIE_NAMESPACE_XML]['base'], end($this->xml_base)));
+ if ($base !== false)
+ {
+ $this->xml_base[] = $base;
+ $this->xml_base_explicit[] = true;
+ }
+ }
+ else
+ {
+ $this->xml_base[] = end($this->xml_base);
+ $this->xml_base_explicit[] = end($this->xml_base_explicit);
+ }
+
+ if (isset($attribs[SIMPLEPIE_NAMESPACE_XML]['lang']))
+ {
+ $this->xml_lang[] = $attribs[SIMPLEPIE_NAMESPACE_XML]['lang'];
+ }
+ else
+ {
+ $this->xml_lang[] = end($this->xml_lang);
+ }
+
+ if ($this->current_xhtml_construct >= 0)
+ {
+ $this->current_xhtml_construct++;
+ if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML)
+ {
+ $this->data['data'] .= '<' . end($this->element);
+ if (isset($attribs['']))
+ {
+ foreach ($attribs[''] as $name => $value)
+ {
+ $this->data['data'] .= ' ' . $name . '="' . htmlspecialchars($value, ENT_COMPAT, $this->encoding) . '"';
+ }
+ }
+ $this->data['data'] .= '>';
+ }
+ }
+ else
+ {
+ $this->datas[] =& $this->data;
+ $this->data =& $this->data['child'][end($this->namespace)][end($this->element)][];
+ $this->data = array('data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang));
+ if ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml')
+ || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml')
+ || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_20 && in_array(end($this->element), array('title')))
+ || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_090 && in_array(end($this->element), array('title')))
+ || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_10 && in_array(end($this->element), array('title'))))
+ {
+ $this->current_xhtml_construct = 0;
+ }
+ }
+ }
+
+ public function cdata($parser, $cdata)
+ {
+ if ($this->current_xhtml_construct >= 0)
+ {
+ $this->data['data'] .= htmlspecialchars($cdata, ENT_QUOTES, $this->encoding);
+ }
+ else
+ {
+ $this->data['data'] .= $cdata;
+ }
+ }
+
+ public function tag_close($parser, $tag)
+ {
+ if ($this->current_xhtml_construct >= 0)
+ {
+ $this->current_xhtml_construct--;
+ if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param')))
+ {
+ $this->data['data'] .= '' . end($this->element) . '>';
+ }
+ }
+ if ($this->current_xhtml_construct === -1)
+ {
+ $this->data =& $this->datas[count($this->datas) - 1];
+ array_pop($this->datas);
+ }
+
+ array_pop($this->element);
+ array_pop($this->namespace);
+ array_pop($this->xml_base);
+ array_pop($this->xml_base_explicit);
+ array_pop($this->xml_lang);
+ }
+
+ public function split_ns($string)
+ {
+ static $cache = array();
+ if (!isset($cache[$string]))
+ {
+ if ($pos = strpos($string, $this->separator))
+ {
+ static $separator_length;
+ if (!$separator_length)
+ {
+ $separator_length = strlen($this->separator);
+ }
+ $namespace = substr($string, 0, $pos);
+ $local_name = substr($string, $pos + $separator_length);
+ if (strtolower($namespace) === SIMPLEPIE_NAMESPACE_ITUNES)
+ {
+ $namespace = SIMPLEPIE_NAMESPACE_ITUNES;
+ }
+
+ // Normalize the Media RSS namespaces
+ if ($namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG ||
+ $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG2 ||
+ $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG3 ||
+ $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG4 ||
+ $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG5 )
+ {
+ $namespace = SIMPLEPIE_NAMESPACE_MEDIARSS;
+ }
+ $cache[$string] = array($namespace, $local_name);
+ }
+ else
+ {
+ $cache[$string] = array('', $string);
+ }
+ }
+ return $cache[$string];
+ }
+
+ private function parse_hcard($data, $category = false) {
+ $name = '';
+ $link = '';
+ // Check if h-card is set and pass that information on in the link.
+ if (isset($data['type']) && in_array('h-card', $data['type'])) {
+ if (isset($data['properties']['name'][0])) {
+ $name = $data['properties']['name'][0];
+ }
+ if (isset($data['properties']['url'][0])) {
+ $link = $data['properties']['url'][0];
+ if ($name === '') {
+ $name = $link;
+ }
+ else {
+ // can't have commas in categories.
+ $name = str_replace(',', '', $name);
+ }
+ $person_tag = $category ? ' ' : '';
+ return ''.$person_tag.$name.' ';
+ }
+ }
+ return isset($data['value']) ? $data['value'] : '';
+ }
+
+ private function parse_microformats(&$data, $url) {
+ $feed_title = '';
+ $feed_author = NULL;
+ $author_cache = array();
+ $items = array();
+ $entries = array();
+ $mf = Mf2\parse($data, $url);
+ // First look for an h-feed.
+ $h_feed = array();
+ foreach ($mf['items'] as $mf_item) {
+ if (in_array('h-feed', $mf_item['type'])) {
+ $h_feed = $mf_item;
+ break;
+ }
+ // Also look for h-feed or h-entry in the children of each top level item.
+ if (!isset($mf_item['children'][0]['type'])) continue;
+ if (in_array('h-feed', $mf_item['children'][0]['type'])) {
+ $h_feed = $mf_item['children'][0];
+ // In this case the parent of the h-feed may be an h-card, so use it as
+ // the feed_author.
+ if (in_array('h-card', $mf_item['type'])) $feed_author = $mf_item;
+ break;
+ }
+ else if (in_array('h-entry', $mf_item['children'][0]['type'])) {
+ $entries = $mf_item['children'];
+ // In this case the parent of the h-entry list may be an h-card, so use
+ // it as the feed_author.
+ if (in_array('h-card', $mf_item['type'])) $feed_author = $mf_item;
+ break;
+ }
+ }
+ if (isset($h_feed['children'])) {
+ $entries = $h_feed['children'];
+ // Also set the feed title and store author from the h-feed if available.
+ if (isset($mf['items'][0]['properties']['name'][0])) {
+ $feed_title = $mf['items'][0]['properties']['name'][0];
+ }
+ if (isset($mf['items'][0]['properties']['author'][0])) {
+ $feed_author = $mf['items'][0]['properties']['author'][0];
+ }
+ }
+ else if (count($entries) === 0) {
+ $entries = $mf['items'];
+ }
+ for ($i = 0; $i < count($entries); $i++) {
+ $entry = $entries[$i];
+ if (in_array('h-entry', $entry['type'])) {
+ $item = array();
+ $title = '';
+ $description = '';
+ if (isset($entry['properties']['url'][0])) {
+ $link = $entry['properties']['url'][0];
+ if (isset($link['value'])) $link = $link['value'];
+ $item['link'] = array(array('data' => $link));
+ }
+ if (isset($entry['properties']['uid'][0])) {
+ $guid = $entry['properties']['uid'][0];
+ if (isset($guid['value'])) $guid = $guid['value'];
+ $item['guid'] = array(array('data' => $guid));
+ }
+ if (isset($entry['properties']['name'][0])) {
+ $title = $entry['properties']['name'][0];
+ if (isset($title['value'])) $title = $title['value'];
+ $item['title'] = array(array('data' => $title));
+ }
+ if (isset($entry['properties']['author'][0]) || isset($feed_author)) {
+ // author is a special case, it can be plain text or an h-card array.
+ // If it's plain text it can also be a url that should be followed to
+ // get the actual h-card.
+ $author = isset($entry['properties']['author'][0]) ?
+ $entry['properties']['author'][0] : $feed_author;
+ if (!is_string($author)) {
+ $author = $this->parse_hcard($author);
+ }
+ else if (strpos($author, 'http') === 0) {
+ if (isset($author_cache[$author])) {
+ $author = $author_cache[$author];
+ }
+ else {
+ $mf = Mf2\fetch($author);
+ foreach ($mf['items'] as $hcard) {
+ // Only interested in an h-card by itself in this case.
+ if (!in_array('h-card', $hcard['type'])) {
+ continue;
+ }
+ // It must have a url property matching what we fetched.
+ if (!isset($hcard['properties']['url']) ||
+ !(in_array($author, $hcard['properties']['url']))) {
+ continue;
+ }
+ // Save parse_hcard the trouble of finding the correct url.
+ $hcard['properties']['url'][0] = $author;
+ // Cache this h-card for the next h-entry to check.
+ $author_cache[$author] = $this->parse_hcard($hcard);
+ $author = $author_cache[$author];
+ break;
+ }
+ }
+ }
+ $item['author'] = array(array('data' => $author));
+ }
+ if (isset($entry['properties']['photo'][0])) {
+ // If a photo is also in content, don't need to add it again here.
+ $content = '';
+ if (isset($entry['properties']['content'][0]['html'])) {
+ $content = $entry['properties']['content'][0]['html'];
+ }
+ $photo_list = array();
+ for ($j = 0; $j < count($entry['properties']['photo']); $j++) {
+ $photo = $entry['properties']['photo'][$j];
+ if (!empty($photo) && strpos($content, $photo) === false) {
+ $photo_list[] = $photo;
+ }
+ }
+ // When there's more than one photo show the first and use a lightbox.
+ // Need a permanent, unique name for the image set, but don't have
+ // anything unique except for the content itself, so use that.
+ $count = count($photo_list);
+ if ($count > 1) {
+ $image_set_id = preg_replace('/[[:^alnum:]]/', '', $photo_list[0]);
+ $description = '';
+ for ($j = 0; $j < $count; $j++) {
+ $hidden = $j === 0 ? '' : 'class="hidden" ';
+ $description .= ''.
+ ' ';
+ }
+ $description .= ''.$count.' photos
';
+ }
+ else if ($count == 1) {
+ $description = '
';
+ }
+ }
+ if (isset($entry['properties']['content'][0]['html'])) {
+ // e-content['value'] is the same as p-name when they are on the same
+ // element. Use this to replace title with a strip_tags version so
+ // that alt text from images is not included in the title.
+ if ($entry['properties']['content'][0]['value'] === $title) {
+ $title = strip_tags($entry['properties']['content'][0]['html']);
+ $item['title'] = array(array('data' => $title));
+ }
+ $description .= $entry['properties']['content'][0]['html'];
+ if (isset($entry['properties']['in-reply-to'][0])) {
+ $in_reply_to = '';
+ if (is_string($entry['properties']['in-reply-to'][0])) {
+ $in_reply_to = $entry['properties']['in-reply-to'][0];
+ }
+ else if (isset($entry['properties']['in-reply-to'][0]['value'])) {
+ $in_reply_to = $entry['properties']['in-reply-to'][0]['value'];
+ }
+ if ($in_reply_to !== '') {
+ $description .= ' '.
+ ''.$in_reply_to.'
';
+ }
+ }
+ $item['description'] = array(array('data' => $description));
+ }
+ if (isset($entry['properties']['category'])) {
+ $category_csv = '';
+ // Categories can also contain h-cards.
+ foreach ($entry['properties']['category'] as $category) {
+ if ($category_csv !== '') $category_csv .= ', ';
+ if (is_string($category)) {
+ // Can't have commas in categories.
+ $category_csv .= str_replace(',', '', $category);
+ }
+ else {
+ $category_csv .= $this->parse_hcard($category, true);
+ }
+ }
+ $item['category'] = array(array('data' => $category_csv));
+ }
+ if (isset($entry['properties']['published'][0])) {
+ $timestamp = strtotime($entry['properties']['published'][0]);
+ $pub_date = date('F j Y g:ia', $timestamp).' GMT';
+ $item['pubDate'] = array(array('data' => $pub_date));
+ }
+ // The title and description are set to the empty string to represent
+ // a deleted item (which also makes it an invalid rss item).
+ if (isset($entry['properties']['deleted'][0])) {
+ $item['title'] = array(array('data' => ''));
+ $item['description'] = array(array('data' => ''));
+ }
+ $items[] = array('child' => array('' => $item));
+ }
+ }
+ // Mimic RSS data format when storing microformats.
+ $link = array(array('data' => $url));
+ $image = '';
+ if (!is_string($feed_author) &&
+ isset($feed_author['properties']['photo'][0])) {
+ $image = array(array('child' => array('' => array('url' =>
+ array(array('data' => $feed_author['properties']['photo'][0]))))));
+ }
+ // Use the name given for the h-feed, or get the title from the html.
+ if ($feed_title !== '') {
+ $feed_title = array(array('data' => htmlspecialchars($feed_title)));
+ }
+ else if ($position = strpos($data, '
')) {
+ $start = $position < 200 ? 0 : $position - 200;
+ $check = substr($data, $start, 400);
+ $matches = array();
+ if (preg_match('/(.+)<\/title>/', $check, $matches)) {
+ $feed_title = array(array('data' => htmlspecialchars($matches[1])));
+ }
+ }
+ $channel = array('channel' => array(array('child' => array('' =>
+ array('link' => $link, 'image' => $image, 'title' => $feed_title,
+ 'item' => $items)))));
+ $rss = array(array('attribs' => array('' => array('version' => '2.0')),
+ 'child' => array('' => $channel)));
+ $this->data = array('child' => array('' => array('rss' => $rss)));
+ return true;
+ }
+
+ private function declare_html_entities() {
+ // This is required because the RSS specification says that entity-encoded
+ // html is allowed, but the xml specification says they must be declared.
+ return ' ]>';
+ }
+}
+
+class_alias('SimplePie_Parser', 'SimplePie\Parser', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Rating.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Rating.php
new file mode 100644
index 0000000000..eae6718a75
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Rating.php
@@ -0,0 +1,126 @@
+` or `` tags as defined in Media RSS and iTunes RSS respectively
+ *
+ * Used by {@see SimplePie_Enclosure::get_rating()} and {@see SimplePie_Enclosure::get_ratings()}
+ *
+ * This class can be overloaded with {@see SimplePie::set_rating_class()}
+ *
+ * @package SimplePie
+ * @subpackage API
+ */
+class SimplePie_Rating
+{
+ /**
+ * Rating scheme
+ *
+ * @var string
+ * @see get_scheme()
+ */
+ var $scheme;
+
+ /**
+ * Rating value
+ *
+ * @var string
+ * @see get_value()
+ */
+ var $value;
+
+ /**
+ * Constructor, used to input the data
+ *
+ * For documentation on all the parameters, see the corresponding
+ * properties and their accessors
+ */
+ public function __construct($scheme = null, $value = null)
+ {
+ $this->scheme = $scheme;
+ $this->value = $value;
+ }
+
+ /**
+ * String-ified version
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ // There is no $this->data here
+ return md5(serialize($this));
+ }
+
+ /**
+ * Get the organizational scheme for the rating
+ *
+ * @return string|null
+ */
+ public function get_scheme()
+ {
+ if ($this->scheme !== null)
+ {
+ return $this->scheme;
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the value of the rating
+ *
+ * @return string|null
+ */
+ public function get_value()
+ {
+ if ($this->value !== null)
+ {
+ return $this->value;
+ }
+
+ return null;
+ }
+}
+
+class_alias('SimplePie_Rating', 'SimplePie\Rating', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Registry.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Registry.php
new file mode 100755
index 0000000000..2486f3c69d
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Registry.php
@@ -0,0 +1,227 @@
+ 'SimplePie_Cache',
+ 'Locator' => 'SimplePie_Locator',
+ 'Parser' => 'SimplePie_Parser',
+ 'File' => 'SimplePie_File',
+ 'Sanitize' => 'SimplePie_Sanitize',
+ 'Item' => 'SimplePie_Item',
+ 'Author' => 'SimplePie_Author',
+ 'Category' => 'SimplePie_Category',
+ 'Enclosure' => 'SimplePie_Enclosure',
+ 'Caption' => 'SimplePie_Caption',
+ 'Copyright' => 'SimplePie_Copyright',
+ 'Credit' => 'SimplePie_Credit',
+ 'Rating' => 'SimplePie_Rating',
+ 'Restriction' => 'SimplePie_Restriction',
+ 'Content_Type_Sniffer' => 'SimplePie_Content_Type_Sniffer',
+ 'Source' => 'SimplePie_Source',
+ 'Misc' => 'SimplePie_Misc',
+ 'XML_Declaration_Parser' => 'SimplePie_XML_Declaration_Parser',
+ 'Parse_Date' => 'SimplePie_Parse_Date',
+ );
+
+ /**
+ * Class mapping
+ *
+ * @see register()
+ * @var array
+ */
+ protected $classes = array();
+
+ /**
+ * Legacy classes
+ *
+ * @see register()
+ * @var array
+ */
+ protected $legacy = array();
+
+ /**
+ * Constructor
+ *
+ * No-op
+ */
+ public function __construct() { }
+
+ /**
+ * Register a class
+ *
+ * @param string $type See {@see $default} for names
+ * @param string $class Class name, must subclass the corresponding default
+ * @param bool $legacy Whether to enable legacy support for this class
+ * @return bool Successfulness
+ */
+ public function register($type, $class, $legacy = false)
+ {
+ if (!@is_subclass_of($class, $this->default[$type]))
+ {
+ return false;
+ }
+
+ $this->classes[$type] = $class;
+
+ if ($legacy)
+ {
+ $this->legacy[] = $class;
+ }
+
+ return true;
+ }
+
+ /**
+ * Get the class registered for a type
+ *
+ * Where possible, use {@see create()} or {@see call()} instead
+ *
+ * @param string $type
+ * @return string|null
+ */
+ public function get_class($type)
+ {
+ if (!empty($this->classes[$type]))
+ {
+ return $this->classes[$type];
+ }
+ if (!empty($this->default[$type]))
+ {
+ return $this->default[$type];
+ }
+
+ return null;
+ }
+
+ /**
+ * Create a new instance of a given type
+ *
+ * @param string $type
+ * @param array $parameters Parameters to pass to the constructor
+ * @return object Instance of class
+ */
+ public function &create($type, $parameters = array())
+ {
+ $class = $this->get_class($type);
+
+ if (in_array($class, $this->legacy))
+ {
+ switch ($type)
+ {
+ case 'locator':
+ // Legacy: file, timeout, useragent, file_class, max_checked_feeds, content_type_sniffer_class
+ // Specified: file, timeout, useragent, max_checked_feeds
+ $replacement = array($this->get_class('file'), $parameters[3], $this->get_class('content_type_sniffer'));
+ array_splice($parameters, 3, 1, $replacement);
+ break;
+ }
+ }
+
+ if (!method_exists($class, '__construct'))
+ {
+ $instance = new $class;
+ }
+ else
+ {
+ $reflector = new ReflectionClass($class);
+ $instance = $reflector->newInstanceArgs($parameters);
+ }
+
+ if (method_exists($instance, 'set_registry'))
+ {
+ $instance->set_registry($this);
+ }
+ return $instance;
+ }
+
+ /**
+ * Call a static method for a type
+ *
+ * @param string $type
+ * @param string $method
+ * @param array $parameters
+ * @return mixed
+ */
+ public function &call($type, $method, $parameters = array())
+ {
+ $class = $this->get_class($type);
+
+ if (in_array($class, $this->legacy))
+ {
+ switch ($type)
+ {
+ case 'Cache':
+ // For backwards compatibility with old non-static
+ // Cache::create() methods in PHP < 8.0.
+ // No longer supported as of PHP 8.0.
+ if ($method === 'get_handler')
+ {
+ $result = @call_user_func_array(array($class, 'create'), $parameters);
+ return $result;
+ }
+ break;
+ }
+ }
+
+ $result = call_user_func_array(array($class, $method), $parameters);
+ return $result;
+ }
+}
+
+class_alias('SimplePie_Registry', 'SimplePie\Registry', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Restriction.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Restriction.php
new file mode 100644
index 0000000000..0a168bbbe7
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Restriction.php
@@ -0,0 +1,150 @@
+` as defined in Media RSS
+ *
+ * Used by {@see SimplePie_Enclosure::get_restriction()} and {@see SimplePie_Enclosure::get_restrictions()}
+ *
+ * This class can be overloaded with {@see SimplePie::set_restriction_class()}
+ *
+ * @package SimplePie
+ * @subpackage API
+ */
+class SimplePie_Restriction
+{
+ /**
+ * Relationship ('allow'/'deny')
+ *
+ * @var string
+ * @see get_relationship()
+ */
+ var $relationship;
+
+ /**
+ * Type of restriction
+ *
+ * @var string
+ * @see get_type()
+ */
+ var $type;
+
+ /**
+ * Restricted values
+ *
+ * @var string
+ * @see get_value()
+ */
+ var $value;
+
+ /**
+ * Constructor, used to input the data
+ *
+ * For documentation on all the parameters, see the corresponding
+ * properties and their accessors
+ */
+ public function __construct($relationship = null, $type = null, $value = null)
+ {
+ $this->relationship = $relationship;
+ $this->type = $type;
+ $this->value = $value;
+ }
+
+ /**
+ * String-ified version
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ // There is no $this->data here
+ return md5(serialize($this));
+ }
+
+ /**
+ * Get the relationship
+ *
+ * @return string|null Either 'allow' or 'deny'
+ */
+ public function get_relationship()
+ {
+ if ($this->relationship !== null)
+ {
+ return $this->relationship;
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the type
+ *
+ * @return string|null
+ */
+ public function get_type()
+ {
+ if ($this->type !== null)
+ {
+ return $this->type;
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the list of restricted things
+ *
+ * @return string|null
+ */
+ public function get_value()
+ {
+ if ($this->value !== null)
+ {
+ return $this->value;
+ }
+
+ return null;
+ }
+}
+
+class_alias('SimplePie_Restriction', 'SimplePie\Restriction', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Sanitize.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Sanitize.php
new file mode 100644
index 0000000000..1f202ecc09
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Sanitize.php
@@ -0,0 +1,705 @@
+ array('preload' => 'none'), 'iframe' => array('sandbox' => 'allow-scripts allow-same-origin'), 'video' => array('preload' => 'none'));
+ var $strip_comments = false;
+ var $output_encoding = 'UTF-8';
+ var $enable_cache = true;
+ var $cache_location = './cache';
+ var $cache_name_function = 'md5';
+ var $timeout = 10;
+ var $useragent = '';
+ var $force_fsockopen = false;
+ var $replace_url_attributes = null;
+ var $registry;
+
+ /**
+ * List of domains for which to force HTTPS.
+ * @see SimplePie_Sanitize::set_https_domains()
+ * Array is a tree split at DNS levels. Example:
+ * array('biz' => true, 'com' => array('example' => true), 'net' => array('example' => array('www' => true)))
+ */
+ var $https_domains = array();
+
+ public function __construct()
+ {
+ // Set defaults
+ $this->set_url_replacements(null);
+ }
+
+ public function remove_div($enable = true)
+ {
+ $this->remove_div = (bool) $enable;
+ }
+
+ public function set_image_handler($page = false)
+ {
+ if ($page)
+ {
+ $this->image_handler = (string) $page;
+ }
+ else
+ {
+ $this->image_handler = false;
+ }
+ }
+
+ public function set_registry(SimplePie_Registry $registry)
+ {
+ $this->registry = $registry;
+ }
+
+ public function pass_cache_data($enable_cache = true, $cache_location = './cache', $cache_name_function = 'md5', $cache_class = 'SimplePie_Cache')
+ {
+ if (isset($enable_cache))
+ {
+ $this->enable_cache = (bool) $enable_cache;
+ }
+
+ if ($cache_location)
+ {
+ $this->cache_location = (string) $cache_location;
+ }
+
+ if ($cache_name_function)
+ {
+ $this->cache_name_function = (string) $cache_name_function;
+ }
+ }
+
+ public function pass_file_data($file_class = 'SimplePie_File', $timeout = 10, $useragent = '', $force_fsockopen = false)
+ {
+ if ($timeout)
+ {
+ $this->timeout = (string) $timeout;
+ }
+
+ if ($useragent)
+ {
+ $this->useragent = (string) $useragent;
+ }
+
+ if ($force_fsockopen)
+ {
+ $this->force_fsockopen = (string) $force_fsockopen;
+ }
+ }
+
+ public function strip_htmltags($tags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'))
+ {
+ if ($tags)
+ {
+ if (is_array($tags))
+ {
+ $this->strip_htmltags = $tags;
+ }
+ else
+ {
+ $this->strip_htmltags = explode(',', $tags);
+ }
+ }
+ else
+ {
+ $this->strip_htmltags = false;
+ }
+ }
+
+ public function encode_instead_of_strip($encode = false)
+ {
+ $this->encode_instead_of_strip = (bool) $encode;
+ }
+
+ public function rename_attributes($attribs = array())
+ {
+ if ($attribs)
+ {
+ if (is_array($attribs))
+ {
+ $this->rename_attributes = $attribs;
+ }
+ else
+ {
+ $this->rename_attributes = explode(',', $attribs);
+ }
+ }
+ else
+ {
+ $this->rename_attributes = false;
+ }
+ }
+
+ public function strip_attributes($attribs = array('bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc'))
+ {
+ if ($attribs)
+ {
+ if (is_array($attribs))
+ {
+ $this->strip_attributes = $attribs;
+ }
+ else
+ {
+ $this->strip_attributes = explode(',', $attribs);
+ }
+ }
+ else
+ {
+ $this->strip_attributes = false;
+ }
+ }
+
+ public function add_attributes($attribs = array('audio' => array('preload' => 'none'), 'iframe' => array('sandbox' => 'allow-scripts allow-same-origin'), 'video' => array('preload' => 'none')))
+ {
+ if ($attribs)
+ {
+ if (is_array($attribs))
+ {
+ $this->add_attributes = $attribs;
+ }
+ else
+ {
+ $this->add_attributes = explode(',', $attribs);
+ }
+ }
+ else
+ {
+ $this->add_attributes = false;
+ }
+ }
+
+ public function strip_comments($strip = false)
+ {
+ $this->strip_comments = (bool) $strip;
+ }
+
+ public function set_output_encoding($encoding = 'UTF-8')
+ {
+ $this->output_encoding = (string) $encoding;
+ }
+
+ /**
+ * Set element/attribute key/value pairs of HTML attributes
+ * containing URLs that need to be resolved relative to the feed
+ *
+ * Defaults to |a|@href, |area|@href, |audio|@src, |blockquote|@cite,
+ * |del|@cite, |form|@action, |img|@longdesc, |img|@src, |input|@src,
+ * |ins|@cite, |q|@cite, |source|@src, |video|@src
+ *
+ * @since 1.0
+ * @param array|null $element_attribute Element/attribute key/value pairs, null for default
+ */
+ public function set_url_replacements($element_attribute = null)
+ {
+ if ($element_attribute === null)
+ {
+ $element_attribute = array(
+ 'a' => 'href',
+ 'area' => 'href',
+ 'audio' => 'src',
+ 'blockquote' => 'cite',
+ 'del' => 'cite',
+ 'form' => 'action',
+ 'img' => array(
+ 'longdesc',
+ 'src'
+ ),
+ 'input' => 'src',
+ 'ins' => 'cite',
+ 'q' => 'cite',
+ 'source' => 'src',
+ 'video' => array(
+ 'poster',
+ 'src'
+ )
+ );
+ }
+ $this->replace_url_attributes = (array) $element_attribute;
+ }
+
+ /**
+ * Set the list of domains for which to force HTTPS.
+ * @see SimplePie_Misc::https_url()
+ * Example array('biz', 'example.com', 'example.org', 'www.example.net');
+ */
+ public function set_https_domains($domains)
+ {
+ $this->https_domains = array();
+ foreach ($domains as $domain)
+ {
+ $domain = trim($domain, ". \t\n\r\0\x0B");
+ $segments = array_reverse(explode('.', $domain));
+ $node =& $this->https_domains;
+ foreach ($segments as $segment)
+ {//Build a tree
+ if ($node === true)
+ {
+ break;
+ }
+ if (!isset($node[$segment]))
+ {
+ $node[$segment] = array();
+ }
+ $node =& $node[$segment];
+ }
+ $node = true;
+ }
+ }
+
+ /**
+ * Check if the domain is in the list of forced HTTPS.
+ */
+ protected function is_https_domain($domain)
+ {
+ $domain = trim($domain, '. ');
+ $segments = array_reverse(explode('.', $domain));
+ $node =& $this->https_domains;
+ foreach ($segments as $segment)
+ {//Explore the tree
+ if (isset($node[$segment]))
+ {
+ $node =& $node[$segment];
+ }
+ else
+ {
+ break;
+ }
+ }
+ return $node === true;
+ }
+
+ /**
+ * Force HTTPS for selected Web sites.
+ */
+ public function https_url($url)
+ {
+ return (strtolower(substr($url, 0, 7)) === 'http://') &&
+ $this->is_https_domain(parse_url($url, PHP_URL_HOST)) ?
+ substr_replace($url, 's', 4, 0) : //Add the 's' to HTTPS
+ $url;
+ }
+
+ public function sanitize($data, $type, $base = '')
+ {
+ $data = trim($data);
+ if ($data !== '' || $type & SIMPLEPIE_CONSTRUCT_IRI)
+ {
+ if ($type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML)
+ {
+ if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data))
+ {
+ $type |= SIMPLEPIE_CONSTRUCT_HTML;
+ }
+ else
+ {
+ $type |= SIMPLEPIE_CONSTRUCT_TEXT;
+ }
+ }
+
+ if ($type & SIMPLEPIE_CONSTRUCT_BASE64)
+ {
+ $data = base64_decode($data);
+ }
+
+ if ($type & (SIMPLEPIE_CONSTRUCT_HTML | SIMPLEPIE_CONSTRUCT_XHTML))
+ {
+
+ if (!class_exists('DOMDocument'))
+ {
+ throw new SimplePie_Exception('DOMDocument not found, unable to use sanitizer');
+ }
+ $document = new DOMDocument();
+ $document->encoding = 'UTF-8';
+
+ $data = $this->preprocess($data, $type);
+
+ set_error_handler(array('SimplePie_Misc', 'silence_errors'));
+ $document->loadHTML($data);
+ restore_error_handler();
+
+ $xpath = new DOMXPath($document);
+
+ // Strip comments
+ if ($this->strip_comments)
+ {
+ $comments = $xpath->query('//comment()');
+
+ foreach ($comments as $comment)
+ {
+ $comment->parentNode->removeChild($comment);
+ }
+ }
+
+ // Strip out HTML tags and attributes that might cause various security problems.
+ // Based on recommendations by Mark Pilgrim at:
+ // http://diveintomark.org/archives/2003/06/12/how_to_consume_rss_safely
+ if ($this->strip_htmltags)
+ {
+ foreach ($this->strip_htmltags as $tag)
+ {
+ $this->strip_tag($tag, $document, $xpath, $type);
+ }
+ }
+
+ if ($this->rename_attributes)
+ {
+ foreach ($this->rename_attributes as $attrib)
+ {
+ $this->rename_attr($attrib, $xpath);
+ }
+ }
+
+ if ($this->strip_attributes)
+ {
+ foreach ($this->strip_attributes as $attrib)
+ {
+ $this->strip_attr($attrib, $xpath);
+ }
+ }
+
+ if ($this->add_attributes)
+ {
+ foreach ($this->add_attributes as $tag => $valuePairs)
+ {
+ $this->add_attr($tag, $valuePairs, $document);
+ }
+ }
+
+ // Replace relative URLs
+ $this->base = $base;
+ foreach ($this->replace_url_attributes as $element => $attributes)
+ {
+ $this->replace_urls($document, $element, $attributes);
+ }
+
+ // If image handling (caching, etc.) is enabled, cache and rewrite all the image tags.
+ if (isset($this->image_handler) && ((string) $this->image_handler) !== '' && $this->enable_cache)
+ {
+ $images = $document->getElementsByTagName('img');
+ foreach ($images as $img)
+ {
+ if ($img->hasAttribute('src'))
+ {
+ $image_url = call_user_func($this->cache_name_function, $img->getAttribute('src'));
+ $cache = $this->registry->call('Cache', 'get_handler', array($this->cache_location, $image_url, 'spi'));
+
+ if ($cache->load())
+ {
+ $img->setAttribute('src', $this->image_handler . $image_url);
+ }
+ else
+ {
+ $file = $this->registry->create('File', array($img->getAttribute('src'), $this->timeout, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen));
+ $headers = $file->headers;
+
+ if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)))
+ {
+ if ($cache->save(array('headers' => $file->headers, 'body' => $file->body)))
+ {
+ $img->setAttribute('src', $this->image_handler . $image_url);
+ }
+ else
+ {
+ trigger_error("$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // Get content node
+ $div = $document->getElementsByTagName('body')->item(0)->firstChild;
+ // Finally, convert to a HTML string
+ $data = trim($document->saveHTML($div));
+
+ if ($this->remove_div)
+ {
+ $data = preg_replace('/^/', '', $data);
+ $data = preg_replace('/<\/div>$/', '', $data);
+ }
+ else
+ {
+ $data = preg_replace('/^
/', '
', $data);
+ }
+
+ $data = str_replace('', '', $data);
+ }
+
+ if ($type & SIMPLEPIE_CONSTRUCT_IRI)
+ {
+ $absolute = $this->registry->call('Misc', 'absolutize_url', array($data, $base));
+ if ($absolute !== false)
+ {
+ $data = $absolute;
+ }
+ }
+
+ if ($type & (SIMPLEPIE_CONSTRUCT_TEXT | SIMPLEPIE_CONSTRUCT_IRI))
+ {
+ $data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8');
+ }
+
+ if ($this->output_encoding !== 'UTF-8')
+ {
+ $data = $this->registry->call('Misc', 'change_encoding', array($data, 'UTF-8', $this->output_encoding));
+ }
+ }
+ return $data;
+ }
+
+ protected function preprocess($html, $type)
+ {
+ $ret = '';
+ $html = preg_replace('%?(?:html|body)[^>]*?'.'>%is', '', $html);
+ if ($type & ~SIMPLEPIE_CONSTRUCT_XHTML)
+ {
+ // Atom XHTML constructs are wrapped with a div by default
+ // Note: No protection if $html contains a stray
!
+ $html = '
' . $html . '
';
+ $ret .= '';
+ $content_type = 'text/html';
+ }
+ else
+ {
+ $ret .= '';
+ $content_type = 'application/xhtml+xml';
+ }
+
+ $ret .= '';
+ $ret .= '
';
+ $ret .= '' . $html . '';
+ return $ret;
+ }
+
+ public function replace_urls($document, $tag, $attributes)
+ {
+ if (!is_array($attributes))
+ {
+ $attributes = array($attributes);
+ }
+
+ if (!is_array($this->strip_htmltags) || !in_array($tag, $this->strip_htmltags))
+ {
+ $elements = $document->getElementsByTagName($tag);
+ foreach ($elements as $element)
+ {
+ foreach ($attributes as $attribute)
+ {
+ if ($element->hasAttribute($attribute))
+ {
+ $value = $this->registry->call('Misc', 'absolutize_url', array($element->getAttribute($attribute), $this->base));
+ if ($value !== false)
+ {
+ $value = $this->https_url($value);
+ $element->setAttribute($attribute, $value);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public function do_strip_htmltags($match)
+ {
+ if ($this->encode_instead_of_strip)
+ {
+ if (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style')))
+ {
+ $match[1] = htmlspecialchars($match[1], ENT_COMPAT, 'UTF-8');
+ $match[2] = htmlspecialchars($match[2], ENT_COMPAT, 'UTF-8');
+ return "<$match[1]$match[2]>$match[3]</$match[1]>";
+ }
+ else
+ {
+ return htmlspecialchars($match[0], ENT_COMPAT, 'UTF-8');
+ }
+ }
+ elseif (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style')))
+ {
+ return $match[4];
+ }
+ else
+ {
+ return '';
+ }
+ }
+
+ protected function strip_tag($tag, $document, $xpath, $type)
+ {
+ $elements = $xpath->query('body//' . $tag);
+ if ($this->encode_instead_of_strip)
+ {
+ foreach ($elements as $element)
+ {
+ $fragment = $document->createDocumentFragment();
+
+ // For elements which aren't script or style, include the tag itself
+ if (!in_array($tag, array('script', 'style')))
+ {
+ $text = '<' . $tag;
+ if ($element->hasAttributes())
+ {
+ $attrs = array();
+ foreach ($element->attributes as $name => $attr)
+ {
+ $value = $attr->value;
+
+ // In XHTML, empty values should never exist, so we repeat the value
+ if (empty($value) && ($type & SIMPLEPIE_CONSTRUCT_XHTML))
+ {
+ $value = $name;
+ }
+ // For HTML, empty is fine
+ elseif (empty($value) && ($type & SIMPLEPIE_CONSTRUCT_HTML))
+ {
+ $attrs[] = $name;
+ continue;
+ }
+
+ // Standard attribute text
+ $attrs[] = $name . '="' . $attr->value . '"';
+ }
+ $text .= ' ' . implode(' ', $attrs);
+ }
+ $text .= '>';
+ $fragment->appendChild(new DOMText($text));
+ }
+
+ $number = $element->childNodes->length;
+ for ($i = $number; $i > 0; $i--)
+ {
+ $child = $element->childNodes->item(0);
+ $fragment->appendChild($child);
+ }
+
+ if (!in_array($tag, array('script', 'style')))
+ {
+ $fragment->appendChild(new DOMText('' . $tag . '>'));
+ }
+
+ $element->parentNode->replaceChild($fragment, $element);
+ }
+
+ return;
+ }
+ elseif (in_array($tag, array('script', 'style')))
+ {
+ foreach ($elements as $element)
+ {
+ $element->parentNode->removeChild($element);
+ }
+
+ return;
+ }
+ else
+ {
+ foreach ($elements as $element)
+ {
+ $fragment = $document->createDocumentFragment();
+ $number = $element->childNodes->length;
+ for ($i = $number; $i > 0; $i--)
+ {
+ $child = $element->childNodes->item(0);
+ $fragment->appendChild($child);
+ }
+
+ $element->parentNode->replaceChild($fragment, $element);
+ }
+ }
+ }
+
+ protected function strip_attr($attrib, $xpath)
+ {
+ $elements = $xpath->query('//*[@' . $attrib . ']');
+
+ foreach ($elements as $element)
+ {
+ $element->removeAttribute($attrib);
+ }
+ }
+
+ protected function rename_attr($attrib, $xpath)
+ {
+ $elements = $xpath->query('//*[@' . $attrib . ']');
+
+ foreach ($elements as $element)
+ {
+ $element->setAttribute('data-sanitized-' . $attrib, $element->getAttribute($attrib));
+ $element->removeAttribute($attrib);
+ }
+ }
+
+ protected function add_attr($tag, $valuePairs, $document)
+ {
+ $elements = $document->getElementsByTagName($tag);
+ foreach ($elements as $element)
+ {
+ foreach ($valuePairs as $attrib => $value)
+ {
+ $element->setAttribute($attrib, $value);
+ }
+ }
+ }
+}
+
+class_alias('SimplePie_Sanitize', 'SimplePie\Sanitize', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Source.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Source.php
new file mode 100644
index 0000000000..9e7ddf04de
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/Source.php
@@ -0,0 +1,579 @@
+`
+ *
+ * Used by {@see SimplePie_Item::get_source()}
+ *
+ * This class can be overloaded with {@see SimplePie::set_source_class()}
+ *
+ * @package SimplePie
+ * @subpackage API
+ */
+class SimplePie_Source
+{
+ var $item;
+ var $data = array();
+ protected $registry;
+
+ public function __construct($item, $data)
+ {
+ $this->item = $item;
+ $this->data = $data;
+ }
+
+ public function set_registry(SimplePie_Registry $registry)
+ {
+ $this->registry = $registry;
+ }
+
+ public function __toString()
+ {
+ return md5(serialize($this->data));
+ }
+
+ public function get_source_tags($namespace, $tag)
+ {
+ if (isset($this->data['child'][$namespace][$tag]))
+ {
+ return $this->data['child'][$namespace][$tag];
+ }
+
+ return null;
+ }
+
+ public function get_base($element = array())
+ {
+ return $this->item->get_base($element);
+ }
+
+ public function sanitize($data, $type, $base = '')
+ {
+ return $this->item->sanitize($data, $type, $base);
+ }
+
+ public function get_item()
+ {
+ return $this->item;
+ }
+
+ public function get_title()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+
+ return null;
+ }
+
+ public function get_category($key = 0)
+ {
+ $categories = $this->get_categories();
+ if (isset($categories[$key]))
+ {
+ return $categories[$key];
+ }
+
+ return null;
+ }
+
+ public function get_categories()
+ {
+ $categories = array();
+
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category)
+ {
+ $term = null;
+ $scheme = null;
+ $label = null;
+ if (isset($category['attribs']['']['term']))
+ {
+ $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['scheme']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($category['attribs']['']['label']))
+ {
+ $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ $categories[] = $this->registry->create('Category', array($term, $scheme, $label));
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category)
+ {
+ // This is really the label, but keep this as the term also for BC.
+ // Label will also work on retrieving because that falls back to term.
+ $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ if (isset($category['attribs']['']['domain']))
+ {
+ $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ else
+ {
+ $scheme = null;
+ }
+ $categories[] = $this->registry->create('Category', array($term, $scheme, null));
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category)
+ {
+ $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category)
+ {
+ $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
+ }
+
+ if (!empty($categories))
+ {
+ return array_unique($categories);
+ }
+
+ return null;
+ }
+
+ public function get_author($key = 0)
+ {
+ $authors = $this->get_authors();
+ if (isset($authors[$key]))
+ {
+ return $authors[$key];
+ }
+
+ return null;
+ }
+
+ public function get_authors()
+ {
+ $authors = array();
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author)
+ {
+ $name = null;
+ $uri = null;
+ $email = null;
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
+ {
+ $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
+ {
+ $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
+ }
+ if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
+ {
+ $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $uri !== null)
+ {
+ $authors[] = $this->registry->create('Author', array($name, $uri, $email));
+ }
+ }
+ if ($author = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
+ {
+ $name = null;
+ $url = null;
+ $email = null;
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
+ {
+ $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
+ {
+ $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
+ }
+ if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
+ {
+ $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $url !== null)
+ {
+ $authors[] = $this->registry->create('Author', array($name, $url, $email));
+ }
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author)
+ {
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author)
+ {
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author)
+ {
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
+ }
+
+ if (!empty($authors))
+ {
+ return array_unique($authors);
+ }
+
+ return null;
+ }
+
+ public function get_contributor($key = 0)
+ {
+ $contributors = $this->get_contributors();
+ if (isset($contributors[$key]))
+ {
+ return $contributors[$key];
+ }
+
+ return null;
+ }
+
+ public function get_contributors()
+ {
+ $contributors = array();
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor)
+ {
+ $name = null;
+ $uri = null;
+ $email = null;
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']))
+ {
+ $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']))
+ {
+ $uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]));
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data']))
+ {
+ $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $uri !== null)
+ {
+ $contributors[] = $this->registry->create('Author', array($name, $uri, $email));
+ }
+ }
+ foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor)
+ {
+ $name = null;
+ $url = null;
+ $email = null;
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data']))
+ {
+ $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data']))
+ {
+ $url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]));
+ }
+ if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data']))
+ {
+ $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ if ($name !== null || $email !== null || $url !== null)
+ {
+ $contributors[] = $this->registry->create('Author', array($name, $url, $email));
+ }
+ }
+
+ if (!empty($contributors))
+ {
+ return array_unique($contributors);
+ }
+
+ return null;
+ }
+
+ public function get_link($key = 0, $rel = 'alternate')
+ {
+ $links = $this->get_links($rel);
+ if (isset($links[$key]))
+ {
+ return $links[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Added for parity between the parent-level and the item/entry-level.
+ */
+ public function get_permalink()
+ {
+ return $this->get_link(0);
+ }
+
+ public function get_links($rel = 'alternate')
+ {
+ if (!isset($this->data['links']))
+ {
+ $this->data['links'] = array();
+ if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link'))
+ {
+ foreach ($links as $link)
+ {
+ if (isset($link['attribs']['']['href']))
+ {
+ $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
+ $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
+ }
+ }
+ }
+ if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link'))
+ {
+ foreach ($links as $link)
+ {
+ if (isset($link['attribs']['']['href']))
+ {
+ $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate';
+ $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link));
+
+ }
+ }
+ }
+ if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link'))
+ {
+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
+ }
+ if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link'))
+ {
+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
+ }
+ if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link'))
+ {
+ $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0]));
+ }
+
+ $keys = array_keys($this->data['links']);
+ foreach ($keys as $key)
+ {
+ if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
+ {
+ if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
+ {
+ $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);
+ $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];
+ }
+ else
+ {
+ $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
+ }
+ }
+ elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
+ {
+ $this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
+ }
+ $this->data['links'][$key] = array_unique($this->data['links'][$key]);
+ }
+ }
+
+ if (isset($this->data['links'][$rel]))
+ {
+ return $this->data['links'][$rel];
+ }
+
+ return null;
+ }
+
+ public function get_description()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle'))
+ {
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'tagline'))
+ {
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0]));
+ }
+
+ return null;
+ }
+
+ public function get_copyright()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright'))
+ {
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+
+ return null;
+ }
+
+ public function get_language()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'language'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'language'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+ elseif (isset($this->data['xml_lang']))
+ {
+ return $this->sanitize($this->data['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT);
+ }
+
+ return null;
+ }
+
+ public function get_latitude()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat'))
+ {
+ return (float) $return[0]['data'];
+ }
+ elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
+ {
+ return (float) $match[1];
+ }
+
+ return null;
+ }
+
+ public function get_longitude()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long'))
+ {
+ return (float) $return[0]['data'];
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon'))
+ {
+ return (float) $return[0]['data'];
+ }
+ elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match))
+ {
+ return (float) $match[2];
+ }
+
+ return null;
+ }
+
+ public function get_image_url()
+ {
+ if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'image'))
+ {
+ return $this->sanitize($return[0]['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI);
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'logo'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
+ }
+ elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon'))
+ {
+ return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0]));
+ }
+
+ return null;
+ }
+}
+
+class_alias('SimplePie_Source', 'SimplePie\Source', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/XML/Declaration/Parser.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/XML/Declaration/Parser.php
new file mode 100644
index 0000000000..9ac0887046
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/XML/Declaration/Parser.php
@@ -0,0 +1,361 @@
+data = $data;
+ $this->data_length = strlen($this->data);
+ }
+
+ /**
+ * Parse the input data
+ *
+ * @access public
+ * @return bool true on success, false on failure
+ */
+ public function parse()
+ {
+ while ($this->state && $this->state !== 'emit' && $this->has_data())
+ {
+ $state = $this->state;
+ $this->$state();
+ }
+ $this->data = '';
+ if ($this->state === 'emit')
+ {
+ return true;
+ }
+
+ $this->version = '';
+ $this->encoding = '';
+ $this->standalone = '';
+ return false;
+ }
+
+ /**
+ * Check whether there is data beyond the pointer
+ *
+ * @access private
+ * @return bool true if there is further data, false if not
+ */
+ public function has_data()
+ {
+ return (bool) ($this->position < $this->data_length);
+ }
+
+ /**
+ * Advance past any whitespace
+ *
+ * @return int Number of whitespace characters passed
+ */
+ public function skip_whitespace()
+ {
+ $whitespace = strspn($this->data, "\x09\x0A\x0D\x20", $this->position);
+ $this->position += $whitespace;
+ return $whitespace;
+ }
+
+ /**
+ * Read value
+ */
+ public function get_value()
+ {
+ $quote = substr($this->data, $this->position, 1);
+ if ($quote === '"' || $quote === "'")
+ {
+ $this->position++;
+ $len = strcspn($this->data, $quote, $this->position);
+ if ($this->has_data())
+ {
+ $value = substr($this->data, $this->position, $len);
+ $this->position += $len + 1;
+ return $value;
+ }
+ }
+ return false;
+ }
+
+ public function before_version_name()
+ {
+ if ($this->skip_whitespace())
+ {
+ $this->state = 'version_name';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ public function version_name()
+ {
+ if (substr($this->data, $this->position, 7) === 'version')
+ {
+ $this->position += 7;
+ $this->skip_whitespace();
+ $this->state = 'version_equals';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ public function version_equals()
+ {
+ if (substr($this->data, $this->position, 1) === '=')
+ {
+ $this->position++;
+ $this->skip_whitespace();
+ $this->state = 'version_value';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ public function version_value()
+ {
+ if ($this->version = $this->get_value())
+ {
+ $this->skip_whitespace();
+ if ($this->has_data())
+ {
+ $this->state = 'encoding_name';
+ }
+ else
+ {
+ $this->state = 'emit';
+ }
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ public function encoding_name()
+ {
+ if (substr($this->data, $this->position, 8) === 'encoding')
+ {
+ $this->position += 8;
+ $this->skip_whitespace();
+ $this->state = 'encoding_equals';
+ }
+ else
+ {
+ $this->state = 'standalone_name';
+ }
+ }
+
+ public function encoding_equals()
+ {
+ if (substr($this->data, $this->position, 1) === '=')
+ {
+ $this->position++;
+ $this->skip_whitespace();
+ $this->state = 'encoding_value';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ public function encoding_value()
+ {
+ if ($this->encoding = $this->get_value())
+ {
+ $this->skip_whitespace();
+ if ($this->has_data())
+ {
+ $this->state = 'standalone_name';
+ }
+ else
+ {
+ $this->state = 'emit';
+ }
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ public function standalone_name()
+ {
+ if (substr($this->data, $this->position, 10) === 'standalone')
+ {
+ $this->position += 10;
+ $this->skip_whitespace();
+ $this->state = 'standalone_equals';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ public function standalone_equals()
+ {
+ if (substr($this->data, $this->position, 1) === '=')
+ {
+ $this->position++;
+ $this->skip_whitespace();
+ $this->state = 'standalone_value';
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+
+ public function standalone_value()
+ {
+ if ($standalone = $this->get_value())
+ {
+ switch ($standalone)
+ {
+ case 'yes':
+ $this->standalone = true;
+ break;
+
+ case 'no':
+ $this->standalone = false;
+ break;
+
+ default:
+ $this->state = false;
+ return;
+ }
+
+ $this->skip_whitespace();
+ if ($this->has_data())
+ {
+ $this->state = false;
+ }
+ else
+ {
+ $this->state = 'emit';
+ }
+ }
+ else
+ {
+ $this->state = false;
+ }
+ }
+}
+
+class_alias('SimplePie_XML_Declaration_Parser', 'SimplePie\XML\Declaration\Parser', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/gzdecode.php b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/gzdecode.php
new file mode 100644
index 0000000000..030a230d0e
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/library/SimplePie/gzdecode.php
@@ -0,0 +1,368 @@
+compressed_data = $data;
+ $this->compressed_size = strlen($data);
+ }
+
+ /**
+ * Decode the GZIP stream
+ *
+ * @return bool Successfulness
+ */
+ public function parse()
+ {
+ if ($this->compressed_size >= $this->min_compressed_size)
+ {
+ // Check ID1, ID2, and CM
+ if (substr($this->compressed_data, 0, 3) !== "\x1F\x8B\x08")
+ {
+ return false;
+ }
+
+ // Get the FLG (FLaGs)
+ $this->flags = ord($this->compressed_data[3]);
+
+ // FLG bits above (1 << 4) are reserved
+ if ($this->flags > 0x1F)
+ {
+ return false;
+ }
+
+ // Advance the pointer after the above
+ $this->position += 4;
+
+ // MTIME
+ $mtime = substr($this->compressed_data, $this->position, 4);
+ // Reverse the string if we're on a big-endian arch because l is the only signed long and is machine endianness
+ if (current(unpack('S', "\x00\x01")) === 1)
+ {
+ $mtime = strrev($mtime);
+ }
+ $this->MTIME = current(unpack('l', $mtime));
+ $this->position += 4;
+
+ // Get the XFL (eXtra FLags)
+ $this->XFL = ord($this->compressed_data[$this->position++]);
+
+ // Get the OS (Operating System)
+ $this->OS = ord($this->compressed_data[$this->position++]);
+
+ // Parse the FEXTRA
+ if ($this->flags & 4)
+ {
+ // Read subfield IDs
+ $this->SI1 = $this->compressed_data[$this->position++];
+ $this->SI2 = $this->compressed_data[$this->position++];
+
+ // SI2 set to zero is reserved for future use
+ if ($this->SI2 === "\x00")
+ {
+ return false;
+ }
+
+ // Get the length of the extra field
+ $len = current(unpack('v', substr($this->compressed_data, $this->position, 2)));
+ $this->position += 2;
+
+ // Check the length of the string is still valid
+ $this->min_compressed_size += $len + 4;
+ if ($this->compressed_size >= $this->min_compressed_size)
+ {
+ // Set the extra field to the given data
+ $this->extra_field = substr($this->compressed_data, $this->position, $len);
+ $this->position += $len;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ // Parse the FNAME
+ if ($this->flags & 8)
+ {
+ // Get the length of the filename
+ $len = strcspn($this->compressed_data, "\x00", $this->position);
+
+ // Check the length of the string is still valid
+ $this->min_compressed_size += $len + 1;
+ if ($this->compressed_size >= $this->min_compressed_size)
+ {
+ // Set the original filename to the given string
+ $this->filename = substr($this->compressed_data, $this->position, $len);
+ $this->position += $len + 1;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ // Parse the FCOMMENT
+ if ($this->flags & 16)
+ {
+ // Get the length of the comment
+ $len = strcspn($this->compressed_data, "\x00", $this->position);
+
+ // Check the length of the string is still valid
+ $this->min_compressed_size += $len + 1;
+ if ($this->compressed_size >= $this->min_compressed_size)
+ {
+ // Set the original comment to the given string
+ $this->comment = substr($this->compressed_data, $this->position, $len);
+ $this->position += $len + 1;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ // Parse the FHCRC
+ if ($this->flags & 2)
+ {
+ // Check the length of the string is still valid
+ $this->min_compressed_size += $len + 2;
+ if ($this->compressed_size >= $this->min_compressed_size)
+ {
+ // Read the CRC
+ $crc = current(unpack('v', substr($this->compressed_data, $this->position, 2)));
+
+ // Check the CRC matches
+ if ((crc32(substr($this->compressed_data, 0, $this->position)) & 0xFFFF) === $crc)
+ {
+ $this->position += 2;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ // Decompress the actual data
+ if (($this->data = gzinflate(substr($this->compressed_data, $this->position, -8))) === false)
+ {
+ return false;
+ }
+
+ $this->position = $this->compressed_size - 8;
+
+ // Check CRC of data
+ $crc = current(unpack('V', substr($this->compressed_data, $this->position, 4)));
+ $this->position += 4;
+ /*if (extension_loaded('hash') && sprintf('%u', current(unpack('V', hash('crc32b', $this->data)))) !== sprintf('%u', $crc))
+ {
+ return false;
+ }*/
+
+ // Check ISIZE of data
+ $isize = current(unpack('V', substr($this->compressed_data, $this->position, 4)));
+ $this->position += 4;
+ if (sprintf('%u', strlen($this->data) & 0xFFFFFFFF) !== sprintf('%u', $isize))
+ {
+ return false;
+ }
+
+ // Wow, against all odds, we've actually got a valid gzip string
+ return true;
+ }
+
+ return false;
+ }
+}
+
+class_alias('SimplePie_gzdecode', 'SimplePie\Gzdecode', false);
diff --git a/manager/media/rss/vendor/simplepie/simplepie/src/Author.php b/manager/media/rss/vendor/simplepie/simplepie/src/Author.php
new file mode 100644
index 0000000000..19e92498e6
--- /dev/null
+++ b/manager/media/rss/vendor/simplepie/simplepie/src/Author.php
@@ -0,0 +1,55 @@
+ 0) ? this.options.height : this.boxHeight;
- this.position();
- this.eventPosition = this.position.bind(this);
- window.addEvent('scroll', this.eventPosition).addEvent('resize', this.eventPosition);
- this.box.setStyle('display', 'none');
- if (this.options.overlay) {
- this.fx1 = new Fx.Style(this.overlay, 'opacity', {duration:500}).custom(0, .8);
- }
- if (this.options.effect == 'grow') {
- this.container.setStyle('top', (Window.getScrollTop()+(Window.getHeight()/2))+'px');
- var style = {}; style.height = 0; style.width = 0;
- if (this.options.horizontal != 'center') {
- style[this.options.horizontal] = (this.options.width/2)+'px';
- }
- if (this.options.vertical == 'top') {
- style[this.options.vertical] = (Window.getScrollTop()+(this.boxHeight/2))+'px';
- } else if (this.options.vertical == 'bottom') {
- style.top = (Window.getScrollTop()+Window.getHeight()-(this.boxHeight/2)-25)+'px';
- }
- this.container.setStyles(style);
- this.container.setStyle('visibility', '');
- this.fx2 = new Fx.Styles(this.container, {duration: 500});
- this.fx2.custom({
- 'width': [0, this.options.width], 'margin-left': [0, -this.options.width/2], 'margin-right': [0, -this.options.width/2],
- 'height': [0, this.boxHeight], 'margin-top': [0, -this.boxHeight/2], 'margin-bottom': [0, -this.boxHeight/2]
- }).chain(function() {
- this.box.setStyles({
- 'visibility': 'hidden', 'display': '', 'height': this.boxHeight+'px'
- });
- new Fx.Style(this.box, 'opacity', {duration: 500}).custom(0, 1).chain(function() {
- if (this.options.delay > 0) {
- var fn = function () {
- this.close()
- }.bind(this).delay(this.options.delay);
- }
- }.bind(this));
- }.bind(this));
- } else {
- this.container.setStyles({
- 'height': this.boxHeight, 'width': this.options.width,
- 'left': '', 'visibility': 'hidden'
- });
- this.box.setStyles({
- 'visibility': '', 'display': '', 'height': this.boxHeight+'px'
- });
- this.fx2 = new Fx.Styles(this.container, {duration: 500});
- var special = {};
- if (this.options.horizontal != 'center') {
- special[this.options.horizontal] = [-this.options.width, 0];
- } else {
- this.container.setStyles({
- 'left': '50%', 'margin-left': (-this.options.width/2)+'px', 'margin-right': (-this.options.width/2)+'px'
- });
- }
- if (this.options.vertical == 'top') {
- special[this.options.vertical] = [Window.getScrollTop()-this.boxHeight, Window.getScrollTop()];
- } else if (this.options.vertical == 'bottom') {
- special.top = [Window.getScrollTop()+Window.getHeight(), Window.getScrollTop()+Window.getHeight()-this.boxHeight-25];
- } else {
- this.container.setStyles({
- 'top': (Window.getScrollTop()+(Window.getHeight()/2))+'px', 'margin-top': (-this.boxHeight/2)+'px', 'margin-bottom': (-this.boxHeight/2)+'px'
- });
- }
- special.opacity = [0, 1];
- this.fx2.custom(special).chain(function() {
- if (this.options.delay > 0) {
- var fn = function () {
- this.close()
- }.bind(this).delay(this.options.delay);
- }
- }.bind(this));
- }
- },
-
- position: function() {
- var wHeight = (Window.getScrollHeight() > Window.getHeight()) ? Window.getScrollHeight() : Window.getHeight();
- //var bHeight = this.container.getStyle('height').toInt();
- var lr = (this.options.effect == 'grow') ? this.options.width/2 : 0;
- var tb = (this.options.effect == 'grow') ? this.boxHeight/2 : 0;
- if (this.options.overlay) {
- this.overlay.setStyles({height: wHeight+'px'});
- }
- switch(this.options.vertical) {
- case 'top':
- this.container.setStyle('top', (Window.getScrollTop()+tb)+'px');
- break;
- case 'middle':
- this.container.setStyle('top', (Window.getScrollTop()+(Window.getHeight()/2))+'px');
- break;
- case 'bottom':
- this.container.setStyle('top', (Window.getScrollTop()+Window.getHeight()-this.boxHeight+tb-25)+'px');
- break;
- }
- if (this.options.horizontal == 'center') {
- this.container.setStyle('left', '50%');
- } else {
- this.container.setStyle(this.options.horizontal, lr+'px');
- }
- },
-
- close: function(fn) {
- for (var i = 1; i <= this.options.buttons; i++) {
- this['button'+i].onclick = null;
- }
- if (this.options.overlay) {this.fx1.clearTimer();}
- this.fx2.clearTimer();
- if (typeof(fn) == 'function') {
- fn();
- }
- if (this.options.overlay) {new Fx.Style(this.overlay, 'opacity', {duration:250}).custom(.8, 0);}
- new Fx.Style(this.container, 'opacity', {
- duration:250,
- onComplete: function() {
- window.removeEvent('scroll', this.eventPosition).removeEvent('resize', this.eventPosition);
- if (this.options.overlay) {
- this.overlay.remove();
- }
- this.container.remove();
- }.bind(this)
- }).custom(1, 0);
- }
-});
-
-MooPrompt.implement(new Chain);
diff --git a/manager/media/script/mootools/mootools-info.txt b/manager/media/script/mootools/mootools-info.txt
deleted file mode 100755
index 80191ea9c3..0000000000
--- a/manager/media/script/mootools/mootools-info.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-This MODX distribution contains Mootools 1.12, compressed by the YUI
-compressor. It has been stripped of whitespace and comments, but is otherwise
-unaffected in theory. It does make it hard to read the source though. If you
-need documentation, support or source code, please visit the links below:
-
-http://mootools.net/
-http://mootools.net/download
-http://developer.yahoo.com/yui/compressor/
-
diff --git a/manager/media/style/common/login.tpl b/manager/media/style/common/login.tpl
index 840f32d53b..86a8ae30ec 100755
--- a/manager/media/style/common/login.tpl
+++ b/manager/media/style/common/login.tpl
@@ -82,7 +82,7 @@
-
© 2005-2018 by the
EVO .
EVO ™ is licensed under the GPL.
+
© 2005-2023 by the
EVO .
EVO ™ is licensed under the GPL.
-
diff --git a/manager/media/style/common/moo-datepicker/index.html b/manager/media/style/common/moo-datepicker/index.html
deleted file mode 100755
index cfb7d0fe18..0000000000
--- a/manager/media/style/common/moo-datepicker/index.html
+++ /dev/null
@@ -1,2 +0,0 @@
-
Unauthorized access
-You're not allowed to access file folder
\ No newline at end of file
diff --git a/manager/media/style/default/ajax.php b/manager/media/style/default/ajax.php
index 125df4d307..f3e6555f51 100755
--- a/manager/media/style/default/ajax.php
+++ b/manager/media/style/default/ajax.php
@@ -19,9 +19,9 @@
$modx->loadExtension("ManagerAPI");
$_lang = array();
-include_once MODX_MANAGER_PATH . '/includes/lang/english.inc.php';
+include MODX_MANAGER_PATH . '/includes/lang/english.inc.php';
if ($modx->config['manager_language'] != 'english') {
- include_once MODX_MANAGER_PATH . '/includes/lang/' . $modx->config['manager_language'] . '.inc.php';
+ include MODX_MANAGER_PATH . '/includes/lang/' . $modx->config['manager_language'] . '.inc.php';
}
include_once MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/style.php';
@@ -496,7 +496,10 @@
$menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0;
// set parent
- if ($id && $parent >= 0) {
+ $parentNotDeleted = $modx->db->getValue($modx->db->select('id', $modx->getFullTableName('site_content'), "`id`={$parent} AND `deleted`=0"));
+ if ($parent > 0 && !$parentNotDeleted) {
+ $json['errors'] = $_lang["error_parent_deleted"];
+ } elseif ($id && $parent >= 0) {
// find older parent
$parentOld = $modx->db->getValue($modx->db->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id));
diff --git a/manager/media/style/default/css/forms.css b/manager/media/style/default/css/forms.css
index bf7c0f270f..08a4796174 100644
--- a/manager/media/style/default/css/forms.css
+++ b/manager/media/style/default/css/forms.css
@@ -52,9 +52,6 @@ input[type=range] { -webkit-appearance: slider-horizontal; -moz-appearance: init
::-ms-value { border: none; margin: 0; padding: 0 0 1px; line-height: 1 }
select::-ms-expand { display: none; }
::-moz-focus-inner { border: 0; padding: 0; }
-@-moz-document url-prefix() {
-select:not([size]):not([multiple]) { text-indent: -2px }
-}
/* darkness */
.darkness .form-control, .darkness input[type=text]:not(.form-control), .darkness input[type=password], .darkness input[type=number], .darkness input[type=email], .darkness input[type=date], .darkness input[type=url], .darkness input[type=search], .darkness select, .darkness textarea, .darkness .btn, .darkness button:not(.btn), .darkness input[type=button]:not(.btn), .darkness input[type=submit]:not(.btn), .darkness .input-group-addon { border-color: #414449; background-color: #202329; color: #bbb; }
.darkness input:not([type=button]):not([type=submit]):hover:not(:focus), .darkness select:hover:not(:focus), .darkness textarea:hover:not(:focus) { border-color: #5d5d5d }
diff --git a/manager/media/style/default/js/modx.js b/manager/media/style/default/js/modx.js
index 522a24d174..c8fb9d9493 100755
--- a/manager/media/style/default/js/modx.js
+++ b/manager/media/style/default/js/modx.js
@@ -1,5 +1,6 @@
(function(w, d, u) {
'use strict';
+ modx.tree_parent = modx.tree_parent || 0;
modx.extended({
frameset: 'frameset',
minWidth: 840,
@@ -14,11 +15,12 @@
}
//this.tree.init();
this.mainmenu.init();
- if (w.location.hash) {
- if (modx.getActionFromUrl(w.location.hash, 2)) {
+ var href = modx.normalizeUrl(w.location.href);
+ if (href) {
+ if (modx.getActionFromUrl(href, 2)) {
w.history.replaceState(null, d.title, modx.MODX_MANAGER_URL);
- } else if (modx.getActionFromUrl(w.location.hash) || modx.main.getQueryVariable('filemanager', w.location.hash)) {
- var url = modx.main.getQueryVariable('filemanager', w.location.hash) ? modx.MODX_MANAGER_URL + modx.main.getQueryVariable('filemanager', w.location.hash) + w.location.hash.replace('#?', '?') : w.location.href.replace('#?', '?');
+ } else if (modx.getActionFromUrl(href) || modx.main.getQueryVariable('filemanager', href) || /^modules\//.test(href)) {
+ var url = modx.main.getQueryVariable('filemanager', href) ? modx.MODX_MANAGER_URL + modx.main.getQueryVariable('filemanager', href) + href : href;
if (modx.config.global_tabs) {
modx.tabs({url: url, title: 'blank'});
} else if (w.main) {
@@ -45,44 +47,48 @@
mainmenu: {
id: 'mainMenu',
init: function() {
- //console.log('modx.mainMenu.init()');
var mm = d.getElementById('mainMenu'), timer;
- mm.delegateEventListener('click', 'a', function(e) {
- if (this.classList.contains('dropdown-toggle')) {
- if (mm.classList.contains('show') && (this.classList.contains('selected') || !modx.isMobile && this.parentElement.classList.contains('hover'))) {
- this.classList.remove('selected');
+ mm.addEventListener('click', function(e) {
+ var a = e.target.closest('a');
+ if (!a) {
+ return;
+ }
+ if (a.classList.contains('dropdown-toggle')) {
+ if (mm.classList.contains('show') && (a.classList.contains('selected') || !modx.isMobile && a.parentElement.classList.contains('hover'))) {
+ a.classList.remove('selected');
mm.classList.remove('show');
} else {
mm.querySelectorAll('.nav > li > a:not(:hover)').forEach(function(el) {
el.classList.remove('selected');
});
- this.classList.add('selected');
+ a.classList.add('selected');
mm.classList.add('show');
}
e.stopPropagation();
e.target.dataset.toggle = '#mainMenu';
modx.hideDropDown(e);
}
- if (this.closest('ul').classList.contains('dropdown-menu') && !this.closest('li').classList.contains('dropdown-back')) {
+ if (a.closest('ul').classList.contains('dropdown-menu') && !a.closest('li').classList.contains('dropdown-back')) {
mm.querySelectorAll('.nav > .active').forEach(function(el) {
el.classList.remove('active');
});
mm.querySelectorAll('.nav li.selected').forEach(function(el) {
el.classList.remove('selected');
});
- this.closest('.nav > li').classList.add('active');
- if (this.offsetParent.id) {
- d.getElementById(this.offsetParent.id.substr(7)).classList.add('selected');
+ a.closest('.nav > li').classList.add('active');
+ if (a.offsetParent.id) {
+ d.getElementById(a.offsetParent.id.substr(7)).classList.add('selected');
}
- if ((modx.isMobile || w.innerWidth < modx.minWidth) && this.classList.contains('toggle')) {
- this.parentNode.classList.add('selected');
+ if ((modx.isMobile || w.innerWidth < modx.minWidth) && e.target.classList.contains('toggle')) {
+ a.parentNode.classList.add('selected');
e.stopPropagation();
e.preventDefault();
}
}
});
- mm.delegateEventListener('click', '.nav li', function() {
- if ((modx.isMobile || w.innerWidth < modx.minWidth)) {
+ mm.addEventListener('click', function(e) {
+ let li = e.target.closest('.nav li');
+ if (li && modx.isMobile) {
mm.querySelectorAll('.nav ul.selected').forEach(function(el) {
el.classList.remove('selected');
});
@@ -172,7 +178,7 @@
}
ul.classList.add('show');
if (modx.isMobile) {
- if (e.target.classList.contains('toggle')) {
+ if (e.target.classList.contains('dropdown-toggle')) {
self.parentNode.classList.add('selected');
}
} else {
@@ -278,7 +284,7 @@
d.body.appendChild(this.result);
}
this.loader = d.createElement('i');
- this.loader.className = 'fa fa-refresh fa-spin fa-fw';
+ this.loader.className = modx.style.icon_refresh + modx.style.icon_spin;
this.input.parentNode.appendChild(this.loader);
if (modx.config.global_tabs) {
this.input.parentNode.onsubmit = function(e) {
@@ -369,7 +375,8 @@
if (modx.config.global_tabs) {
w.main.document.addEventListener('click', modx.tabs, false);
}
- w.history.replaceState(null, d.title, modx.getActionFromUrl(w.main.location.search, 2) ? modx.MODX_MANAGER_URL : '#' + w.main.location.search);
+ var url = modx.normalizeUrl(w.main.location.href);
+ w.history.replaceState(null, d.title, modx.getActionFromUrl(url, 2) ? modx.MODX_MANAGER_URL : '#' + url);
setTimeout('modx.tree.restoreTree()', 100);
},
oncontextmenu: function(e) {
@@ -416,7 +423,7 @@
row.parentNode.insertBefore(rowContainer, row);
rowContainer.appendChild(row);
var p = d.createElement('i');
- p.className = 'fa fa-angle-left prev disable';
+ p.className = modx.style.icon_angle_left + ' prev disable';
p.onclick = function(e) {
e.stopPropagation();
e.preventDefault();
@@ -428,7 +435,7 @@
};
rowContainer.appendChild(p);
var n = d.createElement('i');
- n.className = 'fa fa-angle-right next disable';
+ n.className = modx.style.icon_angle_right + ' next disable';
n.onclick = function(e) {
e.stopPropagation();
e.preventDefault();
@@ -521,7 +528,7 @@
},
scrollWork: function() {
var a = w.main.frameElement.contentWindow,
- b = a.location.search.substring(1) || a.location.hash.substring(2),
+ b = modx.normalizeUrl(a.location.href),
c = localStorage.getItem('page_y') || 0,
f = localStorage.getItem('page_url') || b;
if (((modx.getActionFromUrl(f) === modx.getActionFromUrl(b)) && (modx.main.getQueryVariable('id', f) && modx.main.getQueryVariable('id', f) === modx.main.getQueryVariable('id', b))) || (f === b)) {
@@ -582,6 +589,9 @@
}
}, false);
w.addEventListener('touchmove', function(e) {
+ if (d.getElementById('mainMenu').classList.contains('show')) {
+ return;
+ }
var touch = e.changedTouches[0];
tree.style.transition = 'none';
tree.style.WebkitTransition = 'none';
@@ -913,10 +923,10 @@
parent: parent,
menuindex: menuindex
}, function(r) {
- if (r?.errors) alert(r.errors);
+ if (r && r.errors) modx.alert(r.errors);
modx.tree.restoreTree();
}, 'json');
- var b = w.main.frameElement.contentWindow.location.search.substr(1);
+ var b = modx.normalizeUrl(w.main.frameElement.contentWindow.location.href);
if (modx.getActionFromUrl(b, 27) && parseInt(modx.main.getQueryVariable('id', b)) === parseInt(id)) {
var index = menuindex.indexOf(id),
elMenuIndex = w.main.document.querySelector('#documentPane input[name=menuindex]'),
@@ -1231,7 +1241,7 @@
}
var f = d.getElementById('nameHolder');
f.innerHTML = this.selectedObjectName;
- el.style.left = a + (modx.config.textdir ? '-190' : '') + 'px';
+ el.style.left = a + (modx.config.textdir === 'rtl' ? '-190' : '') + 'px';
el.style.top = b + 'px';
el.classList.add('show');
},
@@ -1287,7 +1297,7 @@
modx.tabs({url: modx.MODX_MANAGER_URL + '?a=62&id=' + this.itemToChange, title: this.selectedObjectName + '
(' + this.itemToChange + ') '});
}
} else {
- alert('Document is linked to site_start variable and cannot be unpublished!');
+ modx.alert('Document is linked to site_start variable and cannot be unpublished!');
}
break;
case 11:
@@ -1297,7 +1307,7 @@
w.open(d.getElementById('node' + this.itemToChange).firstChild.dataset.href, 'previeWin');
break;
default:
- alert('Unknown operation command.');
+ modx.alert('Unknown operation command.');
}
},
setSelected: function(a) {
@@ -1323,7 +1333,7 @@
if (el) el.classList.add('selected');
},
setItemToChange: function() {
- var a = w.main.document && (w.main.document.URL || w.main.document.location.search),
+ var a = w.main.document && (w.main.document.URL || modx.normalizeUrl(w.main.document.location.href)),
b = modx.getActionFromUrl(a);
if (a && modx.typesactions[b]) {
this.itemToChange = (modx.typesactions[b] === 7 ? '' : modx.typesactions[b] + '_') + parseInt(modx.main.getQueryVariable('id', a));
@@ -1338,7 +1348,7 @@
d.getElementById('treeloader').classList.add('visible');
this.setItemToChange();
this.rpcNode = d.getElementById('treeRoot');
- modx.post(modx.MODX_MANAGER_URL + 'media/style/' + modx.config.theme + '/ajax.php', 'a=1&f=nodes&indent=1&parent=0&expandAll=2&id=' + this.itemToChange, function(r) {
+ modx.post(modx.MODX_MANAGER_URL + 'media/style/' + modx.config.theme + '/ajax.php', 'a=1&f=nodes&indent=1&parent=' + modx.tree_parent + '&expandAll=2&id=' + this.itemToChange, function(r) {
modx.tree.rpcLoadData(r);
modx.tree.draggable();
});
@@ -1347,7 +1357,7 @@
expandTree: function() {
this.rpcNode = d.getElementById('treeRoot');
d.getElementById('treeloader').classList.add('visible');
- modx.post(modx.MODX_MANAGER_URL + 'media/style/' + modx.config.theme + '/ajax.php', 'a=1&f=nodes&indent=1&parent=0&expandAll=1&id=' + this.itemToChange, function(r) {
+ modx.post(modx.MODX_MANAGER_URL + 'media/style/' + modx.config.theme + '/ajax.php', 'a=1&f=nodes&indent=1&parent=' + modx.tree_parent + '&expandAll=1&id=' + this.itemToChange, function(r) {
modx.tree.rpcLoadData(r);
modx.tree.saveFolderState();
modx.tree.draggable();
@@ -1356,7 +1366,7 @@
collapseTree: function() {
this.rpcNode = d.getElementById('treeRoot');
d.getElementById('treeloader').classList.add('visible');
- modx.post(modx.MODX_MANAGER_URL + 'media/style/' + modx.config.theme + '/ajax.php', 'a=1&f=nodes&indent=1&parent=0&expandAll=0&id=' + this.itemToChange, function(r) {
+ modx.post(modx.MODX_MANAGER_URL + 'media/style/' + modx.config.theme + '/ajax.php', 'a=1&f=nodes&indent=1&parent=' + modx.tree_parent + '&expandAll=0&id=' + this.itemToChange, function(r) {
modx.openedArray = [];
modx.tree.saveFolderState();
modx.tree.rpcLoadData(r);
@@ -1367,7 +1377,7 @@
this.rpcNode = d.getElementById('treeRoot');
d.getElementById('treeloader').classList.add('visible');
var a = d.sortFrm;
- var b = 'a=1&f=nodes&indent=1&parent=0&expandAll=2&dt=' + a.dt.value + '&tree_sortby=' + a.sortby.value + '&tree_sortdir=' + a.sortdir.value + '&tree_nodename=' + a.nodename.value + '&id=' + this.itemToChange + '&showonlyfolders=' + a.showonlyfolders.value;
+ var b = 'a=1&f=nodes&indent=1&parent=' + modx.tree_parent + '&expandAll=2&dt=' + a.dt.value + '&tree_sortby=' + a.sortby.value + '&tree_sortdir=' + a.sortdir.value + '&tree_nodename=' + a.nodename.value + '&id=' + this.itemToChange + '&showonlyfolders=' + a.showonlyfolders.value;
modx.post(modx.MODX_MANAGER_URL + 'media/style/' + modx.config.theme + '/ajax.php', b, function(r) {
modx.tree.rpcLoadData(r);
modx.tree.draggable();
@@ -1414,7 +1424,7 @@
if (a) {
el.title = modx.lang.empty_recycle_bin;
el.classList.remove('disabled');
- el.innerHTML = modx.style.empty_recycle_bin;
+ el.innerHTML = modx.style.icon_trash;
el.onclick = function() {
modx.tree.emptyTrash();
};
@@ -1425,7 +1435,7 @@
} else {
el.title = modx.lang.empty_recycle_bin_empty;
el.classList.add('disabled');
- el.innerHTML = modx.style.empty_recycle_bin_empty;
+ el.innerHTML = modx.style.icon_trash_alt;
el.onclick = null;
}
}
@@ -1524,7 +1534,7 @@
function Tabs(a)
{
var s = this;
- this.url = a.url;
+ this.url = a.url.replace(new RegExp(modx.MODX_MANAGER_URL, 'g'), '');
this.title = a.title || '';
this.name = a.name || '';
this.timer = null;
@@ -1533,6 +1543,7 @@
this.saveAndCloseActions = [75, 86, 99, 106];
this.reload = typeof a.reload !== 'undefined' ? a.reload : 1;
this.action = modx.getActionFromUrl(a.url);
+ this.getTab = modx.main.getQueryVariable('tab', a.url);
this.uid = modx.getActionFromUrl(a.url, 2) ? 'home' : modx.urlToUid(a.url);
this.page = d.getElementById('evo-tab-page-' + this.uid);
this.row = d.getElementsByClassName('evo-tab-row')[0].firstElementChild;
@@ -1558,13 +1569,15 @@
this.show();
if (~this.closeactions.indexOf(this.action)) {
this.setDocPublished();
- modx.get(this.url, function() {
+ modx.get(this.url, function(r) {
+ /__alertQuit\(\)/.test(r) && modx.alert(r.match(/\(.*?)\<\/body\>/s)[0]);
modx.tree.restoreTree();
});
}
}
} else if (~this.closeactions.indexOf(this.action)) {
- modx.get(this.url, function() {
+ modx.get(this.url, function(r) {
+ /__alertQuit\(\)/.test(r) && modx.alert(r.match(/\(.*?)\<\/body\>/s)[0]);
modx.tree.restoreTree();
});
} else {
@@ -1602,7 +1615,8 @@
if (!/
';
}
- this.tab.innerHTML = '
' + this.icon + this.title + ' × ';
+ this.txt = modx.title(this.title);
+ this.tab.innerHTML = '
' + this.icon + this.title + ' × ';
this.row.appendChild(this.tab);
this.tab.onclick = function(e) {
s.select.call(s, e, this);
@@ -1620,26 +1634,20 @@
onload: function(e) {
var s = this;
w.main = e.target.contentWindow || e.target.defaultView;
- this.url = w.main.location.search || w.location.hash.substring(1);
+ this.url = modx.normalizeUrl(w.main.location.href) || modx.normalizeUrl(w.location.href);
this.olduid = this.uid;
this.uid = modx.urlToUid(this.url);
if (!!w.main.__alertQuit) {
w.main.alert = function(a) { };
var message = w.main.document.body.innerHTML;
w.main.document.body.style.display = 'none';
- history.pushState(null, d.title, modx.getActionFromUrl(w.location.search, 2) ? modx.MODX_MANAGER_URL : '#' + w.location.search);
+ history.pushState(null, d.title, modx.getActionFromUrl(this.url, 2) ? modx.MODX_MANAGER_URL : '#' + this.url);
w.onpopstate = function() {
history.go(1);
};
- modx.popup({
- type: 'warning',
- title: 'MODX :: Alert',
- position: 'top center alertQuit',
- content: message,
- wrap: 'body'
- });
+ modx.alert(message);
modx.getLockedElements(modx.getActionFromUrl(this.url), modx.main.getQueryVariable('id', this.url), function(data) {
- if (!!data) {
+ if (!!data || ~s.closeactions.indexOf(modx.getActionFromUrl(s.url))) {
s.page.close();
modx.tree.restoreTree();
} else {
@@ -1647,17 +1655,20 @@
w.history.replaceState(null, d.title, modx.getActionFromUrl(s.url, 2) ? modx.MODX_MANAGER_URL : '#' + s.url);
}
});
- modx.main.stopWork();
} else {
if (modx.getActionFromUrl(this.url, 2) || (~this.saveAndCloseActions.indexOf(modx.getActionFromUrl(this.url)) && parseInt(modx.main.getQueryVariable('r', this.url)))) {
this.close(e);
} else if (this.olduid !== this.uid && d.getElementById('evo-tab-' + this.uid)) {
this.close(e);
d.getElementById('evo-tab-' + this.uid).show();
+ if (parseInt(modx.main.getQueryVariable('r', this.url)) === 2) {
+ w.main.location.href = this.url;
+ }
} else {
this.title = w.main.document.body.querySelectorAll('h1')[0] && w.main.document.body.querySelectorAll('h1')[0].innerHTML || this.title;
+ this.txt = modx.title(this.title);
if (this.title && this.uid !== 'home') {
- this.tab.innerHTML = '
' + this.title + ' × ';
+ this.tab.innerHTML = '
' + this.title + ' × ';
}
this.page.id = 'evo-tab-page-' + this.uid;
this.tab.id = 'evo-tab-' + this.uid;
@@ -1671,7 +1682,7 @@
}
}, false);
w.main.document.addEventListener('keyup', function a(e) {
- if (typeof e.view.documentDirty !== 'undefined' && e.view.documentDirty && !s.tab.classList.contains('changed')) {
+ if (e.view && e.view.documentDirty && !s.tab.classList.contains('changed')) {
s.tab.classList.add('changed');
this.removeEventListener(e.type, a, false);
}
@@ -1680,7 +1691,6 @@
}
},
show: function() {
- var s = this;
modx.tabs.selected = this.row.querySelector('.selected');
if (modx.tabs.selected && modx.tabs.selected !== this.tab) {
d.getElementById(modx.tabs.selected.id.replace('tab', 'tab-page')).classList.remove('show');
@@ -1688,11 +1698,16 @@
}
this.page.classList.add('show');
this.tab.classList.add('selected');
+ modx.title(this.txt);
modx.tabs.selected = this.tab;
w.main = this.page.firstElementChild.contentWindow;
- w.history.replaceState(null, w.main.document.title, modx.getActionFromUrl(w.main.location.search, 2) ? modx.MODX_MANAGER_URL : '#' + w.main.location.search);
- modx.tree.setItemToChange();
- modx.main.tabRow.scroll(this.row, this.tab, 350);
+ if (this.getTab && this.action === 76 && !~w.main.frameElement.contentDocument.location.href.indexOf(this.url)) {
+ w.main.frameElement.src = this.url;
+ } else {
+ w.history.replaceState(null, w.main.document.title, modx.getActionFromUrl(this.url, 2) ? modx.MODX_MANAGER_URL : '#' + this.url);
+ modx.tree.setItemToChange();
+ modx.main.tabRow.scroll(this.row, this.tab, 350);
+ }
},
close: function(e) {
var documentDirty = this.page.firstElementChild.contentWindow.documentDirty;
@@ -1706,6 +1721,7 @@
this.row.removeChild(this.tab);
modx.tabs.selected.show();
}
+ modx.main.stopWork();
},
select: function(e) {
if (e.target.className === 'tab-close') {
@@ -1731,7 +1747,7 @@
el.checked = this.action === 61;
w.main.document.getElementsByName('published')[0].value = +el.checked;
}
- if (modx.getActionFromUrl(w.main.location.search, 3)) {
+ if (modx.getActionFromUrl(modx.normalizeUrl(w.main.location.href), 3)) {
w.main.location.reload();
}
}
@@ -1848,6 +1864,7 @@
if (o.draggable) {
modx.dragging(o.el, {wrap: o.wrap, resize: o.resize});
}
+ o.el.classList.add('show');
},
close: function(e) {
o.event = e || o.event || w.event;
@@ -1978,7 +1995,7 @@
o.el.style.height = !/[^[0-9]/.test(o.height) ? o.height + 'px' : o.height;
o.el.style.zIndex = o.zIndex;
o.el.style.margin = o.margin;
- o.el.className = o.className + ' show alert alert-' + o.type + ' ' + o.addclass + (o.animation ? ' animation ' + o.animation : '');
+ o.el.className = o.className + ' alert alert-' + o.type + ' ' + o.addclass + (o.animation ? ' animation ' + o.animation : '');
o.el.dataset.position = o.position.join(':');
if (o.showclose) {
o.el.innerHTML += '';
@@ -2019,12 +2036,7 @@
o.uid = modx.urlToUid(a.url);
o.event = e;
if (!!e.target.contentWindow.__alertQuit) {
- modx.popup({
- type: 'warning',
- title: 'MODX :: Alert',
- position: 'top center alertQuit',
- content: e.target.contentWindow.document.body.querySelector('p').innerHTML
- });
+ modx.alert(e.target.contentWindow.document.body.querySelector('p').innerHTML);
e.target.contentWindow.document.body.innerHTML = '';
e.target.contentWindow.alert = function() {};
} else {
@@ -2085,6 +2097,19 @@
return o;
}
},
+ alert: function(m, t) {
+ modx.popup({
+ type: t || 'warning',
+ title: 'Evolution CMS :: Alert',
+ position: 'top center alertQuit',
+ content: m,
+ wrap: 'body'
+ });
+ },
+ title: function(t) {
+ t = t && t.replace(/<\/?[^>]+>/g, ' ').replace(/[\n\t\r]/g, '').trim() || '';
+ return d.title = (t && t + ' - ') + this.config.manager_title;
+ },
getWindowDimension: function() {
var a = 0,
b = 0,
@@ -2115,7 +2140,7 @@
modx.tree.ctx = null;
}
if (!/dropdown\-item/.test(e.target.className)
- //&& !(e && ("click" === e.type && /form|label|input|textarea|select/i.test(e.target.tagName)))
+ //&& !(e && ("click" === e.type && /form|label|input|textarea|select/i.test(e.target.tagName)))
) {
var els = d.querySelectorAll('.dropdown.show'),
n = null,
@@ -2126,17 +2151,17 @@
} else if (t.classList.contains('dropdown-toggle')) {
n = t.offsetParent;
}
- els.forEach(function(el) {
- if (n !== el) {
- el.classList.remove('show');
+ for (i = 0; i < els.length; i++) {
+ if (n !== els[i]) {
+ els[i].classList.remove('show');
}
- });
+ }
els = w.main && w.main.document.querySelectorAll('.dropdown.show') || [];
- els.forEach(function(el) {
- if (n !== el) {
- el.classList.remove('show');
+ for (i = 0; i < els.length; i++) {
+ if (n !== els[i]) {
+ els[i].classList.remove('show');
}
- });
+ }
}
},
XHR: function() {
@@ -2230,12 +2255,18 @@
return parseInt(modx.main.getQueryVariable('a', a));
}
},
+ normalizeUrl(url) {
+ url = url.replace(new RegExp(modx.MODX_MANAGER_URL, 'g'), '');
+ url = url.replace(/^index\.php/, '');
+ url = url.replace(/^#/, '');
+ return url;
+ },
getLockedElements: function(a, b, c) {
if (modx.typesactions[a] && b) {
modx.post(modx.MODX_MANAGER_URL + 'media/style/' + modx.config.theme + '/ajax.php', {
a: 'getLockedElements',
- id: modx.main.getQueryVariable('id', w.main.location.search),
- type: modx.typesactions[modx.getActionFromUrl(w.main.location.search)]
+ id: modx.main.getQueryVariable('id', modx.normalizeUrl(w.main.location.href)),
+ type: modx.typesactions[modx.getActionFromUrl(modx.normalizeUrl(w.main.location.href))]
}, c);
}
},
@@ -2436,28 +2467,28 @@
var b = '';
switch (this.typesactions[a]) {
case 1:
- b = 'fa fa-newspaper-o';
+ b = modx.style.icon_template;
break;
case 2:
- b = 'fa fa-list-alt';
+ b = modx.style.icon_tv;
break;
case 3:
- b = 'fa fa-th-large';
+ b = modx.style.icon_chunk;
break;
case 4:
- b = 'fa fa-code';
+ b = modx.style.icon_code;
break;
case 5:
- b = 'fa fa-plug';
+ b = modx.style.icon_plugin;
break;
case 6:
- b = 'fa fa-cube';
+ b = modx.style.icon_element;
break;
case 7:
- b = 'fa fa-pencil-square-o';
+ b = modx.style.icon_edit;
break;
default:
- b = 'fa fa-circle';
+ b = modx.style.icon_circle;
}
return b;
},
@@ -2571,9 +2602,10 @@
//console.log('tree.resizeTree() off')
};
w.onbeforeunload = function() {
- var a = w.main.frameElement.contentWindow;
- if (modx.getActionFromUrl(a.location.search, 27)) {
- modx.get(modx.MODX_MANAGER_URL + '?a=67&type=7&id=' + modx.main.getQueryVariable('id', a.location.search.substring(1)));
+ var a = w.main.frameElement.contentWindow,
+ url = modx.normalizeUrl(a.location.href);
+ if (modx.getActionFromUrl(url, 27)) {
+ modx.get(modx.MODX_MANAGER_URL + '?a=67&type=7&id=' + modx.main.getQueryVariable('id', url));
}
};
d.addEventListener('DOMContentLoaded', function() {
@@ -2603,23 +2635,3 @@
};
}
})();
-
-!function(o, e) {
- var n = window.Element.prototype,
- i = n.matches;
- i || ['webkit', 'ms', 'moz'].some(function(e) {
- var t = e + 'MatchesSelector';
- if (n.hasOwnProperty(t)) return i = n[t], !0;
- }), e.prototype.delegateEventListener = function(e, n, r) {
- this.addEventListener(e, function(e) {
- var t = function(e, t, n) {
- for (var r = e.target; ;) {
- if (i.call(r, t)) return r;
- if (r === n || r === o.body) return !1;
- r = r.parentNode;
- }
- }(e, n, e.currentTarget);
- t && r.call(t, e);
- });
- };
-}(window.document, window.EventTarget || window.Element);
diff --git a/manager/media/style/default/js/modx.min.js b/manager/media/style/default/js/modx.min.js
deleted file mode 100755
index 5d0934971c..0000000000
--- a/manager/media/style/default/js/modx.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(w,d,u){"use strict";modx.extended({frameset:"frameset",minWidth:840,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),typesactions:{16:1,301:2,78:3,22:4,102:5,108:6,3:7,4:7,6:7,27:7,61:7,62:7,63:7,72:7},thememodes:["","lightness","light","dark","darkness"],tabsTimer:0,popupTimer:0,init:function(){var e;localStorage.getItem("MODX_widthSideBar")||localStorage.setItem("MODX_widthSideBar",this.config.tree_width),this.mainmenu.init(),w.location.hash&&(modx.getActionFromUrl(w.location.hash,2)?w.history.replaceState(null,d.title,modx.MODX_MANAGER_URL):(modx.getActionFromUrl(w.location.hash)||modx.main.getQueryVariable("filemanager",w.location.hash))&&(e=modx.main.getQueryVariable("filemanager",w.location.hash)?modx.MODX_MANAGER_URL+modx.main.getQueryVariable("filemanager",w.location.hash)+w.location.hash.replace("#?","?"):w.location.href.replace("#?","?"),modx.config.global_tabs?modx.tabs({url:e,title:"blank"}):w.main?w.main.frameElement.src=e:modx.openWindow(e))),this.resizer.init(),this.search.init(),0
li > a:not(:hover)").forEach(function(e){e.classList.remove("selected")}),this.classList.add("selected"),t.classList.add("show")),e.stopPropagation(),e.target.dataset.toggle="#mainMenu",modx.hideDropDown(e)),this.closest("ul").classList.contains("dropdown-menu")&&!this.closest("li").classList.contains("dropdown-back")&&(t.querySelectorAll(".nav > .active").forEach(function(e){e.classList.remove("active")}),t.querySelectorAll(".nav li.selected").forEach(function(e){e.classList.remove("selected")}),this.closest(".nav > li").classList.add("active"),this.offsetParent.id&&d.getElementById(this.offsetParent.id.substr(7)).classList.add("selected"),(modx.isMobile||w.innerWidth li").forEach(function(e){e.addEventListener("mouseenter",function(){t.querySelectorAll(".nav > li.hover:not(:hover)").forEach(function(e){e.classList.remove("hover")}),this.classList.add("hover")})}),t.querySelectorAll(".nav > li li").forEach(function(e){e.addEventListener("mouseenter",function(s){var n,a=this;t.querySelectorAll(".nav > li li.hover:not(:hover)").forEach(function(e){e.classList.remove("hover")}),this.classList.add("hover"),clearTimeout(r),this.offsetParent.nextElementSibling&&this.offsetParent.nextElementSibling.classList.contains("sub-menu")?n=this.offsetParent.nextElementSibling:this.offsetParent&&this.offsetParent.classList.contains("sub-menu")?n=this.offsetParent:((n=d.createElement("ul")).className="sub-menu dropdown-menu",this.parentNode.parentNode.appendChild(n)),r=setTimeout(function(){d.querySelector(".nav .sub-menu.show")&&d.querySelector(".nav .sub-menu.show").classList.remove("show"),n.style.left=a.offsetWidth+"px",a.classList.contains("dropdown-toggle")?n.id==="parent_"+a.id?(modx.isMobile?a.parentNode.classList.add("selected"):a.onclick=function(e){e.target.classList.contains("toggle")&&a.parentNode.classList.add("selected")},n.classList.add("show")):(n.classList.remove("show"),t.querySelectorAll(".nav ul.selected").forEach(function(e){e.classList.remove("selected")}),r=setTimeout(function(){var i=a.firstElementChild.href&&"main"===a.firstElementChild.target?a.firstElementChild.href.split("?")[1]+"&elements="+a.id:"";modx.post(modx.MODX_MANAGER_URL+"media/style/"+modx.config.theme+"/ajax.php",i,function(e){if(e){(modx.isMobile||w.innerWidth '+modx.lang.paging_prev+" "+e),n.id="parent_"+a.id,n.innerHTML=e;var e=w.location.hash.substr(2).replace(/=/g,"_").replace(/&/g,"__"),t=d.getElementById(e);t&&(t.parentNode.classList.add("selected"),d.getElementById(t.parentNode.parentNode.id.substr(7)).classList.add("selected"));for(var o=0;oi.length-1&&(n=i.length-1),0<=n&&n .tab-row");e&&this.build(e)},build:function(t){var e=d.createElement("div"),o=t.querySelector(".selected");e.className="tab-row-container",t.parentNode.insertBefore(e,t),e.appendChild(t);var i=d.createElement("i");i.className="fa fa-angle-left prev disable",i.onclick=function(e){e.stopPropagation(),e.preventDefault();e=t.querySelector(".selected");e.previousSibling&&(e.previousSibling.click(),modx.main.tabRow.scroll(t))},e.appendChild(i);var s=d.createElement("i");s.className="fa fa-angle-right next disable",s.onclick=function(e){e.stopPropagation(),e.preventDefault();e=t.querySelector(".selected");e.nextSibling&&(e.nextSibling.click(),modx.main.tabRow.scroll(t))},e.appendChild(s),setTimeout(function(){o=t.querySelector(".selected"),modx.main.tabRow.scroll(t,o),w.main.addEventListener("resize",function(){modx.main.tabRow.scroll(t)},!1),o&&(o.previousSibling&&i.classList.remove("disable"),o.nextSibling&&s.classList.remove("disable"))},100),t.onclick=function(e){e="H2"===e.target.tagName?e.target:"SPAN"===e.target.tagName?e.target.parentNode:null;e&&(e.previousSibling?this.parentNode.querySelector("i.prev").classList.remove("disable"):this.parentNode.querySelector("i.prev").classList.add("disable"),e.nextSibling?this.parentNode.querySelector("i.next").classList.remove("disable"):this.parentNode.querySelector("i.next").classList.add("disable"),modx.main.tabRow.scroll(this,e))}},scroll:function(e,t,o){t=t||e.querySelector(".selected")||e.firstChild,o=o||64;for(var i=0,s=e.childNodes,n=0;nt.offsetLeft&&modx.animate(e,{scrollLeft:t.offsetLeft-(t.previousSibling?30:1)},o),t.offsetLeft+t.offsetWidth>e.offsetWidth+e.scrollLeft&&modx.animate(e,{scrollLeft:t.offsetLeft-e.offsetWidth+t.offsetWidth+(t.nextSibling?30:0)},o),i>e.offsetWidth&&this.drag(e)},drag:function(i){i.onmousedown=function(e){var t,o;0===e.button&&(e.preventDefault(),t=e.clientX,o=i.scrollLeft,i.ownerDocument.body.focus(),i.onmousemove=i.ownerDocument.onmousemove=function(e){5Math.abs(t)&&this.swipe&&(e<0&&this.sidebar?(Math.abs(e)>n&&(e=-n),s.style.transform="translate3d("+e+"px, 0, 0)",s.style.WebkitTransform="translate3d("+e+"px, 0, 0)",modx.resizer.mask.style.opacity=(.5-.5/-n*e).toFixed(2),Math.abs(e)>n/3?this.swipe="left":this.swipe="right"):0n&&(e=n),s.style.transform="translate3d("+-(n-e)+"px, 0, 0)",s.style.WebkitTransform="translate3d("+-(n-e)+"px, 0, 0)",modx.resizer.mask.style.opacity=(.5/n*e).toFixed(2),Math.abs(e)>n/3?this.swipe="right":this.swipe="left"))},!1),w.addEventListener("touchend",function(){"left"===this.swipe&&(d.body.classList.add("sidebar-closed"),modx.resizer.setWidth(0)),"right"===this.swipe&&(d.body.classList.remove("sidebar-closed"),modx.resizer.setWidth(n)),s.style.cssText="",modx.resizer.mask.style.cssText=""},!1)))},onMouseDown:function(e){if(e=e||w.event,modx.resizer.dragElement=null!==e.target?e.target:e.srcElement,(1===e.buttons||0===e.button)&&modx.resizer.dragElement.id===modx.resizer.id)return modx.resizer.oldZIndex=modx.resizer.dragElement.style.zIndex,modx.resizer.dragElement.style.zIndex=modx.resizer.newZIndex,modx.resizer.dragElement.style.background=modx.resizer.background,localStorage.setItem("MODX_widthSideBar",0this.offsetHeight/1.51?(this.parentNode.classList.add("dragafter"),this.parentNode.classList.remove("dragbefore"),this.parentNode.classList.remove("dragenter"),e.dataTransfer.effectAllowed="move",e.dataTransfer.dropEffect="move"):t";if(this.nextSibling)for(this.nextSibling.innerHTML?this.nextSibling.appendChild(t):t.parentNode.removeChild(t),o=this.parentNode.lastChild.children,l=0;l";for(this.parentNode.parentNode.insertBefore(t,this.parentNode.nextSibling),o=this.parentNode.parentNode.children,l=0;l";for(this.parentNode.parentNode.insertBefore(t,this.parentNode),o=this.parentNode.parentNode.children,l=0;l a").dataset.titleEsc+")"))},toggleTheme:function(){var e,t,o=1,i=w.main.myCodeMirrors;for(t in void 0===localStorage.MODX_themeMode&&(localStorage.MODX_themeMode=modx.config.theme_mode),modx.thememodes[parseInt(localStorage.MODX_themeMode)+1]&&(o=parseInt(localStorage.MODX_themeMode)+1),e=modx.thememodes[o],modx.thememodes)modx.thememodes[t]&&(d.body.classList.remove(modx.thememodes[t]),w.main.document.body.classList.remove(modx.thememodes[t]));if(d.body.classList.add(e),w.main.document.body.classList.add(e),d.cookie="MODX_themeMode="+o,localStorage.MODX_themeMode=o,void 0!==i)for(t in i)i.hasOwnProperty(t)&&(~e.indexOf("dark")?(w.main.document.getElementsByName(t)[0].nextElementSibling.classList.add("cm-s-"+i[t].options.darktheme),w.main.document.getElementsByName(t)[0].nextElementSibling.classList.remove("cm-s-"+i[t].options.defaulttheme)):(w.main.document.getElementsByName(t)[0].nextElementSibling.classList.remove("cm-s-"+i[t].options.darktheme),w.main.document.getElementsByName(t)[0].nextElementSibling.classList.add("cm-s-"+i[t].options.defaulttheme)))},toggleNode:function(e,t){var o,i,s,n,a;(e=e||w.event).ctrlKey||(e.stopPropagation(),o=d.getElementById("node"+t).firstChild,this.rpcNode=o.nextSibling,i=o.querySelector(".toggle"),s=o.querySelector(".icon"),""===this.rpcNode.innerHTML?(i&&(i.innerHTML=o.dataset.iconCollapsed),s.innerHTML=o.dataset.iconFolderOpen,n=this.rpcNode.innerHTML,a=modx.lang.loading_doc_tree,modx.openedArray[t]=1,(""===n||0("+t+")"}),modx.isMobile&&w.innerWidthe.view.position.width&&(x=e.view.position.width-this.ctx.offsetWidth),y+this.ctx.offsetHeight/2>e.view.position.height?y=e.view.position.height-this.ctx.offsetHeight-5:y-this.ctx.offsetHeight/2bodyHeight?y=bodyHeight-ctx.offsetHeight-5:y-ctx.offsetHeight/2("+this.itemToChange+")"});break;case 2:this.setActiveFromContextMenu(this.itemToChange),modx.tabs({url:modx.MODX_MANAGER_URL+"?a=27&r=1&id="+this.itemToChange,title:this.selectedObjectName+"("+this.itemToChange+") "});break;case 3:modx.tabs({url:modx.MODX_MANAGER_URL+"?a=4&pid="+this.itemToChange,title:this.selectedObjectName+"("+this.itemToChange+") "});break;case 4:this.selectedObjectDeleted?alert('"'+this.selectedObjectName+'" '+modx.lang.already_deleted):!0===confirm('"'+this.selectedObjectName+'"\n\n'+modx.lang.confirm_delete_resource)&&modx.tabs({url:modx.MODX_MANAGER_URL+"?a=6&id="+this.itemToChange,title:this.selectedObjectName+"("+this.itemToChange+") "});break;case 5:this.setActiveFromContextMenu(this.itemToChange),modx.tabs({url:modx.MODX_MANAGER_URL+"?a=51&id="+this.itemToChange,title:this.selectedObjectName+"("+this.itemToChange+") "});break;case 6:modx.tabs({url:modx.MODX_MANAGER_URL+"?a=72&pid="+this.itemToChange,title:this.selectedObjectName+"("+this.itemToChange+") "});break;case 7:!0===confirm(modx.lang.confirm_resource_duplicate)&&modx.tabs({url:modx.MODX_MANAGER_URL+"?a=94&id="+this.itemToChange,title:this.selectedObjectName+"("+this.itemToChange+") "});break;case 8:d.getElementById("node"+this.itemToChange).firstChild.dataset.deleted?!0===confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_undelete)&&modx.tabs({url:modx.MODX_MANAGER_URL+"?a=63&id="+this.itemToChange,title:this.selectedObjectName+"("+this.itemToChange+") "}):alert('"'+this.selectedObjectName+'"'+modx.lang.not_deleted);break;case 9:!0===confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_publish)&&modx.tabs({url:modx.MODX_MANAGER_URL+"?a=61&id="+this.itemToChange,title:this.selectedObjectName+"("+this.itemToChange+") "});break;case 10:this.itemToChange!==modx.config.site_start?!0===confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_unpublish)&&modx.tabs({url:modx.MODX_MANAGER_URL+"?a=62&id="+this.itemToChange,title:this.selectedObjectName+"("+this.itemToChange+") "}):alert("Document is linked to site_start variable and cannot be unpublished!");break;case 11:modx.tabs({url:modx.MODX_MANAGER_URL+"?a=56&id="+this.itemToChange,title:this.selectedObjectName+"("+this.itemToChange+") "});break;case 12:w.open(d.getElementById("node"+this.itemToChange).firstChild.dataset.href,"previeWin");break;default:alert("Unknown operation command.")}},setSelected:function(e){var t=d.querySelector("#tree .current");t&&t.classList.remove("current"),e&&("object"==typeof e?e.classList.add("current"):(t=d.querySelector("#node"+e+">.node")||d.getElementById("node"+e))&&t.classList.add("current"))},setActiveFromContextMenu:function(e){e=d.querySelector("#node"+e+">.node");e&&this.setSelected(e)},setSelectedByContext:function(e){var t=d.querySelector("#treeRoot .selected");t&&t.classList.remove("selected"),(t=d.querySelector("#node"+e+">.node"))&&t.classList.add("selected")},setItemToChange:function(){var e=w.main.document&&(w.main.document.URL||w.main.document.location.search),t=modx.getActionFromUrl(e);e&&modx.typesactions[t]?this.itemToChange=(7===modx.typesactions[t]?"":modx.typesactions[t]+"_")+parseInt(modx.main.getQueryVariable("id",e)):this.itemToChange="",this.setSelected(this.itemToChange)},restoreTree:function(){d.getElementById("treeRoot")&&(d.getElementById("treeloader").classList.add("visible"),this.setItemToChange(),this.rpcNode=d.getElementById("treeRoot"),modx.post(modx.MODX_MANAGER_URL+"media/style/"+modx.config.theme+"/ajax.php","a=1&f=nodes&indent=1&parent=0&expandAll=2&id="+this.itemToChange,function(e){modx.tree.rpcLoadData(e),modx.tree.draggable()}))},expandTree:function(){this.rpcNode=d.getElementById("treeRoot"),d.getElementById("treeloader").classList.add("visible"),modx.post(modx.MODX_MANAGER_URL+"media/style/"+modx.config.theme+"/ajax.php","a=1&f=nodes&indent=1&parent=0&expandAll=1&id="+this.itemToChange,function(e){modx.tree.rpcLoadData(e),modx.tree.saveFolderState(),modx.tree.draggable()})},collapseTree:function(){this.rpcNode=d.getElementById("treeRoot"),d.getElementById("treeloader").classList.add("visible"),modx.post(modx.MODX_MANAGER_URL+"media/style/"+modx.config.theme+"/ajax.php","a=1&f=nodes&indent=1&parent=0&expandAll=0&id="+this.itemToChange,function(e){modx.openedArray=[],modx.tree.saveFolderState(),modx.tree.rpcLoadData(e),modx.tree.draggable()})},updateTree:function(){this.rpcNode=d.getElementById("treeRoot"),d.getElementById("treeloader").classList.add("visible");var e=d.sortFrm,e="a=1&f=nodes&indent=1&parent=0&expandAll=2&dt="+e.dt.value+"&tree_sortby="+e.sortby.value+"&tree_sortdir="+e.sortdir.value+"&tree_nodename="+e.nodename.value+"&id="+this.itemToChange+"&showonlyfolders="+e.showonlyfolders.value;modx.post(modx.MODX_MANAGER_URL+"media/style/"+modx.config.theme+"/ajax.php",e,function(e){modx.tree.rpcLoadData(e),modx.tree.draggable()})},getFolderState:function(){var e;if(modx.openedArray!==[0])for(var t in e="&opened=",modx.openedArray)modx.openedArray[t]&&(e+=t+"|");else e="&opened=";return e},saveFolderState:function(){modx.post(modx.MODX_MANAGER_URL+"media/style/"+modx.config.theme+"/ajax.php","a=1&f=nodes&savestateonly=1"+this.getFolderState())},showSorter:function(e){e=e||w.event;var t=d.getElementById("floater");e.target.dataset.toggle="#floater",t.classList.toggle("show"),t.onclick=function(e){e.stopPropagation()}},emptyTrash:function(){!0===confirm(modx.lang.confirm_empty_trash)&&modx.get(modx.MODX_MANAGER_URL+"?a=64",function(){modx.tabsClose(modx.tree.deleted),modx.tree.deleted=[],modx.tree.restoreTree()})},showBin:function(e){var t=d.getElementById("treeMenu_emptytrash");if(t)if(e){t.title=modx.lang.empty_recycle_bin,t.classList.remove("disabled"),t.innerHTML=modx.style.empty_recycle_bin,t.onclick=function(){modx.tree.emptyTrash()};for(var o=d.getElementById("tree").querySelectorAll(".deleted"),i=0;i"+modx.style.email+modx.lang.inbox+" ("+t[0]+" / "+t[1]+")",e.style.display="block"),0':this.page.innerHTML='',d.getElementById("main").appendChild(this.page),this.page.firstElementChild.onload=function(e){t.onload.call(t,e)},this.tab=d.createElement("h2"),this.tab.id="evo-tab-"+this.uid,this.tab.className="tab selected",this.icon="",/ '),this.tab.innerHTML=''+this.icon+this.title+' × ',this.row.appendChild(this.tab),this.tab.onclick=function(e){t.select.call(t,e,this)},this.tab.close=function(e){t.close.call(t,e)},this.tab.show=function(e){t.show.call(t,e)},this.page.close=function(e){t.close.call(t,e)}},onload:function(e){var t,o=this;w.main=e.target.contentWindow||e.target.defaultView,this.url=w.main.location.search||w.location.hash.substring(1),this.olduid=this.uid,this.uid=modx.urlToUid(this.url),w.main.__alertQuit?(w.main.alert=function(e){},t=w.main.document.body.innerHTML,w.main.document.body.style.display="none",history.pushState(null,d.title,modx.getActionFromUrl(w.location.search,2)?modx.MODX_MANAGER_URL:"#"+w.location.search),w.onpopstate=function(){history.go(1)},modx.popup({type:"warning",title:"MODX :: Alert",position:"top center alertQuit",content:t,wrap:"body"}),modx.getLockedElements(modx.getActionFromUrl(this.url),modx.main.getQueryVariable("id",this.url),function(e){e?(o.page.close(),modx.tree.restoreTree()):(w.main.location.href=modx.MODX_MANAGER_URL+o.url,w.history.replaceState(null,d.title,modx.getActionFromUrl(o.url,2)?modx.MODX_MANAGER_URL:"#"+o.url))}),modx.main.stopWork()):modx.getActionFromUrl(this.url,2)||~this.saveAndCloseActions.indexOf(modx.getActionFromUrl(this.url))&&parseInt(modx.main.getQueryVariable("r",this.url))?this.close(e):this.olduid!==this.uid&&d.getElementById("evo-tab-"+this.uid)?(this.close(e),d.getElementById("evo-tab-"+this.uid).show()):(this.title=w.main.document.body.querySelectorAll("h1")[0]&&w.main.document.body.querySelectorAll("h1")[0].innerHTML||this.title,this.title&&"home"!==this.uid&&(this.tab.innerHTML=''+this.title+' × '),this.page.id="evo-tab-page-"+this.uid,this.tab.id="evo-tab-"+this.uid,this.tab.classList.remove("changed"),this.show(),modx.main.onload(e),w.main.document.addEventListener("click",function e(t){void 0!==t.view.documentDirty&&t.view.documentDirty&&!o.tab.classList.contains("changed")&&(o.tab.classList.add("changed"),this.removeEventListener(t.type,e,!1))},!1),w.main.document.addEventListener("keyup",function e(t){void 0!==t.view.documentDirty&&t.view.documentDirty&&!o.tab.classList.contains("changed")&&(o.tab.classList.add("changed"),this.removeEventListener(t.type,e,!1))},!1))},show:function(){modx.tabs.selected=this.row.querySelector(".selected"),modx.tabs.selected&&modx.tabs.selected!==this.tab&&(d.getElementById(modx.tabs.selected.id.replace("tab","tab-page")).classList.remove("show"),modx.tabs.selected.classList.remove("selected")),this.page.classList.add("show"),this.tab.classList.add("selected"),modx.tabs.selected=this.tab,w.main=this.page.firstElementChild.contentWindow,w.history.replaceState(null,w.main.document.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:"#"+w.main.location.search),modx.tree.setItemToChange(),modx.main.tabRow.scroll(this.row,this.tab,350)},close:function(e){var t=this.page.firstElementChild.contentWindow.documentDirty,o=!!this.page.firstElementChild.contentWindow.checkDirt;(t&&o&&confirm(this.page.firstElementChild.contentWindow.checkDirt(e))||!t)&&(modx.tabs.selected===this.tab&&(tree.ca="open"),modx.tabs.selected=this.tab.classList.contains("selected")?this.tab.previousElementSibling:this.row.querySelector(".selected"),this.page.parentNode.removeChild(this.page),this.row.removeChild(this.tab),modx.tabs.selected.show())},select:function(e){var t;"tab-close"===e.target.className?this.close(e):modx.tabs.selected===this.tab?(t=this).timer?(clearTimeout(this.timer),this.timer=null,w.main.location.reload()):this.timer=setTimeout(function(){t.timer=null},250):this.show()},setDocPublished:function(){var e=w.main.document.getElementsByName("publishedcheck")[0];e&&(e.checked=61===this.action,w.main.document.getElementsByName("published")[0].value=+e.checked),modx.getActionFromUrl(w.main.location.search,3)&&w.main.location.reload()}},modx.config.global_tabs){if(void 0===e.currentTarget)return new t(e);var o=e;0===o.button&&o.target&&("A"===o.target.tagName&&"main"===o.target.target||o.target.parentNode&&"A"===o.target.parentNode.tagName&&"main"===o.target.parentNode.target)&&(e="A"===o.target.tagName&&o.target||"A"===o.target.parentNode.tagName&&o.target.parentNode,o.shiftKey?modx.openWindow({url:e.href}):modx.tabs({url:e.href,title:e.innerHTML}),o.preventDefault())}else e.url&&(w.main?w.main.frameElement.src=e.url:modx.openWindow(e.url))},popup:function(t){if("object"==typeof t&&(t.url||t.content||t.text)){var e,o,i={addclass:"",animation:"fade",content:t.content||t.text||"",clickclose:0,closeall:0,data:"",dataType:"document",delay:5e3,draggable:!1,event:null,height:"auto",hide:1,hover:1,icon:"",iframe:"iframe",margin:".5rem",maxheight:"",method:"GET",overlay:0,overlayclose:0,position:"center",resize:!1,selector:"",showclose:1,target:"main",uid:"",type:"default",title:"",url:"",width:"20rem",wrap:t.wrap||w.main.document.body,zIndex:10500,w:null,show:function(){~i.position.indexOf("center")&&(i.event?(i.el.style.left=i.event.clientX+i.mt+"px",i.el.style.bottom=i.w.innerHeight-i.el.offsetHeight-i.event.clientY+i.mt+"px"):(i.el.style.left=/(%)/.test(i.width)?(100-parseInt(i.width))/2-i.mt/(i.w.innerWidth/100)+"%":(i.w.innerWidth-i.el.offsetWidth)/2-i.mt+"px",i.el.style.bottom=/(%)/.test(i.height)?(100-parseInt(i.height))/2-i.mt/(i.w.innerHeight/100)+"%":(i.w.innerHeight-i.el.offsetHeight-i.wrap.offsetTop)/2-i.mt+"px")),~i.position.indexOf("left")&&(i.el.style.left=0),~i.position.indexOf("right")?i.el.style.right=0:i.el.style.right="auto",~i.position.indexOf("top")?(i.el.style.top=0,i.el.style.bottom=""):i.el.style.top="auto",~i.position.indexOf("bottom")&&(i.el.style.bottom=0),i.calc(),i.el.className+=" in",i.showclose&&(i.el.querySelector(".close").onclick=i.close),i.hide&&(i.el.timer=setTimeout(function(){clearTimeout(i.el.timer),i.close()},i.delay)),i.hover&&(i.el.onmouseenter=function(){clearTimeout(i.el.timer)},i.el.onmouseleave=i.close),i.overlayclose&&i.o&&(i.o.onclick=i.close),i.clickclose&&(i.el.onclick=i.close),i.draggable&&modx.dragging(i.el,{wrap:i.wrap,resize:i.resize})},close:function(e){var t;i.event=e||i.event||w.event,i.url&&"iframe"===i.iframe?!i.wrap.ownerDocument.querySelectorAll("."+i.className+".in")||((t=i.el.lastElementChild.firstElementChild.contentWindow.documentDirty)&&confirm(i.el.lastElementChild.firstElementChild.contentWindow.checkDirt(i.event))||!t)&&(i.el.classList.remove("in"),i.animation||i.el.classList.remove("show"),i.calc(1),i.o&&i.o.parentNode&&(i.o.parentNode.removeChild(i.o),i.wrap.style.overflow=""),i.el.timer=setTimeout(function(){clearTimeout(i.el.timer),i.el.parentNode&&i.el.parentNode.removeChild(i.el)},200)):(i.el.classList.remove("in"),i.animation||i.el.classList.remove("show"),i.calc(1),i.o&&i.o.parentNode&&(i.o.parentNode.removeChild(i.o),i.wrap.style.overflow=""),i.el.timer=setTimeout(function(){clearTimeout(i.el.timer),i.el.parentNode&&i.el.parentNode.removeChild(i.el)},200)),"function"==typeof i.onclose&&i.onclose(e,i.el)},calc:function(e){var t=i.wrap.ownerDocument.querySelectorAll("."+i.className+'.in[data-position="'+i.el.dataset.position+'"]');if(t&&t.length){i.els=[];for(var o=0;o '),i.title&&(i.header=document.createElement("div"),"none"!==i.icon&&(i.header.innerHTML+=' '),i.header.innerHTML+=i.title,i.header.className="evo-popup-header",i.el.appendChild(i.header)),i.el.innerHTML+='
',i.wrap.appendChild(i.el),i.mt=parseFloat(getComputedStyle(i.el).marginTop),i.maxheight&&(i.maxheight=/(%)/.test(i.maxheight)?(i.w.innerHeight-i.el.offsetHeight-i.mt)/100*parseInt(i.maxheight):i.maxheight,i.el.lastChild.style.overflowY="auto",i.el.lastChild.style.maxHeight=i.maxheight+"px"),i.url?(i.draggable=1,"iframe"===i.iframe?(i.resize=1,i.uid=modx.urlToUid(t.url),i.el.className+=" "+i.addclass+" "+i.className+"-iframe",i.el.id="evo-popup-"+i.uid,d.getElementById("mainloader").className="show",i.frame=d.createElement("iframe"),i.frame.width="100%",i.frame.height="100%",i.frame.frameBorder="0",i.frame.src=i.url,i.frame.onload=function(e){e.target.contentWindow.opener=i.w,t.url=e.target.contentWindow.location.href,i.uid=modx.urlToUid(t.url),(i.event=e).target.contentWindow.__alertQuit?(modx.popup({type:"warning",title:"MODX :: Alert",position:"top center alertQuit",content:e.target.contentWindow.document.body.querySelector("p").innerHTML}),e.target.contentWindow.document.body.innerHTML="",e.target.contentWindow.alert=function(){}):modx.getActionFromUrl(t.url,2)||1 ',this.classDrag&&this.el.classList.add(this.classDrag),this.classResize&&this.el.classList.add(this.classResize),this.el.insertBefore(this.borders,this.el.firstChild),this.handler&&this.el.getElementsByClassName(this.handler)[0]&&(this.handler=this.el.getElementsByClassName(this.handler)[0],this.handlerHeight=this.handler.offsetHeight),this.el.onmousedown=function(e){s.mousedown(e)},this.el.ontouchstart=function(e){s.mousedown(e.changedTouches[0])},this.wrap.addEventListener("mousemove",function(e){s.calc(e)},!1),this.wrap.addEventListener("touchmove",function(e){s.calc(e.changedTouches[0])},!1)},this.dragging.init.prototype={mousedown:function(e){var t,o,i,s;e.target.classList.contains("close")||(e=document.all?window.event:e,t=this,o=(document.all?window.event:e).clientX,i=(document.all?window.event:e).clientY,s=w.getComputedStyle(this.el),this.elmX=o-this.el.offsetLeft+parseInt(s.marginLeft),this.elmY=i-this.el.offsetTop+parseInt(s.marginTop),this.el.position=this.el.getBoundingClientRect(),this.el.style.position="fixed",this.el.style.transitionDuration="0s",this.el.style.webkitTransitionDuration="0s",this.el.style.left=this.el.offsetLeft-parseInt(s.marginLeft)+"px",this.el.style.top=this.el.offsetTop-parseInt(s.marginTop)+"px",this.el.style.right="auto",this.el.style.bottom="auto",this.el.style.width=this.el.position.width+"px",this.el.style.height=this.el.position.height+"px",e.target.parentNode===this.borders?(this.isresize=this.resize,this.el.classList.add("is-resize")):(!this.handler||this.handler&&e.target===this.handler)&&(this.isdrag=!0,this.el.classList.add("is-drag")),"function"==typeof this.start&&this.onstart(e,this.el),e.preventDefault?e.preventDefault():document.onselectstart=function(){return!1},this.wrap.onmousemove=function(e){t.mousemove(e)},this.wrap.ontouchmove=function(e){t.mousemove(e.changedTouches[0]),e.stopPropagation()},this.wrap.onmouseup=function(e){t.mouseup(e)},this.wrap.ontouchend=function(e){t.mouseup(e.changedTouches[0]),e.stopPropagation()})},mousemove:function(e){var t,o=(document.all?window.event:e).clientX,i=(document.all?window.event:e).clientY;this.isresize?(this.onRight&&(this.el.style.width=Math.max(o-this.el.position.left+(this.el.position.width-this.x),this.minWidth)+"px"),this.onBottom&&(this.el.style.height=Math.max(i-this.el.position.top+(this.el.position.height-this.y),this.minHeight)+"px"),this.onLeft&&(this.width=Math.max(this.el.position.left-o+this.el.position.width+this.x,this.minWidth),this.width>this.minWidth&&(this.el.style.width=this.width+"px",this.el.style.left=o-this.elmX+"px")),!this.onTop||(t=Math.max(this.el.position.top-i+this.el.position.height+this.y,this.minHeight))>this.minHeight&&(this.el.style.height=t+"px",this.el.style.top=i-this.elmY+"px"),"function"==typeof this.onresize&&this.onresize(e,this.el)):this.isdrag&&(this.el.style.opacity=this.opacity,this.el.style.left=o-this.elmX+"px",this.el.style.top=i-this.elmY+"px","function"==typeof this.drag&&this.ondrag(e,this.el))},mouseup:function(e){(this.isdrag||this.isresize)&&(this.el.classList.remove("is-resize"),this.el.classList.remove("is-drag"),this.el.style.opacity="",this.el.style.transitionDuration="",this.el.style.webkitTransitionDuration="",this.el.position=this.el.getBoundingClientRect(),this.isdrag=!1,this.isresize=!1,this.wrap.onmousemove=null,this.wrap.onselectstart=null,"function"==typeof this.stop&&this.onstop(e,this.el))},calc:function(e){this.isresize||this.isdrag||(this.x=e.clientX-this.el.offsetLeft,this.y=e.clientY-this.el.offsetTop,this.resize?(this.onTop=this.y=this.el.offsetWidth-this.border,this.onBottom=this.y>=this.el.offsetHeight-this.border,this.onRight&&this.onBottom||this.onLeft&&this.onTop?this.el.style.cursor="nwse-resize":this.onRight&&this.onTop||this.onBottom&&this.onLeft?this.el.style.cursor="nesw-resize":this.onRight||this.onLeft?this.el.style.cursor="ew-resize":this.onBottom||this.onTop?this.el.style.cursor="ns-resize":0=this.border?this.el.style.cursor="move":this.el.style.cursor="default"):0=this.border&&(this.el.style.cursor="move"))}},new this.dragging.init(e,t)},setTypeIcon:function(e){var t="";switch(this.typesactions[e]){case 1:t="fa fa-newspaper-o";break;case 2:t="fa fa-list-alt";break;case 3:t="fa fa-th-large";break;case 4:t="fa fa-code";break;case 5:t="fa fa-plug";break;case 6:t="fa fa-cube";break;case 7:t="fa fa-pencil-square-o";break;default:t="fa fa-circle"}return t},animate:function(n,a,r,l){if(n&&a&&"object"==typeof a){var e="px";"function"==typeof r&&(l=r,r=null),r=r||64,l="function"!=typeof l?function(){}:l;var t,o,i=getComputedStyle(n);for(t in a)a.hasOwnProperty(t)&&("opacity"===t&&(e=""),o=i[t],"scrollLeft"===t?o=n.scrollLeft:"scrollTop"===t&&(o=n.scrollTop),a[t]={start:parseInt(o),end:a[t],unit:e});var d=performance.now();requestAnimationFrame(function e(t){var o,i,s=(t
-
-
- [(site_name)] (Evolution CMS Manager Login)
-
-
-
-
-
-
-
-
-
-
-
-
-
- [+OnManagerLoginFormPrerender+]
-
-
-
-
-
-
- [+username+]
-
-
-
-
-
- [+password+]
-
-
-
-
-
-
[+login_captcha_message+]
-
[+captcha_image+]
- [+captcha_input+]
-
-
-
-
-
- [+remember_username+]
- [+login_button+]
-
-
-
- [+OnManagerLoginFormRender+]
-
-
-
-
-
-
-
-
© 2005-2020 by the
EVO .
EVO ™ is licensed under the GPL.
-
-
-
-
-
-
-
-
-
-
+
+
+
+ [(site_name)] (Evolution CMS Manager Login)
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [+OnManagerLoginFormPrerender+]
+
+
+
+
+
+
+ [+username+]
+
+
+
+
+
+ [+password+]
+
+
+
+
+
+
[+login_captcha_message+]
+
[+captcha_image+]
+ [+captcha_input+]
+
+
+
+
+
+ [+remember_username+]
+ [+login_button+]
+
+
+
+ [+OnManagerLoginFormRender+]
+
+
+
+
+
+
+
+
© 2005-2023 by the
EVO .
EVO ™ is licensed under the GPL.
+
+
+
+
+
+
+
+
+
+
diff --git a/manager/media/style/default/style.php b/manager/media/style/default/style.php
index e1d0021aea..e68ebf9ba5 100755
--- a/manager/media/style/default/style.php
+++ b/manager/media/style/default/style.php
@@ -1,515 +1,529 @@
-config['manager_theme']/style.php
- * Function: Manager style variables for images and icons.
- * Encoding: UTF-8
- * Credit: icons by Mark James of FamFamFam http://www.famfamfam.com/lab/icons/
- * Date: 18-Mar-2010
- * Version: 1.1
- * MODX version: 1.0.3
- */
-$style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/';
-$modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php';
-if(empty($modx->config['lang_code'])) {
- global $modx_lang_attribute;
- $modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
-}
-
-if(isset($_GET['a']) && $_GET['a'] == 2) {
- include_once('welcome.php');
-}
-
-// Favicon
-$_style['favicon'] = (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . $modx->config['manager_theme'] . '/images/favicon.ico');
-
-//Main Menu
-$_style['menu_search'] = ' ';
-$_style['menu_preview_site'] = ' ';
-$_style['menu_new_resource'] = ' ';
-$_style['menu_system'] = ' ';
-$_style['menu_user'] = ' ';
-// full screen
-$_style['menu_expand'] = 'fa-expand';
-$_style['menu_compress'] = 'fa-compress';
-//help toggle
-$_style['icons_help'] = ' ';
-//pages
-$_style['page_settings'] = ' ';
-$_style['page_shedule'] = ' ';
-$_style['page_eventlog'] = ' ';
-$_style['page_manager_logs'] = ' ';
-$_style['page_sys_info'] = ' ';
-$_style['page_help'] = ' ';
-$_style['page_change_password'] = ' ';
-$_style['page_logout'] = ' ';
-
-// Tree Menu Toolbar
-$_style['add_doc_tree'] = ' ';
-$_style['add_weblink_tree'] = ' ';
-$_style['collapse_tree'] = ' ';
-$_style['empty_recycle_bin'] = ' ';
-$_style['empty_recycle_bin_empty'] = ' ';
-$_style['expand_tree'] = ' ';
-$_style['hide_tree'] = ' ';
-$_style['refresh_tree'] = ' ';
-$_style['show_tree'] = $style_path.'tree/expand.png';
-$_style['sort_tree'] = ' ';
-$_style['sort_menuindex'] = ' ';
-$_style['element_management'] = ' ';
-$_style['images_management'] = ' ';
-$_style['files_management'] = ' ';
-$_style['email'] = ' ';
-
-//Tree Contextual Menu Popup
-$_style['ctx_new_document'] = 'fa fa-file-o';
-$_style['ctx_edit_document'] = 'fa fa-pencil-square-o';
-$_style['ctx_move_document'] = 'fa fa-arrows';
-$_style['ctx_resource_duplicate'] = 'fa fa-clone';
-$_style['ctx_sort_menuindex'] = 'fa fa-sort-numeric-asc';
-$_style['ctx_publish_document'] = 'fa fa-check';
-$_style['ctx_unpublish_resource'] = 'fa fa-close';
-$_style['ctx_delete'] = 'fa fa-trash';
-$_style['ctx_undelete_resource'] = 'fa fa-undo';
-$_style['ctx_weblink'] = 'fa fa-link';
-$_style['ctx_resource_overview'] = 'fa fa-info';
-$_style['ctx_preview_resource'] = 'fa fa-eye';
-
-// Tree Icons
-$_style['tree_deletedpage'] = " ";
-$_style['tree_folder'] = $style_path.'tree/folder-close-alt.png'; /* folder.png */
-$_style['tree_folderopen'] = $style_path.'tree/folder-open-alt.png'; /* folder-open.png */
-$_style['tree_globe'] = $style_path.'tree/globe.png';
-$_style['tree_folder_new'] = " "; /* folder.png */
-$_style['tree_folderopen_new'] = " "; /* folder-open.png */
-$_style['tree_folder_secure'] = " ";
-$_style['tree_folderopen_secure'] = " ";
-$_style['tree_linkgo'] = " ";
-$_style['tree_page'] = " ";
-$_style['tree_page_home'] = " ";
-$_style['tree_page_404'] = " ";
-$_style['tree_page_hourglass'] = " ";
-$_style['tree_page_info'] = " ";
-$_style['tree_page_blank'] = " ";
-$_style['tree_page_css'] = " ";
-$_style['tree_page_html'] = " ";
-$_style['tree_page_xml'] = " ";
-$_style['tree_page_js'] = " ";
-$_style['tree_page_rss'] = " ";
-$_style['tree_page_pdf'] = " ";
-$_style['tree_page_word'] = " ";
-$_style['tree_page_excel'] = " ";
-
-$_style['tree_minusnode'] = " ";//$style_path.'tree/angle-down.png';
-$_style['tree_plusnode'] = " ";//$style_path.'tree/angle-right.png';
-$_style['tree_weblink'] = $style_path.'tree/link.png';
-$_style['tree_preview_resource'] = " ";//$style_path.'icons/eye.png';
-
-$_style['tree_showtree'] = ' ';
-$_style['tree_working'] = ' ';
-$_style['tree_info'] = ' ';
-
-$_style['tree_page_secure'] = " ";
-$_style['tree_page_blank_secure'] = " ";
-$_style['tree_page_css_secure'] = " ";
-$_style['tree_page_html_secure'] = " ";
-$_style['tree_page_xml_secure'] = " ";
-$_style['tree_page_js_secure'] = " ";
-$_style['tree_page_rss_secure'] = " ";
-$_style['tree_page_pdf_secure'] = " ";
-$_style['tree_page_word_secure'] = " ";
-$_style['tree_page_excel_secure'] = " ";
-
-//search
-$_style['icons_external_link'] = ' ';
-
-//View Resource data
-$_style['icons_new_document'] = 'fa fa-file-o';
-$_style['icons_new_weblink'] = 'fa fa-link';
-$_style['icons_move_document'] = 'fa fa-arrows';
-$_style['icons_publish_document'] = 'fa fa-check';
-$_style['icons_unpublish_resource'] = 'fa fa-close';
-$_style['icons_delete_resource'] = 'fa fa-trash';
-$_style['icons_undelete_resource'] = 'fa fa-undo';
-$_style['icons_resource_overview'] = 'fa fa-info';
-$_style['icons_edit_resource'] = 'fa fa-pencil-square-o';
-//context menu
-$_style['icons_resource_duplicate'] = $style_path.'icons/clone.png';
-$_style['icons_edit_document'] = $style_path.'icons/save.png';
-$_style['icons_delete_document'] = $style_path.'icons/trash.png';
-//locks
-$_style['icons_preview_resource'] = $style_path.'icons/eye.png';//$style_path.'icons/eye.png';
-$_style['icons_secured'] = ' ';//$style_path.'icons/lock.png';
-
-//file manager icons
-$_style['files_save'] = 'fa fa-floppy-o';
-$_style['files_folder'] = 'fa fa-folder-o';
-$_style['files_deleted_folder'] = 'fa fa-folder-o';
-$_style['files_folder-open'] = 'fa fa-folder-open-o';
-$_style['files_page_php'] = 'fa fa-file-o';
-$_style['files_page_html'] = 'fa fa-file-o';
-$_style['files_cancel'] = 'fa fa-times-circle';
-$_style['files_top'] = 'fa fa-folder-open-o';
-$_style['files_add'] = 'fa fa-plus-circle';
-$_style['files_upload'] = 'fa fa-upload';
-$_style['files_delete'] = 'fa fa-trash';
-$_style['files_duplicate'] = 'fa fa-clone';
-$_style['files_rename'] = 'fa fa-i-cursor';
-$_style['files_view'] = 'fa fa-eye';
-$_style['files_download'] = 'fa fa-download';
-$_style['files_unzip'] = 'fa fa-file-archive-o';
-$_style['files_edit'] = 'fa fa-pencil-square-o';
-
-//Action buttons
-$_style['actions_save'] = 'fa fa-floppy-o';
-$_style['actions_duplicate'] = 'fa fa-clone';
-$_style['actions_delete'] = 'fa fa-trash';
-$_style['actions_cancel'] = 'fa fa-times-circle';
-$_style['actions_close'] = 'fa fa-times-circle';
-$_style['actions_add'] = 'fa fa-plus-circle';
-$_style['actions_preview'] = 'fa fa-eye';
-$_style['actions_run'] = 'fa fa-play';
-$_style['actions_stop'] = 'fa fa-stop';
-$_style['actions_new'] = 'fa fa-plus-circle';
-$_style['actions_help'] = 'fa fa-question-circle';
-$_style['actions_sort'] = 'fa fa-sort';
-$_style['actions_options'] = 'fa fa-check-square';
-$_style['actions_categories'] = 'fa fa-folder-open';
-$_style['actions_search'] = 'fa fa-search';
-$_style['actions_file'] = 'fa fa-file-o';
-$_style['actions_folder'] = 'fa fa-folder-o';
-$_style['actions_folder_open'] = 'fa fa-folder-open-o';
-$_style['actions_calendar'] = 'fa fa-calendar';
-$_style['actions_calendar_delete'] = 'fa fa-calendar-times-o';
-$_style['actions_angle_up'] = 'fa fa-angle-up';
-$_style['actions_angle_down'] = 'fa fa-angle-down';
-$_style['actions_angle_left'] = 'fa fa-angle-left';
-$_style['actions_angle_right'] = 'fa fa-angle-right';
-$_style['actions_chain'] = 'fa fa-chain';
-$_style['actions_chain_broken'] = 'fa fa-chain-broken';
-$_style['actions_edit'] = 'fa fa-edit';
-$_style['actions_move'] = 'fa fa-arrows';
-$_style['actions_pencil'] = 'fa fa-pencil';
-$_style['actions_reply'] = 'fa fa-reply';
-$_style['actions_plus'] = 'fa fa-plus';
-$_style['actions_refresh'] = 'fa fa-refresh';
-$_style['actions_error'] = 'fa fa-times-circle';
-$_style['actions_info'] = 'fa fa-info-circle';
-$_style['actions_triangle'] = 'fa fa-exclamation-triangle';
-$_style['actions_table'] = 'fa fa-table';
-
-//for back compatibility
-
-$_style['icons_save'] = $style_path.'icons/save.png';
-$_style['icons_delete'] = $style_path.'icons/trash.png';
-$_style['icons_deleted_folder'] = $style_path.'tree/deletedfolder.png';
-$_style['icons_unzip'] = $style_path.'icons/download-alt.png';
-
-
-// Indicators
-$_style['icons_tooltip'] = 'fa fa-question-circle';
-$_style['icons_tooltip_over'] = $style_path.'icons/question-sign.png';
-$_style['icons_cal'] = $style_path.'icons/calendar.png';
-$_style['icons_cal_nodate'] = $style_path.'icons/calendar.png';
-$_style['icons_set_parent'] = $style_path.'icons/folder-open.png';
-
-//modules
-$_style['icons_module'] = 'fa fa-cube';
-$_style['icons_modules'] = 'fa fa-cubes'; //$style_path.'icons/modules.png';
-$_style['icons_run'] = $style_path.'icons/play.png';
-
-//users and webusers
-$_style['icons_user'] = 'fa fa-user-circle-o'; //$style_path.'icons/user.png';
-$_style['icons_web_user'] = 'fa fa-user'; //$style_path.'icons/user.png';
-
-//Messages
-$_style['icons_message_unread'] = $style_path.'icons/email.png';
-$_style['icons_message_forward'] = $style_path.'icons/forward.png';
-$_style['icons_message_reply'] = $style_path.'icons/reply.png';
-
-// Icons
-$_style['icons_add'] = $style_path.'icons/add.png';
-$_style['icons_cancel'] = $style_path.'icons/cancel.png';
-$_style['icons_close'] = $style_path.'icons/stop.png';
-$_style['icons_refresh'] = $style_path.'icons/refresh.png';
-$_style['icons_table'] = $style_path.'icons/table.png';
-
-// top bar
-$_style['icons_loading_doc_tree'] = $style_path.'icons/info-sign.png';
-$_style['icons_mail'] = $style_path.'icons/email.png';
-$_style['icons_working'] = $style_path.'icons/exclamation.png';
-
-//event log
-$_style['icons_event1'] = $style_path.'icons/event1.png';
-$_style['icons_event2'] = $style_path.'icons/event2.png';
-$_style['icons_event3'] = $style_path.'icons/event3.png';
-
-
-//nowhere in the manager
-$_style['icons_folder'] = $style_path.'icons/folder.png';
-$_style['icons_email'] = $style_path.'icons/email.png';
-$_style['icons_home'] = $style_path.'icons/home.png';
-$_style['icons_sort_menuindex'] = $style_path.'icons/sort_index.png';
-$_style['icons_weblink'] = $style_path.'icons/world_link.png';
-$_style['icons_tab_preview'] = $style_path.'icons/preview.png'; // Tabs
-$_style['icons_information'] = $style_path.'icons/info-sign.png';
-
-
-// Miscellaneous
-$_style['ajax_loader'] = ''.$_lang['loading_page'].'
';
-$_style['tx'] = $style_path.'misc/_tx_.gif';
-$_style['icons_right_arrow'] = $style_path.'icons/arrow-right.png';
-$_style['fade'] = $style_path.'misc/fade.gif';
-$_style['ed_save'] = $style_path.'misc/ed_save.gif';
-
-// actions buttons templates
-$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : '';
-if (!empty($modx->config['global_tabs']) && !isset($_SESSION['stay'])) {
- $_REQUEST['stay'] = 2;
-}
-if (isset($_REQUEST['stay'])) {
- $_SESSION['stay'] = $_REQUEST['stay'];
-} else if (isset($_SESSION['stay'])) {
- $_REQUEST['stay'] = $_SESSION['stay'];
-}
-$stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : '';
-$addnew = 0;
-$run = 0;
-switch($action) {
- case '3':
- case '4':
- case '27':
- case '72':
- if($modx->hasPermission('new_document')) {
- $addnew = 1;
- }
- break;
- case '16':
- case '19':
- if($modx->hasPermission('new_template')) {
- $addnew = 1;
- }
- break;
- case '300':
- case '301':
- if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
- $addnew = 1;
- }
- break;
- case '77':
- case '78':
- if($modx->hasPermission('new_chunk')) {
- $addnew = 1;
- }
- break;
- case '22':
- case '23':
- if($modx->hasPermission('new_snippet')) {
- $addnew = 1;
- }
- break;
- case '101':
- case '102':
- if($modx->hasPermission('new_plugin')) {
- $addnew = 1;
- }
- break;
- case '106':
- case '107':
- case '108':
- if($modx->hasPermission('new_module')) {
- $addnew = 1;
- }
- if($modx->hasPermission('exec_module')) {
- $run = 1;
- }
- break;
- case '88':
- if($modx->hasPermission('new_web_user')) {
- $addnew = 1;
- }
- break;
-}
-
-$disabled = ($action == '19' || $action == '300' || $action == '77' || $action == '23' || $action == '101' || $action == '4' || $action == '72' || $action == '87' || $action == '11' || $action == '107' || $action == '38') ? ' disabled' : '';
-
-$_style['actionbuttons'] = array(
- 'dynamic' => array(
- 'document' => '',
- 'user' => '',
- 'element' => '',
- 'newmodule' => ($addnew ? '' : ''),
- 'close' => '',
- 'save' => '',
- 'savedelete' => '',
- 'cancel' => '',
- 'canceldelete' => '',
- ),
- 'static' => array(
- 'document' => '',
- 'cancel' => '',
- )
-);
+config['manager_theme']/style.php
+ * Function: Manager style variables for images and icons.
+ * Encoding: UTF-8
+ * Credit: icons by Mark James of FamFamFam http://www.famfamfam.com/lab/icons/
+ * Date: 18-Mar-2010
+ * Version: 1.1
+ * MODX version: 1.0.3
+ */
+$style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/';
+$modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php';
+if(empty($modx->config['lang_code'])) {
+ global $modx_lang_attribute;
+ $modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
+}
+
+if (isset($_GET['a']) && $_GET['a'] == 2) {
+ include_once('welcome.php');
+}
+
+// Favicon
+$_style['favicon'] = (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . $modx->config['manager_theme'] . '/images/favicon.ico');
+
+// Icons
+$_style['icon_size_2x'] = ' fa-2x';
+$_style['icon_size_fix'] = ' fa-fw';
+$_style['icon_spin'] = ' fa-spin';
+$_style['icon_template'] = 'fa fa-newspaper-o';
+$_style['icon_tv'] = 'fa fa-list-alt';
+$_style['icon_chunk'] = 'fa fa-th-large';
+$_style['icon_code'] = 'fa fa-code';
+$_style['icon_plugin'] = 'fa fa-plug';
+$_style['icon_elements'] = 'fa fa-th';
+$_style['icon_edit'] = 'fa fa-edit';
+$_style['icon_circle'] = 'fa fa-circle';
+$_style['icon_refresh'] = 'fa fa-refresh';
+
+//Main Menu
+$_style['menu_search'] = ' ';
+$_style['menu_preview_site'] = ' ';
+$_style['menu_new_resource'] = ' ';
+$_style['menu_system'] = ' ';
+$_style['menu_user'] = ' ';
+// full screen
+$_style['menu_expand'] = 'fa-expand';
+$_style['menu_compress'] = 'fa-compress';
+//help toggle
+$_style['icons_help'] = ' ';
+//pages
+$_style['page_settings'] = ' ';
+$_style['page_shedule'] = ' ';
+$_style['page_eventlog'] = ' ';
+$_style['page_manager_logs'] = ' ';
+$_style['page_sys_info'] = ' ';
+$_style['page_help'] = ' ';
+$_style['page_change_password'] = ' ';
+$_style['page_logout'] = ' ';
+
+// Tree Menu Toolbar
+$_style['add_doc_tree'] = ' ';
+$_style['add_weblink_tree'] = ' ';
+$_style['collapse_tree'] = ' ';
+$_style['empty_recycle_bin'] = ' ';
+$_style['empty_recycle_bin_empty'] = ' ';
+$_style['expand_tree'] = ' ';
+$_style['hide_tree'] = ' ';
+$_style['refresh_tree'] = ' ';
+$_style['show_tree'] = $style_path.'tree/expand.png';
+$_style['sort_tree'] = ' ';
+$_style['sort_menuindex'] = ' ';
+$_style['element_management'] = ' ';
+$_style['images_management'] = ' ';
+$_style['files_management'] = ' ';
+$_style['email'] = ' ';
+
+//Tree Contextual Menu Popup
+$_style['ctx_new_document'] = 'fa fa-file-o';
+$_style['ctx_edit_document'] = 'fa fa-pencil-square-o';
+$_style['ctx_move_document'] = 'fa fa-arrows';
+$_style['ctx_resource_duplicate'] = 'fa fa-clone';
+$_style['ctx_sort_menuindex'] = 'fa fa-sort-numeric-asc';
+$_style['ctx_publish_document'] = 'fa fa-check';
+$_style['ctx_unpublish_resource'] = 'fa fa-close';
+$_style['ctx_delete'] = 'fa fa-trash';
+$_style['ctx_undelete_resource'] = 'fa fa-undo';
+$_style['ctx_weblink'] = 'fa fa-link';
+$_style['ctx_resource_overview'] = 'fa fa-info';
+$_style['ctx_preview_resource'] = 'fa fa-eye';
+
+// Tree Icons
+$_style['tree_deletedpage'] = " ";
+$_style['tree_folder'] = $style_path.'tree/folder-close-alt.png'; /* folder.png */
+$_style['tree_folderopen'] = $style_path.'tree/folder-open-alt.png'; /* folder-open.png */
+$_style['tree_globe'] = $style_path.'tree/globe.png';
+$_style['tree_folder_new'] = " "; /* folder.png */
+$_style['tree_folderopen_new'] = " "; /* folder-open.png */
+$_style['tree_folder_secure'] = " ";
+$_style['tree_folderopen_secure'] = " ";
+$_style['tree_linkgo'] = " ";
+$_style['tree_page'] = " ";
+$_style['tree_page_home'] = " ";
+$_style['tree_page_404'] = " ";
+$_style['tree_page_hourglass'] = " ";
+$_style['tree_page_info'] = " ";
+$_style['tree_page_blank'] = " ";
+$_style['tree_page_css'] = " ";
+$_style['tree_page_html'] = " ";
+$_style['tree_page_xml'] = " ";
+$_style['tree_page_js'] = " ";
+$_style['tree_page_rss'] = " ";
+$_style['tree_page_pdf'] = " ";
+$_style['tree_page_word'] = " ";
+$_style['tree_page_excel'] = " ";
+
+$_style['tree_minusnode'] = " ";//$style_path.'tree/angle-down.png';
+$_style['tree_plusnode'] = " ";//$style_path.'tree/angle-right.png';
+$_style['tree_weblink'] = $style_path.'tree/link.png';
+$_style['tree_preview_resource'] = " ";//$style_path.'icons/eye.png';
+
+$_style['tree_showtree'] = ' ';
+$_style['tree_working'] = ' ';
+$_style['tree_info'] = ' ';
+
+$_style['tree_page_secure'] = " ";
+$_style['tree_page_blank_secure'] = " ";
+$_style['tree_page_css_secure'] = " ";
+$_style['tree_page_html_secure'] = " ";
+$_style['tree_page_xml_secure'] = " ";
+$_style['tree_page_js_secure'] = " ";
+$_style['tree_page_rss_secure'] = " ";
+$_style['tree_page_pdf_secure'] = " ";
+$_style['tree_page_word_secure'] = " ";
+$_style['tree_page_excel_secure'] = " ";
+
+//search
+$_style['icons_external_link'] = ' ';
+
+//View Resource data
+$_style['icons_new_document'] = 'fa fa-file-o';
+$_style['icons_new_weblink'] = 'fa fa-link';
+$_style['icons_move_document'] = 'fa fa-arrows';
+$_style['icons_publish_document'] = 'fa fa-check';
+$_style['icons_unpublish_resource'] = 'fa fa-close';
+$_style['icons_delete_resource'] = 'fa fa-trash';
+$_style['icons_undelete_resource'] = 'fa fa-undo';
+$_style['icons_resource_overview'] = 'fa fa-info';
+$_style['icons_edit_resource'] = 'fa fa-pencil-square-o';
+//context menu
+$_style['icons_resource_duplicate'] = $style_path.'icons/clone.png';
+$_style['icons_edit_document'] = $style_path.'icons/save.png';
+$_style['icons_delete_document'] = $style_path.'icons/trash.png';
+//locks
+$_style['icons_preview_resource'] = $style_path.'icons/eye.png';//$style_path.'icons/eye.png';
+$_style['icons_secured'] = ' ';//$style_path.'icons/lock.png';
+
+//file manager icons
+$_style['files_save'] = 'fa fa-floppy-o';
+$_style['files_folder'] = 'fa fa-folder-o';
+$_style['files_deleted_folder'] = 'fa fa-folder-o';
+$_style['files_folder-open'] = 'fa fa-folder-open-o';
+$_style['files_page_php'] = 'fa fa-file-o';
+$_style['files_page_html'] = 'fa fa-file-o';
+$_style['files_cancel'] = 'fa fa-times-circle';
+$_style['files_top'] = 'fa fa-folder-open-o';
+$_style['files_add'] = 'fa fa-plus-circle';
+$_style['files_upload'] = 'fa fa-upload';
+$_style['files_delete'] = 'fa fa-trash';
+$_style['files_duplicate'] = 'fa fa-clone';
+$_style['files_rename'] = 'fa fa-i-cursor';
+$_style['files_view'] = 'fa fa-eye';
+$_style['files_download'] = 'fa fa-download';
+$_style['files_unzip'] = 'fa fa-file-archive-o';
+$_style['files_edit'] = 'fa fa-pencil-square-o';
+
+//Action buttons
+$_style['actions_save'] = 'fa fa-floppy-o';
+$_style['actions_duplicate'] = 'fa fa-clone';
+$_style['actions_delete'] = 'fa fa-trash';
+$_style['actions_cancel'] = 'fa fa-times-circle';
+$_style['actions_close'] = 'fa fa-times-circle';
+$_style['actions_add'] = 'fa fa-plus-circle';
+$_style['actions_preview'] = 'fa fa-eye';
+$_style['actions_run'] = 'fa fa-play';
+$_style['actions_stop'] = 'fa fa-stop';
+$_style['actions_new'] = 'fa fa-plus-circle';
+$_style['actions_help'] = 'fa fa-question-circle';
+$_style['actions_sort'] = 'fa fa-sort';
+$_style['actions_options'] = 'fa fa-check-square';
+$_style['actions_categories'] = 'fa fa-folder-open';
+$_style['actions_search'] = 'fa fa-search';
+$_style['actions_file'] = 'fa fa-file-o';
+$_style['actions_folder'] = 'fa fa-folder-o';
+$_style['actions_folder_open'] = 'fa fa-folder-open-o';
+$_style['actions_calendar'] = 'fa fa-calendar';
+$_style['actions_calendar_delete'] = 'fa fa-calendar-times-o';
+$_style['actions_angle_up'] = 'fa fa-angle-up';
+$_style['actions_angle_down'] = 'fa fa-angle-down';
+$_style['actions_angle_left'] = 'fa fa-angle-left';
+$_style['actions_angle_right'] = 'fa fa-angle-right';
+$_style['actions_chain'] = 'fa fa-chain';
+$_style['actions_chain_broken'] = 'fa fa-chain-broken';
+$_style['actions_edit'] = 'fa fa-edit';
+$_style['actions_move'] = 'fa fa-arrows';
+$_style['actions_pencil'] = 'fa fa-pencil';
+$_style['actions_reply'] = 'fa fa-reply';
+$_style['actions_plus'] = 'fa fa-plus';
+$_style['actions_refresh'] = 'fa fa-refresh';
+$_style['actions_error'] = 'fa fa-times-circle';
+$_style['actions_info'] = 'fa fa-info-circle';
+$_style['actions_triangle'] = 'fa fa-exclamation-triangle';
+$_style['actions_table'] = 'fa fa-table';
+
+//for back compatibility
+
+$_style['icons_save'] = $style_path.'icons/save.png';
+$_style['icons_delete'] = $style_path.'icons/trash.png';
+$_style['icons_deleted_folder'] = $style_path.'tree/deletedfolder.png';
+$_style['icons_unzip'] = $style_path.'icons/download-alt.png';
+
+
+// Indicators
+$_style['icons_tooltip'] = 'fa fa-question-circle';
+$_style['icons_tooltip_over'] = $style_path.'icons/question-sign.png';
+$_style['icons_cal'] = $style_path.'icons/calendar.png';
+$_style['icons_cal_nodate'] = $style_path.'icons/calendar.png';
+$_style['icons_set_parent'] = $style_path.'icons/folder-open.png';
+
+//modules
+$_style['icons_module'] = 'fa fa-cube';
+$_style['icons_modules'] = 'fa fa-cubes'; //$style_path.'icons/modules.png';
+$_style['icons_run'] = $style_path.'icons/play.png';
+
+//users and webusers
+$_style['icons_user'] = 'fa fa-user-circle-o'; //$style_path.'icons/user.png';
+$_style['icons_web_user'] = 'fa fa-user'; //$style_path.'icons/user.png';
+
+//Messages
+$_style['icons_message_unread'] = $style_path.'icons/email.png';
+$_style['icons_message_forward'] = $style_path.'icons/forward.png';
+$_style['icons_message_reply'] = $style_path.'icons/reply.png';
+
+// Icons
+$_style['icons_add'] = $style_path.'icons/add.png';
+$_style['icons_cancel'] = $style_path.'icons/cancel.png';
+$_style['icons_close'] = $style_path.'icons/stop.png';
+$_style['icons_refresh'] = $style_path.'icons/refresh.png';
+$_style['icons_table'] = $style_path.'icons/table.png';
+
+// top bar
+$_style['icons_loading_doc_tree'] = $style_path.'icons/info-sign.png';
+$_style['icons_mail'] = $style_path.'icons/email.png';
+$_style['icons_working'] = $style_path.'icons/exclamation.png';
+
+//event log
+$_style['icons_event1'] = $style_path.'icons/event1.png';
+$_style['icons_event2'] = $style_path.'icons/event2.png';
+$_style['icons_event3'] = $style_path.'icons/event3.png';
+
+
+//nowhere in the manager
+$_style['icons_folder'] = $style_path.'icons/folder.png';
+$_style['icons_email'] = $style_path.'icons/email.png';
+$_style['icons_home'] = $style_path.'icons/home.png';
+$_style['icons_sort_menuindex'] = $style_path.'icons/sort_index.png';
+$_style['icons_weblink'] = $style_path.'icons/world_link.png';
+$_style['icons_tab_preview'] = $style_path.'icons/preview.png'; // Tabs
+$_style['icons_information'] = $style_path.'icons/info-sign.png';
+
+
+// Miscellaneous
+$_style['ajax_loader'] = ''.$_lang['loading_page'].'
';
+$_style['tx'] = $style_path.'misc/_tx_.gif';
+$_style['icons_right_arrow'] = $style_path.'icons/arrow-right.png';
+$_style['fade'] = $style_path.'misc/fade.gif';
+$_style['ed_save'] = $style_path.'misc/ed_save.gif';
+
+// actions buttons templates
+$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : '';
+if (!empty($modx->config['global_tabs']) && !isset($_SESSION['stay'])) {
+ $_REQUEST['stay'] = 2;
+}
+if (isset($_REQUEST['stay'])) {
+ $_SESSION['stay'] = $_REQUEST['stay'];
+} else if (isset($_SESSION['stay'])) {
+ $_REQUEST['stay'] = $_SESSION['stay'];
+}
+$stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : '';
+$addnew = 0;
+$run = 0;
+switch ($action) {
+ case '3':
+ case '4':
+ case '27':
+ case '72':
+ if ($modx->hasPermission('new_document')) {
+ $addnew = 1;
+ }
+ break;
+ case '16':
+ case '19':
+ if ($modx->hasPermission('new_template')) {
+ $addnew = 1;
+ }
+ break;
+ case '300':
+ case '301':
+ if ($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
+ $addnew = 1;
+ }
+ break;
+ case '77':
+ case '78':
+ if ($modx->hasPermission('new_chunk')) {
+ $addnew = 1;
+ }
+ break;
+ case '22':
+ case '23':
+ if ($modx->hasPermission('new_snippet')) {
+ $addnew = 1;
+ }
+ break;
+ case '101':
+ case '102':
+ if ($modx->hasPermission('new_plugin')) {
+ $addnew = 1;
+ }
+ break;
+ case '106':
+ case '107':
+ case '108':
+ if ($modx->hasPermission('new_module')) {
+ $addnew = 1;
+ }
+ if ($modx->hasPermission('exec_module')) {
+ $run = 1;
+ }
+ break;
+ case '88':
+ if ($modx->hasPermission('new_web_user')) {
+ $addnew = 1;
+ }
+ break;
+}
+
+$disabled = ($action == '19' || $action == '300' || $action == '77' || $action == '23' || $action == '101' || $action == '4' || $action == '72' || $action == '87' || $action == '11' || $action == '107' || $action == '38') ? ' disabled' : '';
+
+$_style['actionbuttons'] = array(
+ 'dynamic' => array(
+ 'document' => '',
+ 'user' => '',
+ 'element' => '',
+ 'newmodule' => ($addnew ? '' : ''),
+ 'close' => '',
+ 'save' => '',
+ 'savedelete' => '',
+ 'cancel' => '',
+ 'canceldelete' => '',
+ ),
+ 'static' => array(
+ 'document' => '',
+ 'cancel' => '',
+ )
+);
diff --git a/manager/processors/cache_sync.class.processor.php b/manager/processors/cache_sync.class.processor.php
index 80822ac7b7..cf099037f6 100755
--- a/manager/processors/cache_sync.class.processor.php
+++ b/manager/processors/cache_sync.class.processor.php
@@ -27,7 +27,7 @@ public function __construct()
{
$modx = evolutionCMS();
- $this->request_time = $_SERVER['REQUEST_TIME'] + $modx->config['server_offset_time'];
+ $this->request_time = $_SERVER['REQUEST_TIME'] + ($modx->config['server_offset_time'] ?? 0);
}
/**
@@ -83,7 +83,7 @@ public function getParents($id, $path = '')
$modx = evolutionCMS();
if (empty($this->aliases)) {
$f = "id, IF(alias='', id, alias) AS alias, parent, alias_visible";
- $rs = $modx->db->select($f, '[+prefix+]site_content', 'deleted=0');
+ $rs = $modx->db->select($f, '[+prefix+]site_content', 'deleted=0 and isfolder=1');
while ($row = $modx->db->getRow($rs)) {
$docid = $row['id'];
$this->aliases[$docid] = $row['alias'];
@@ -265,7 +265,7 @@ public function buildCache($modx)
}
if (!isset($config['full_aliaslisting']) || $config['full_aliaslisting'] != 1) {
- if ($config['aliaslistingfolder'] == 1) {
+ if (!empty($config['aliaslistingfolder'])) {
$f['id'] = 'c.id';
$f['alias'] = "IF( c.alias='', c.id, c.alias)";
$f['parent'] = 'c.parent';
@@ -302,13 +302,6 @@ public function buildCache($modx)
$content .= '$d[\'' . $key . '\']=' . $docid . ';';
$content .= '$m[]=array(' . $doc['parent'] . '=>' . $docid . ');';
}
-
- // get content types
- $rs = $modx->db->select('id, contentType', '[+prefix+]site_content', "contentType!='text/html'");
- $content .= '$c=&$this->contentTypes;';
- while ($doc = $modx->db->getRow($rs)) {
- $content .= '$c[\'' . $doc['id'] . '\']=\'' . $doc['contentType'] . '\';';
- }
}
if (!isset($config['disable_chunk_cache']) || $config['disable_chunk_cache'] != 1) {
@@ -332,7 +325,7 @@ public function buildCache($modx)
$content .= '$s[\'' . $key . '\']=\'return false;\';';
} else {
$value = trim($row['snippet']);
- if ($modx->config['minifyphp_incache']) {
+ if (!empty($modx->config['minifyphp_incache'])) {
$value = $this->php_strip_whitespace($value);
}
$content .= '$s[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';';
@@ -357,7 +350,7 @@ public function buildCache($modx)
while ($row = $modx->db->getRow($rs)) {
$key = $modx->db->escape($row['name']);
$value = trim($row['plugincode']);
- if ($modx->config['minifyphp_incache']) {
+ if (!empty($modx->config['minifyphp_incache'])) {
$value = $this->php_strip_whitespace($value);
}
$content .= '$p[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';';
@@ -409,7 +402,7 @@ public function buildCache($modx)
}
if (!is_file($this->cachePath . '/.htaccess')) {
- file_put_contents($this->cachePath . '/.htaccess', "order deny,allow\ndeny from all\n");
+ file_put_contents($this->cachePath . '/.htaccess', "\nRequire all denied\n \n\norder deny,allow\ndeny from all\n \n");
}
// invoke OnCacheUpdate event
diff --git a/manager/processors/duplicate_content.processor.php b/manager/processors/duplicate_content.processor.php
index 68df5e3a36..1b82b10d8f 100755
--- a/manager/processors/duplicate_content.processor.php
+++ b/manager/processors/duplicate_content.processor.php
@@ -139,6 +139,8 @@ function duplicateDocument($docid, $parent=null, $_toplevel=0) {
duplicateDocument($row['id'], $newparent, $_toplevel);
// return the new doc id
+ $modx->clearCache('full');
+
return $newparent;
}
diff --git a/manager/processors/login.processor.php b/manager/processors/login.processor.php
index 5132051dfa..ca878259f6 100755
--- a/manager/processors/login.processor.php
+++ b/manager/processors/login.processor.php
@@ -1,11 +1,11 @@
db->connect();
$modx->getSettings();
$modx->invokeEvent('OnManagerPageInit');
@@ -17,49 +17,56 @@
extract($modx->config, EXTR_OVERWRITE);
// include_once the language file
-$_lang = array();
+$_lang = [];
include_once("{$core_path}lang/english.inc.php");
-if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
- include_once("{$core_path}lang/{$manager_language}.inc.php");
+if ($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
+ include_once("{$core_path}lang/{$manager_language}.inc.php");
}
// allow custom language overrides not altered by future EVO-updates
-if(is_file("{$core_path}lang/override/{$manager_language}.inc.php")) {
- include_once("{$core_path}lang/override/{$manager_language}.inc.php");
+if (is_file("{$core_path}lang/override/{$manager_language}.inc.php")) {
+ include_once("{$core_path}lang/override/{$manager_language}.inc.php");
}
// include the logger
include_once("{$core_path}log.class.inc.php");
// Initialize System Alert Message Queque
-if(!isset($_SESSION['SystemAlertMsgQueque'])) {
- $_SESSION['SystemAlertMsgQueque'] = array();
+if (!isset($_SESSION['SystemAlertMsgQueque'])) {
+ $_SESSION['SystemAlertMsgQueque'] = [];
}
$SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
// initiate the content manager class
// for backward compatibility
-$username = isset($_REQUEST['username']) ? $modx->db->escape($modx->htmlspecialchars($_REQUEST['username'], ENT_NOQUOTES)) : '';
-$givenPassword = isset($_POST['password']) ? $modx->htmlspecialchars($_POST['password'], ENT_NOQUOTES) : '';
-$captcha_code = isset($_POST['captcha_code']) ? $_POST['captcha_code'] : '';
-$rememberme = isset($_POST['rememberme']) ? $_POST['rememberme'] : '';
+if (isset($_GET['username']) && is_scalar($_GET['username'])) {
+ $username = $_GET['username'];
+} elseif (isset($_POST['username']) && is_scalar($_POST['username'])) {
+ $username = $_POST['username'];
+} else {
+ $username = '';
+}
+$username = $modx->db->escape($modx->htmlspecialchars($username, ENT_NOQUOTES));
+$givenPassword = $modx->htmlspecialchars($_POST['password'] ?? '', ENT_NOQUOTES);
+$captcha_code = $_POST['captcha_code'] ?? '';
+$rememberme = $_POST['rememberme'] ?? '';
$failed_allowed = $modx->config['failed_login_attempts'];
// invoke OnBeforeManagerLogin event
-$modx->invokeEvent('OnBeforeManagerLogin', array(
- 'username' => $username,
- 'userpassword' => $givenPassword,
- 'rememberme' => $rememberme
- ));
+$modx->invokeEvent('OnBeforeManagerLogin', [
+ 'username' => $username,
+ 'userpassword' => $givenPassword,
+ 'rememberme' => $rememberme
+]);
$fields = 'mu.*, ua.*';
$from = '[+prefix+]manager_users AS mu, [+prefix+]user_attributes AS ua';
$where = "BINARY mu.username='{$username}' and ua.internalKey=mu.id";
$rs = $modx->db->select($fields, $from, $where);
$limit = $modx->db->getRecordCount($rs);
-if($limit == 0 || $limit > 1) {
- jsAlert($_lang['login_processor_unknown_user']);
- return;
+if ($limit == 0 || $limit > 1) {
+ jsAlert($_lang['login_processor_unknown_user']);
+ return;
}
$row = $modx->db->getRow($rs);
@@ -78,131 +85,134 @@
$email = $row['email'];
// get the user settings from the database
-$rs = $modx->db->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''");
-while($row = $modx->db->getRow($rs)) {
- extract($row);
- ${$setting_name} = $setting_value;
+$rs = $modx->db->select('setting_name, setting_value', '[+prefix+]user_settings',
+ "user='{$internalKey}' AND setting_value!=''");
+while ($row = $modx->db->getRow($rs)) {
+ extract($row);
+ ${$setting_name} = $setting_value;
}
// blocked due to number of login errors.
-if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
- @session_destroy();
- session_unset();
- if($cip = getenv("HTTP_CLIENT_IP")) {
- $ip = $cip;
- } elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
- $ip = $cip;
- } elseif($cip = getenv("REMOTE_ADDR")) {
- $ip = $cip;
- } else {
- $ip = "UNKNOWN";
- }
- $log = new logHandler;
- $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
- jsAlert($_lang['login_processor_many_failed_logins']);
- return;
+if ($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
+ @session_destroy();
+ session_unset();
+ if ($cip = getenv("HTTP_CLIENT_IP")) {
+ $ip = $cip;
+ } elseif ($cip = getenv("HTTP_X_FORWARDED_FOR")) {
+ $ip = $cip;
+ } elseif ($cip = getenv("REMOTE_ADDR")) {
+ $ip = $cip;
+ } else {
+ $ip = "UNKNOWN";
+ }
+ $log = new logHandler;
+ $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
+ jsAlert($_lang['login_processor_many_failed_logins']);
+ return;
}
// blocked due to number of login errors, but get to try again
-if($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
- $fields = array();
- $fields['failedlogincount'] = '0';
- $fields['blockeduntil'] = time() - 1;
- $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
+if ($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
+ $fields = [];
+ $fields['failedlogincount'] = '0';
+ $fields['blockeduntil'] = time() - 1;
+ $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
}
// this user has been blocked by an admin, so no way he's loggin in!
-if($blocked == '1') {
- @session_destroy();
- session_unset();
- jsAlert($_lang['login_processor_blocked1']);
- return;
+if ($blocked == '1') {
+ @session_destroy();
+ session_unset();
+ jsAlert($_lang['login_processor_blocked1']);
+ return;
}
// blockuntil: this user has a block until date
-if($blockeduntildate > time()) {
- @session_destroy();
- session_unset();
- jsAlert($_lang['login_processor_blocked2']);
- return;
+if ($blockeduntildate > time()) {
+ @session_destroy();
+ session_unset();
+ jsAlert($_lang['login_processor_blocked2']);
+ return;
}
// blockafter: this user has a block after date
-if($blockedafterdate > 0 && $blockedafterdate < time()) {
- @session_destroy();
- session_unset();
- jsAlert($_lang['login_processor_blocked3']);
- return;
+if ($blockedafterdate > 0 && $blockedafterdate < time()) {
+ @session_destroy();
+ session_unset();
+ jsAlert($_lang['login_processor_blocked3']);
+ return;
}
// allowed ip
-if($allowed_ip) {
- if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
- if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
- jsAlert($_lang['login_processor_remotehost_ip']);
- return;
- }
- }
- if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
- jsAlert($_lang['login_processor_remote_ip']);
- return;
- }
+if ($allowed_ip) {
+ if (($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
+ if (gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
+ jsAlert($_lang['login_processor_remotehost_ip']);
+ return;
+ }
+ }
+ if (!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
+ jsAlert($_lang['login_processor_remote_ip']);
+ return;
+ }
}
// allowed days
-if($allowed_days) {
- $date = getdate();
- $day = $date['wday'] + 1;
- if(!in_array($day,explode(',',$allowed_days))) {
- jsAlert($_lang['login_processor_date']);
- return;
- }
+if ($allowed_days) {
+ $date = getdate();
+ $day = $date['wday'] + 1;
+ if (!in_array($day, explode(',', $allowed_days))) {
+ jsAlert($_lang['login_processor_date']);
+ return;
+ }
}
// invoke OnManagerAuthentication event
-$rt = $modx->invokeEvent('OnManagerAuthentication', array(
- 'userid' => $internalKey,
- 'username' => $username,
- 'userpassword' => $givenPassword,
- 'savedpassword' => $dbasePassword,
- 'rememberme' => $rememberme
- ));
+$rt = $modx->invokeEvent('OnManagerAuthentication', [
+ 'userid' => $internalKey,
+ 'username' => $username,
+ 'userpassword' => $givenPassword,
+ 'savedpassword' => $dbasePassword,
+ 'rememberme' => $rememberme
+]);
// check if plugin authenticated the user
$matchPassword = false;
-if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
- // check user password - local authentication
- $hashType = $modx->manager->getHashType($dbasePassword);
- if($hashType == 'phpass') {
- $matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
- } elseif($hashType == 'md5') {
- $matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
- } elseif($hashType == 'v1') {
- $matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
- } else {
- $matchPassword = false;
- }
-} else if($rt === true || (is_array($rt) && in_array(true, $rt))) {
- $matchPassword = true;
+if (!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
+ // check user password - local authentication
+ $hashType = $modx->manager->getHashType($dbasePassword);
+ if ($hashType == 'phpass') {
+ $matchPassword = login($username, $_POST['password'], $dbasePassword);
+ } elseif ($hashType == 'md5') {
+ $matchPassword = loginMD5($internalKey, $_POST['password'], $dbasePassword, $username);
+ } elseif ($hashType == 'v1') {
+ $matchPassword = loginV1($internalKey, $_POST['password'], $dbasePassword, $username);
+ } else {
+ $matchPassword = false;
+ }
+} else {
+ if ($rt === true || (is_array($rt) && in_array(true, $rt))) {
+ $matchPassword = true;
+ }
}
-$blocked_minutes = (int)$modx->config['blocked_minutes'];
+$blocked_minutes = (int) $modx->config['blocked_minutes'];
-if(!$matchPassword) {
- jsAlert($_lang['login_processor_wrong_password']);
- incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
- return;
+if (!$matchPassword) {
+ jsAlert($_lang['login_processor_wrong_password']);
+ incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
+ return;
}
-if($modx->config['use_captcha'] == 1) {
- if(!isset ($_SESSION['veriword'])) {
- jsAlert($_lang['login_processor_captcha_config']);
- return;
- } elseif($_SESSION['veriword'] != $captcha_code) {
- jsAlert($_lang['login_processor_bad_code']);
- incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
- return;
- }
+if ($modx->config['use_captcha'] == 1) {
+ if (!isset ($_SESSION['veriword'])) {
+ jsAlert($_lang['login_processor_captcha_config']);
+ return;
+ } elseif ($_SESSION['veriword'] != $captcha_code) {
+ jsAlert($_lang['login_processor_bad_code']);
+ incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
+ return;
+ }
}
$modx->cleanupExpiredLocks();
@@ -226,191 +236,203 @@
$_SESSION['mgrPermissions'] = $modx->db->getRow($rs);
// successful login so reset fail count and update key values
-$modx->db->update('failedlogincount=0, ' . 'logincount=logincount+1, ' . 'lastlogin=thislogin, ' . 'thislogin=' . time() . ', ' . "sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
+$modx->db->update('failedlogincount=0, ' . 'logincount=logincount+1, ' . 'lastlogin=thislogin, ' . 'thislogin=' . time() . ', ' . "sessionid='{$currentsessionid}'",
+ '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
// get user's document groups
$i = 0;
$rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups') . ' ug
- INNER JOIN ' . $modx->getFullTableName('membergroup_access') . ' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
+ INNER JOIN ' . $modx->getFullTableName('membergroup_access') . ' uga ON uga.membergroup=ug.user_group',
+ "ug.member='{$internalKey}'");
$_SESSION['mgrDocgroups'] = $modx->db->getColumn('documentgroup', $rs);
$_SESSION['mgrToken'] = md5($currentsessionid);
-if($rememberme == '1') {
- $_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
-
- // Set a cookie separate from the session cookie with the username in it.
- // Are we using secure connection? If so, make sure the cookie is secure
- global $https_port;
-
- $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
- if(version_compare(PHP_VERSION, '5.2', '<')) {
- setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
- } else {
- setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
- }
+if ($rememberme == '1') {
+ $_SESSION['modx.mgr.session.cookie.lifetime'] = (int) $modx->config['session.cookie.lifetime'];
+
+ // Set a cookie separate from the session cookie with the username in it.
+ // Are we using secure connection? If so, make sure the cookie is secure
+ global $https_port;
+
+ $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
+ if (version_compare(PHP_VERSION, '5.2', '<')) {
+ setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL,
+ '; HttpOnly', $secure);
+ } else {
+ setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, null,
+ $secure, true);
+ }
} else {
- $_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
+ $_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
- // Remove the Remember Me cookie
- setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL);
+ // Remove the Remember Me cookie
+ setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL);
}
// Check if user already has an active session, if not check if user pressed logout end of last session
$rs = $modx->db->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'");
$activeSession = $modx->db->getValue($rs);
-if(!$activeSession) {
- $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
- if($lastHit = $modx->db->getValue($rs)) {
- $_SESSION['show_logout_reminder'] = array(
- 'type' => 'logout_reminder',
- 'lastHit' => $lastHit
- );
- }
+if (!$activeSession) {
+ $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'),
+ "internalKey='{$internalKey}' AND action != 8");
+ if ($lastHit = $modx->db->getValue($rs)) {
+ $_SESSION['show_logout_reminder'] = [
+ 'type' => 'logout_reminder',
+ 'lastHit' => $lastHit
+ ];
+ }
}
$log = new logHandler;
$log->initAndWriteLog('Logged in', $modx->getLoginUserID(), $_SESSION['mgrShortname'], '58', '-', 'MODX');
// invoke OnManagerLogin event
-$modx->invokeEvent('OnManagerLogin', array(
- 'userid' => $internalKey,
- 'username' => $username,
- 'userpassword' => $givenPassword,
- 'rememberme' => $rememberme
- ));
+$modx->invokeEvent('OnManagerLogin', [
+ 'userid' => $internalKey,
+ 'username' => $username,
+ 'userpassword' => $givenPassword,
+ 'rememberme' => $rememberme
+]);
// check if we should redirect user to a web page
-$rs = $modx->db->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'");
-$id = (int)$modx->db->getValue($rs);
-if($id > 0) {
- $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
- if($_POST['ajax'] == 1) {
- echo $header;
- } else {
- header($header);
- }
+$rs = $modx->db->select('setting_value', '[+prefix+]user_settings',
+ "user='{$internalKey}' AND setting_name='manager_login_startup'");
+$id = (int) $modx->db->getValue($rs);
+if ($id > 0) {
+ $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
+ if ($_POST['ajax'] == 1) {
+ echo $header;
+ } else {
+ header($header);
+ }
} else {
- $header = 'Location: ' . MODX_MANAGER_URL;
- if($_POST['ajax'] == 1) {
- echo $header;
- } else {
- header($header);
- }
+ $header = 'Location: ' . MODX_MANAGER_URL;
+ if ($_POST['ajax'] == 1) {
+ echo $header;
+ } else {
+ header($header);
+ }
}
/**
* show javascript alert
*
- * @param string $msg
+ * @param string $msg
*/
-function jsAlert($msg) {
- $modx = evolutionCMS();
- if(isset($_POST['ajax']) && $_POST['ajax'] != 1) {
- echo "";
- } else {
- echo $msg . "\n";
- }
+function jsAlert($msg)
+{
+ $modx = evolutionCMS();
+ if ($_POST['ajax'] != 1) {
+ echo "";
+ } else {
+ echo $msg . "\n";
+ }
}
/**
- * @param string $username
- * @param string $givenPassword
- * @param string $dbasePassword
+ * @param string $username
+ * @param string $givenPassword
+ * @param string $dbasePassword
* @return bool
*/
-function login($username, $givenPassword, $dbasePassword) {
- $modx = evolutionCMS();
- return $modx->phpass->CheckPassword($givenPassword, $dbasePassword);
+function login($username, $givenPassword, $dbasePassword)
+{
+ $modx = evolutionCMS();
+ return $modx->phpass->CheckPassword($givenPassword, $dbasePassword);
}
/**
- * @param int $internalKey
- * @param string $givenPassword
- * @param string $dbasePassword
- * @param string $username
+ * @param int $internalKey
+ * @param string $givenPassword
+ * @param string $dbasePassword
+ * @param string $username
* @return bool
*/
-function loginV1($internalKey, $givenPassword, $dbasePassword, $username) {
- $modx = evolutionCMS();
+function loginV1($internalKey, $givenPassword, $dbasePassword, $username)
+{
+ $modx = evolutionCMS();
- $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey);
+ $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey);
- if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
- $modx->config['pwd_hash_algo'] = 'UNCRYPT';
- }
+ if (!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
+ $modx->config['pwd_hash_algo'] = 'UNCRYPT';
+ }
- if($user_algo !== $modx->config['pwd_hash_algo']) {
- $bk_pwd_hash_algo = $modx->config['pwd_hash_algo'];
- $modx->config['pwd_hash_algo'] = $user_algo;
- }
+ if ($user_algo !== $modx->config['pwd_hash_algo']) {
+ $bk_pwd_hash_algo = $modx->config['pwd_hash_algo'];
+ $modx->config['pwd_hash_algo'] = $user_algo;
+ }
- if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
- return false;
- }
+ if ($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
+ return false;
+ }
- updateNewHash($username, $givenPassword);
+ updateNewHash($username, $givenPassword);
- return true;
+ return true;
}
/**
- * @param int $internalKey
- * @param string $givenPassword
- * @param string $dbasePassword
- * @param string $username
+ * @param int $internalKey
+ * @param string $givenPassword
+ * @param string $dbasePassword
+ * @param string $username
* @return bool
*/
-function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) {
- $modx = evolutionCMS();
-
- if($dbasePassword != md5($givenPassword)) {
- return false;
- }
- updateNewHash($username, $givenPassword);
- return true;
+function loginMD5($internalKey, $givenPassword, $dbasePassword, $username)
+{
+ $modx = evolutionCMS();
+
+ if ($dbasePassword != md5($givenPassword)) {
+ return false;
+ }
+ updateNewHash($username, $givenPassword);
+ return true;
}
/**
- * @param string $username
- * @param string $password
+ * @param string $username
+ * @param string $password
*/
-function updateNewHash($username, $password) {
- $modx = evolutionCMS();
+function updateNewHash($username, $password)
+{
+ $modx = evolutionCMS();
- $field = array();
- $field['password'] = $modx->phpass->HashPassword($password);
- $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'");
+ $field = [];
+ $field['password'] = $modx->phpass->HashPassword($password);
+ $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'");
}
/**
- * @param int $internalKey
- * @param int $failedlogins
- * @param int $failed_allowed
- * @param int $blocked_minutes
+ * @param int $internalKey
+ * @param int $failedlogins
+ * @param int $failed_allowed
+ * @param int $blocked_minutes
*/
-function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) {
- $modx = evolutionCMS();
-
- $failedlogins += 1;
-
- $fields = array('failedlogincount' => $failedlogins);
- if($failedlogins >= $failed_allowed) //block user for too many fail attempts
- {
- $fields['blockeduntil'] = time() + ($blocked_minutes * 60);
- }
-
- $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
-
- if($failedlogins < $failed_allowed) {
- //sleep to help prevent brute force attacks
- $sleep = (int) $failedlogins / 2;
- if($sleep > 5) {
- $sleep = 5;
- }
- sleep($sleep);
- }
- @session_destroy();
- session_unset();
- return;
+function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes)
+{
+ $modx = evolutionCMS();
+
+ $failedlogins += 1;
+
+ $fields = ['failedlogincount' => $failedlogins];
+ if ($failedlogins >= $failed_allowed) //block user for too many fail attempts
+ {
+ $fields['blockeduntil'] = time() + ($blocked_minutes * 60);
+ }
+
+ $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
+
+ if ($failedlogins < $failed_allowed) {
+ //sleep to help prevent brute force attacks
+ $sleep = (int) $failedlogins / 2;
+ if ($sleep > 5) {
+ $sleep = 5;
+ }
+ sleep($sleep);
+ }
+ @session_destroy();
+ session_unset();
+ return;
}
diff --git a/manager/processors/move_document.processor.php b/manager/processors/move_document.processor.php
index c0a8c390fd..846afd4a41 100755
--- a/manager/processors/move_document.processor.php
+++ b/manager/processors/move_document.processor.php
@@ -15,7 +15,12 @@
if($documentID==$newParentID) $modx->webAlertAndQuit($_lang["error_movedocument1"]);
if($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]);
if($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]);
-
+if ($newParentID > 0) {
+ $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "`id`={$newParentID} AND `deleted`=0");
+ if (!$modx->db->getValue($rs)) {
+ $modx->webAlertAndQuit($_lang["error_parent_deleted"]);
+ }
+}
$parents = $modx->getParentIds($newParentID);
if (in_array($documentID, $parents)) $modx->webAlertAndQuit($_lang["error_movedocument2"]);
diff --git a/manager/processors/save_content.processor.php b/manager/processors/save_content.processor.php
index 6883cf8eac..c4c4170bdb 100755
--- a/manager/processors/save_content.processor.php
+++ b/manager/processors/save_content.processor.php
@@ -1,5 +1,5 @@
INCLUDE_ORDERING_ERROR Please use the EVO Content Manager instead of accessing this file directly.");
}
if (!$modx->hasPermission('save_document')) {
@@ -14,33 +14,32 @@
$description = $modx->db->escape($_POST['description']);
$alias = $modx->db->escape($_POST['alias']);
$link_attributes = $modx->db->escape($_POST['link_attributes']);
-$isfolder = (int)$_POST['isfolder'];
-$richtext = (int)$_POST['richtext'];
-$published = (int)$_POST['published'];
-$parent = $_POST['parent'] != '' ? (int)$_POST['parent'] : 0;
-$template = (int)$_POST['template'];
-$menuindex = !empty($_POST['menuindex']) ? (int)$_POST['menuindex'] : 0;
-$searchable = (int)$_POST['searchable'];
-$cacheable = (int)$_POST['cacheable'];
-$syncsite = (int)$_POST['syncsite'];
+$isfolder = (int) $_POST['isfolder'];
+$richtext = (int) $_POST['richtext'];
+$published = (int) $_POST['published'];
+$parent = $_POST['parent'] != '' ? (int) $_POST['parent'] : 0;
+$template = (int) $_POST['template'];
+$menuindex = !empty($_POST['menuindex']) ? (int) $_POST['menuindex'] : 0;
+$searchable = (int) $_POST['searchable'];
+$cacheable = (int) $_POST['cacheable'];
+$syncsite = (int) $_POST['syncsite'];
$pub_date = $_POST['pub_date'];
$unpub_date = $_POST['unpub_date'];
-$document_groups = (isset($_POST['chkalldocs']) && $_POST['chkalldocs'] == 'on') ? array() : $_POST['docgroups'];
+$document_groups = (isset($_POST['chkalldocs']) && $_POST['chkalldocs'] == 'on') ? [] : $_POST['docgroups'];
$type = $modx->db->escape($_POST['type']);
$contentType = $modx->db->escape($_POST['contentType']);
-$contentdispo = (int)$_POST['content_dispo'];
+$contentdispo = (int) $_POST['content_dispo'];
$longtitle = $modx->db->escape($_POST['longtitle']);
-$donthit = (int)$_POST['donthit'];
+$donthit = (int) $_POST['donthit'];
$menutitle = $modx->db->escape($_POST['menutitle']);
-$hidemenu = (int)$_POST['hidemenu'];
-$aliasvisible = (int)$_POST['alias_visible'];
+$hidemenu = (int) $_POST['hidemenu'];
+$aliasvisible = (int) $_POST['alias_visible'];
/************* webber ********/
-$sd=isset($_POST['dir']) && strtolower($_POST['dir']) === 'asc' ? '&dir=ASC' : '&dir=DESC';
-$sb=isset($_POST['sort'])?'&sort='.html_escape($_POST['sort'], $modx->config['modx_charset']):'&sort=pub_date';
-$pg=isset($_POST['page'])?'&page='.(int)$_POST['page']:'';
-$add_path=$sd.$sb.$pg;
-
+$sd = isset($_POST['dir']) && strtolower($_POST['dir']) === 'asc' ? '&dir=ASC' : '&dir=DESC';
+$sb = isset($_POST['sort']) ? '&sort=' . html_escape($_POST['sort'], $modx->config['modx_charset']) : '&sort=pub_date';
+$pg = isset($_POST['page']) ? '&page=' . (int) $_POST['page'] : '';
+$add_path = $sd . $sb . $pg;
$no_esc_pagetitle = $_POST['pagetitle'];
@@ -53,15 +52,15 @@
}
// get table names
-$tbl_document_groups = $modx->getFullTableName('document_groups');
-$tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names');
-$tbl_member_groups = $modx->getFullTableName('member_groups');
-$tbl_membergroup_access = $modx->getFullTableName('membergroup_access');
-$tbl_site_content = $modx->getFullTableName('site_content');
-$tbl_site_tmplvar_access = $modx->getFullTableName('site_tmplvar_access');
+$tbl_document_groups = $modx->getFullTableName('document_groups');
+$tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names');
+$tbl_member_groups = $modx->getFullTableName('member_groups');
+$tbl_membergroup_access = $modx->getFullTableName('membergroup_access');
+$tbl_site_content = $modx->getFullTableName('site_content');
+$tbl_site_tmplvar_access = $modx->getFullTableName('site_tmplvar_access');
$tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues');
-$tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates');
-$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
+$tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates');
+$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
$actionToTake = "new";
if ($_POST['mode'] == '73' || $_POST['mode'] == '27') {
@@ -73,22 +72,26 @@
// auto assign alias
if (!$alias && $automatic_alias) {
$alias = strtolower($modx->stripAlias(trim($pagetitle)));
- if(!$allow_duplicate_alias) {
- if ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content, "id<>'$id' AND alias='$alias'")) != 0) {
+ if (!$allow_duplicate_alias) {
+ if ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content,
+ "id<>'$id' AND alias='$alias'")) != 0) {
$cnt = 1;
$tempAlias = $alias;
- while ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content, "id<>'$id' AND alias='$tempAlias'")) != 0) {
+ while ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content,
+ "id<>'$id' AND alias='$tempAlias'")) != 0) {
$tempAlias = $alias;
$tempAlias .= $cnt;
$cnt++;
}
$alias = $tempAlias;
}
- }else{
- if ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content, "id<>'$id' AND parent=$parent AND alias='$alias'")) != 0) {
+ } else {
+ if ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content,
+ "id<>'$id' AND parent=$parent AND alias='$alias'")) != 0) {
$cnt = 1;
$tempAlias = $alias;
- while ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content, "id<>'$id' AND parent=$parent AND alias='$tempAlias'")) != 0) {
+ while ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content,
+ "id<>'$id' AND parent=$parent AND alias='$tempAlias'")) != 0) {
$tempAlias = $alias;
$tempAlias .= $cnt;
$cnt++;
@@ -96,37 +99,38 @@
$alias = $tempAlias;
}
}
- }
-
- // check for duplicate alias name if not allowed
+ } // check for duplicate alias name if not allowed
elseif ($alias && !$allow_duplicate_alias) {
$alias = $modx->stripAlias($alias);
if ($use_alias_path) {
// only check for duplicates on the same level if alias_path is on
- $docid = $modx->db->getValue($modx->db->select('id', $tbl_site_content, "id<>'$id' AND alias='$alias' AND parent=$parent", '', 1));
+ $docid = $modx->db->getValue($modx->db->select('id', $tbl_site_content,
+ "id<>'$id' AND alias='$alias' AND parent=$parent", '', 1));
} else {
- $docid = $modx->db->getValue($modx->db->select('id', $tbl_site_content, "id<>'$id' AND alias='$alias'", '', 1));
+ $docid = $modx->db->getValue($modx->db->select('id', $tbl_site_content, "id<>'$id' AND alias='$alias'", '',
+ 1));
}
if ($docid > 0) {
if ($actionToTake == 'edit') {
$modx->manager->saveFormValues(27);
- $modx->webAlertAndQuit(sprintf($_lang["duplicate_alias_found"], $docid, $alias), "index.php?a=27&id={$id}");
+ $modx->webAlertAndQuit(sprintf($_lang["duplicate_alias_found"], $docid, $alias),
+ "index.php?a=27&id={$id}");
} else {
$modx->manager->saveFormValues(4);
$modx->webAlertAndQuit(sprintf($_lang["duplicate_alias_found"], $docid, $alias), "index.php?a=4");
}
}
- }
-
- // strip alias of special characters
+ } // strip alias of special characters
elseif ($alias) {
$alias = $modx->stripAlias($alias);
//webber
- $docid = $modx->db->getValue($modx->db->select('id', $tbl_site_content, "id<>'$id' AND alias='$alias' AND parent=$parent", '', 1));
+ $docid = $modx->db->getValue($modx->db->select('id', $tbl_site_content,
+ "id<>'$id' AND alias='$alias' AND parent=$parent", '', 1));
if ($docid > 0) {
if ($actionToTake == 'edit') {
$modx->manager->saveFormValues(27);
- $modx->webAlertAndQuit(sprintf($_lang["duplicate_alias_found"], $docid, $alias), "index.php?a=27&id={$id}");
+ $modx->webAlertAndQuit(sprintf($_lang["duplicate_alias_found"], $docid, $alias),
+ "index.php?a=27&id={$id}");
} else {
$modx->manager->saveFormValues(4);
$modx->webAlertAndQuit(sprintf($_lang["duplicate_alias_found"], $docid, $alias), "index.php?a=4");
@@ -134,8 +138,7 @@
}
//end webber
}
-}
-elseif ($alias) {
+} elseif ($alias) {
$alias = $modx->stripAlias($alias);
}
@@ -149,8 +152,7 @@
if ($pub_date < $currentdate) {
$published = 1;
- }
- elseif ($pub_date > $currentdate) {
+ } elseif ($pub_date > $currentdate) {
$published = 0;
}
}
@@ -165,20 +167,21 @@
}
// get document groups for current user
-$tmplvars = array ();
+$tmplvars = [];
$docgrp = '';
if ($_SESSION['mgrDocgroups']) {
$docgrp = implode(",", $_SESSION['mgrDocgroups']);
}
// ensure that user has not made this document inaccessible to themselves
-if($_SESSION['mgrRole'] != 1 && is_array($document_groups)) {
+if ($_SESSION['mgrRole'] != 1 && is_array($document_groups)) {
$document_group_list = implode(',', $document_groups);
- $document_group_list = implode(',', array_filter(explode(',',$document_group_list), 'is_numeric'));
- if(!empty($document_group_list)) {
- $rs = $modx->db->select('COUNT(mg.id)', "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg", "mga.membergroup = mg.user_group AND mga.documentgroup IN({$document_group_list}) AND mg.member = {$_SESSION['mgrInternalKey']}");
+ $document_group_list = implode(',', array_filter(explode(',', $document_group_list), 'is_numeric'));
+ if (!empty($document_group_list)) {
+ $rs = $modx->db->select('COUNT(mg.id)', "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg",
+ "mga.membergroup = mg.user_group AND mga.documentgroup IN({$document_group_list}) AND mg.member = {$_SESSION['mgrInternalKey']}");
$count = $modx->db->getValue($rs);
- if($count == 0) {
+ if ($count == 0) {
if ($actionToTake == 'edit') {
$modx->manager->saveFormValues(27);
$modx->webAlertAndQuit(sprintf($_lang["resource_permissions_error"]), "index.php?a=27&id={$id}");
@@ -198,46 +201,46 @@
LEFT JOIN {$tbl_site_tmplvar_access} AS tva ON tva.tmplvarid=tv.id",
"tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)" . ((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)") . ")",
"tv.rank"
- );
+);
while ($row = $modx->db->getRow($rs)) {
$tmplvar = '';
switch ($row['type']) {
case 'url':
- $tmplvar = $_POST["tv" . $row['id']];
- if ($_POST["tv" . $row['id'] . '_prefix'] != '--') {
- $tmplvar = str_replace(array (
+ $tmplvar = $_POST["tv" . $row['id']] ?? '';
+ if (isset($_POST["tv" . $row['id'] . '_prefix']) && $_POST["tv" . $row['id'] . '_prefix'] != '--') {
+ $tmplvar = str_replace([
"feed://",
"ftp://",
"http://",
"https://",
"mailto:"
- ), "", $tmplvar);
+ ], "", $tmplvar);
$tmplvar = $_POST["tv" . $row['id'] . '_prefix'] . $tmplvar;
}
- break;
+ break;
case 'file':
- $tmplvar = $_POST["tv" . $row['id']];
- break;
+ $tmplvar = $_POST["tv" . $row['id']] ?? '';
+ break;
default:
- if (is_array($_POST["tv" . $row['id']])) {
+ if (isset($_POST["tv" . $row['id']]) && is_array($_POST["tv" . $row['id']])) {
// handles checkboxes & multiple selects elements
- $feature_insert = array ();
+ $feature_insert = [];
$lst = $_POST["tv" . $row['id']];
- foreach($lst as $featureValue => $feature_item) {
+ foreach ($lst as $featureValue => $feature_item) {
$feature_insert[count($feature_insert)] = $feature_item;
}
$tmplvar = implode("||", $feature_insert);
} else {
- $tmplvar = $_POST["tv" . $row['id']];
+ $tmplvar = $_POST["tv" . $row['id']] ?? '';
}
- break;
+ break;
}
// save value if it was modified
- if (strlen($tmplvar) > 0 && $tmplvar != $row['default_text']) {
- $tmplvars[$row['id']] = array (
+ if ($tmplvar != '' && $tmplvar != $row['default_text']) {
+ $tmplvars[$row['id']] = [
$row['id'],
$tmplvar
- );
+ ];
} else {
// Mark the variable for deletion
$tmplvars[$row['name']] = $row['id'];
@@ -257,7 +260,7 @@
// check to see if the user is allowed to save the document in the place he wants to save it in
if ($use_udperms == 1) {
if ($existingDocument['parent'] != $parent) {
- include_once MODX_MANAGER_PATH ."processors/user_documents_permissions.class.php";
+ include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php";
$udperms = new udperms();
$udperms->user = $modx->getLoginUserID();
$udperms->document = $parent;
@@ -266,10 +269,12 @@
if (!$udperms->checkPermissions()) {
if ($actionToTake == 'edit') {
$modx->manager->saveFormValues(27);
- $modx->webAlertAndQuit(sprintf($_lang['access_permission_parent_denied'], $docid, $alias), "index.php?a=27&id={$id}");
+ $modx->webAlertAndQuit(sprintf($_lang['access_permission_parent_denied'], $docid, $alias),
+ "index.php?a=27&id={$id}");
} else {
$modx->manager->saveFormValues(4);
- $modx->webAlertAndQuit(sprintf($_lang['access_permission_parent_denied'], $docid, $alias), "index.php?a=4");
+ $modx->webAlertAndQuit(sprintf($_lang['access_permission_parent_denied'], $docid, $alias),
+ "index.php?a=4");
}
}
}
@@ -279,8 +284,7 @@
case 'new' :
// invoke OnBeforeDocFormSave event
- switch($modx->config['docid_incrmnt_method'])
- {
+ switch ($modx->config['docid_incrmnt_method']) {
case '1':
$from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id";
$where = "T1.id IS NULL";
@@ -288,18 +292,25 @@
$id = $modx->db->getValue($rs);
break;
case '2':
- $rs = $modx->db->select('MAX(id)+1',$tbl_site_content);
+ $rs = $modx->db->select('MAX(id)+1', $tbl_site_content);
$id = $modx->db->getValue($rs);
- break;
+ break;
default:
$id = '';
}
- $modx->invokeEvent("OnBeforeDocFormSave", array (
+ $modx->invokeEvent("OnBeforeDocFormSave", [
"mode" => "new",
- "id" => $id
- ));
+ "id" => $id
+ ]);
+
+ $deleted = 0;
+ $parentNotDeleted = $modx->db->getValue($modx->db->select('id', $modx->getFullTableName('site_content'),
+ "`id`={$parent} AND `deleted`=0"));
+ if ($parent > 0 && !$parentNotDeleted) {
+ $deleted = 1;
+ }
// deny publishing if not permitted
if (!$modx->hasPermission('publish_document')) {
@@ -311,55 +322,56 @@
$publishedon = ($published ? $currentdate : 0);
$publishedby = ($published ? $modx->getLoginUserID() : 0);
- if ((!empty($pub_date))&&($published)){
- $publishedon=$pub_date;
- }
-
- $dbInsert = array
- (
- "introtext" => $introtext ,
- "content" => $content ,
- "pagetitle" => $pagetitle ,
- "longtitle" => $longtitle ,
- "type" => $type ,
- "description" => $description ,
- "alias" => $alias ,
- "link_attributes" => $link_attributes ,
- "isfolder" => $isfolder ,
- "richtext" => $richtext ,
- "published" => $published ,
- "parent" => $parent ,
- "template" => $template ,
- "menuindex" => $menuindex ,
- "searchable" => $searchable ,
- "cacheable" => $cacheable ,
- "createdby" => $modx->getLoginUserID() ,
- "createdon" => $currentdate ,
- "editedby" => $modx->getLoginUserID() ,
- "editedon" => $currentdate ,
- "publishedby" => $publishedby ,
- "publishedon" => $publishedon ,
- "pub_date" => $pub_date ,
- "unpub_date" => $unpub_date ,
- "contentType" => $contentType ,
- "content_dispo" => $contentdispo ,
- "donthit" => $donthit ,
- "menutitle" => $menutitle ,
- "hidemenu" => $hidemenu ,
- "alias_visible" => $aliasvisible
- );
-
- if ($id != '')
+ if ((!empty($pub_date)) && ($published)) {
+ $publishedon = $pub_date;
+ }
+
+ $dbInsert = [
+ "introtext" => $introtext,
+ "content" => $content,
+ "pagetitle" => $pagetitle,
+ "longtitle" => $longtitle,
+ "type" => $type,
+ "description" => $description,
+ "alias" => $alias,
+ "link_attributes" => $link_attributes,
+ "isfolder" => $isfolder,
+ "richtext" => $richtext,
+ "deleted" => $deleted,
+ "published" => $published,
+ "parent" => $parent,
+ "template" => $template,
+ "menuindex" => $menuindex,
+ "searchable" => $searchable,
+ "cacheable" => $cacheable,
+ "createdby" => $modx->getLoginUserID(),
+ "createdon" => $currentdate,
+ "editedby" => $modx->getLoginUserID(),
+ "editedon" => $currentdate,
+ "publishedby" => $publishedby,
+ "publishedon" => $publishedon,
+ "pub_date" => $pub_date,
+ "unpub_date" => $unpub_date,
+ "contentType" => $contentType,
+ "content_dispo" => $contentdispo,
+ "donthit" => $donthit,
+ "menutitle" => $menutitle,
+ "hidemenu" => $hidemenu,
+ "alias_visible" => $aliasvisible
+ ];
+
+ if ($id != '') {
$dbInsert["id"] = $id;
+ }
- $key = $modx->db->insert( $dbInsert, $tbl_site_content);
+ $key = $modx->db->insert($dbInsert, $tbl_site_content);
- $tvChanges = array();
+ $tvChanges = [];
foreach ($tmplvars as $field => $value) {
if (is_array($value)) {
$tvId = $value[0];
$tvVal = $value[1];
- $tvChanges[] = array('tmplvarid' => $tvId, 'contentid' => $key, 'value' => $modx->db->escape($tvVal));
+ $tvChanges[] = ['tmplvarid' => $tvId, 'contentid' => $key, 'value' => $modx->db->escape($tvVal)];
}
}
if (!empty($tvChanges)) {
@@ -370,26 +382,28 @@
// document access permissions
if ($use_udperms == 1 && is_array($document_groups)) {
- $new_groups = array();
+ $new_groups = [];
foreach ($document_groups as $value_pair) {
// first, split the pair (this is a new document, so ignore the second value
- list($group) = explode(',', $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list)
- $new_groups[] = '('.(int)$group.','.$key.')';
+ [$group] = explode(',',
+ $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list)
+ $new_groups[] = '(' . (int) $group . ',' . $key . ')';
}
$saved = true;
if (!empty($new_groups)) {
- $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $new_groups));
+ $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',',
+ $new_groups));
}
} else {
$isManager = $modx->hasPermission('access_permissions');
- $isWeb = $modx->hasPermission('web_access_permissions');
- if($use_udperms && !($isManager || $isWeb) && $parent != 0) {
+ $isWeb = $modx->hasPermission('web_access_permissions');
+ if ($use_udperms && !($isManager || $isWeb) && $parent != 0) {
// inherit document access permissions
$modx->db->insert(
- array(
- 'document_group' =>'',
- 'document' =>''
- ), $tbl_document_groups, // Insert into
+ [
+ 'document_group' => '',
+ 'document' => ''
+ ], $tbl_document_groups, // Insert into
"document_group, {$key}", $tbl_document_groups, "document = '{$parent}'"); // Copy from
}
}
@@ -397,15 +411,15 @@
// update parent folder status
if ($parent != 0) {
- $fields = array('isfolder' => 1);
+ $fields = ['isfolder' => 1];
$modx->db->update($fields, $tbl_site_content, "id='{$_REQUEST['parent']}'");
}
// invoke OnDocFormSave event
- $modx->invokeEvent("OnDocFormSave", array (
+ $modx->invokeEvent("OnDocFormSave", [
"mode" => "new",
- "id" => $key
- ));
+ "id" => $key
+ ]);
// secure web documents - flag as private
include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php";
@@ -426,18 +440,20 @@
// redirect/stay options
if ($_POST['stay'] != '') {
// weblink
- if ($_POST['mode'] == "72")
+ if ($_POST['mode'] == "72") {
$a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent";
+ }
// document
- if ($_POST['mode'] == "4")
+ if ($_POST['mode'] == "4") {
$a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent";
+ }
$header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'];
} else {
$header = "Location: index.php?a=3&id=$key&r=1";
}
if (headers_sent()) {
- $header = str_replace('Location: ','',$header);
+ $header = str_replace('Location: ', '', $header);
echo "\n";
} else {
header($header);
@@ -465,6 +481,15 @@
$modx->webAlertAndQuit("Document can not be it's own parent!");
}
+ $deleted = (int) $existingDocument['deleted'];
+ if ($parent != $oldparent && $parent > 0) {
+ $parentNotDeleted = $modx->db->getValue($modx->db->select('id', $modx->getFullTableName('site_content'),
+ "`id`={$parent} AND `deleted`=0"));
+ if (!$parentNotDeleted) {
+ $deleted = 1;
+ }
+ }
+
$parents = $modx->getParentIds($parent);
if (in_array($id, $parents)) {
$modx->webAlertAndQuit("Document descendant can not be it's parent!");
@@ -491,10 +516,10 @@
if (!$was_published && $published) {
$publishedon = $currentdate;
$publishedby = $modx->getLoginUserID();
- }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) {
+ } elseif ((!empty($pub_date) && $pub_date <= $currentdate && $published)) {
$publishedon = $pub_date;
$publishedby = $modx->getLoginUserID();
- }elseif ($was_published && !$published) {
+ } elseif ($was_published && !$published) {
$publishedon = 0;
$publishedby = 0;
} else {
@@ -503,10 +528,10 @@
}
// invoke OnBeforeDocFormSave event
- $modx->invokeEvent("OnBeforeDocFormSave", array (
+ $modx->invokeEvent("OnBeforeDocFormSave", [
"mode" => "upd",
- "id" => $id
- ));
+ "id" => $id
+ ]);
// update the document
$modx->db->update(
@@ -520,6 +545,7 @@
. "link_attributes='{$link_attributes}', "
. "isfolder={$isfolder}, "
. "richtext={$richtext}, "
+ . "deleted={$deleted}, "
. "published={$published}, "
. "pub_date={$pub_date}, "
. "unpub_date={$unpub_date}, "
@@ -542,29 +568,34 @@
// update template variables
$rs = $modx->db->select('id, tmplvarid', $tbl_site_tmplvar_contentvalues, "contentid='{$id}'");
- $tvIds = array ();
+ $tvIds = [];
while ($row = $modx->db->getRow($rs)) {
$tvIds[$row['tmplvarid']] = $row['id'];
}
- $tvDeletions = array();
- $tvChanges = array();
+ $tvDeletions = [];
+ $tvChanges = [];
foreach ($tmplvars as $field => $value) {
if (!is_array($value)) {
- if (isset($tvIds[$value])) $tvDeletions[] = $tvIds[$value];
+ if (isset($tvIds[$value])) {
+ $tvDeletions[] = $tvIds[$value];
+ }
} else {
$tvId = $value[0];
$tvVal = $value[1];
if (isset($tvIds[$tvId])) {
- $tvChanges[] = array(array('tmplvarid' => $tvId, 'contentid' => $id, 'value' => $modx->db->escape($tvVal)), array('id' => $tvIds[$tvId]));
+ $tvChanges[] = [
+ ['tmplvarid' => $tvId, 'contentid' => $id, 'value' => $modx->db->escape($tvVal)],
+ ['id' => $tvIds[$tvId]]
+ ];
} else {
- $tvAdded[] = array('tmplvarid' => $tvId, 'contentid' => $id, 'value' => $modx->db->escape($tvVal));
+ $tvAdded[] = ['tmplvarid' => $tvId, 'contentid' => $id, 'value' => $modx->db->escape($tvVal)];
}
}
}
if (!empty($tvDeletions)) {
- $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN('.implode(',', $tvDeletions).')');
+ $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN(' . implode(',', $tvDeletions) . ')');
}
if (!empty($tvAdded)) {
@@ -581,40 +612,44 @@
// set document permissions
if ($use_udperms == 1 && is_array($document_groups)) {
- $new_groups = array();
+ $new_groups = [];
// process the new input
foreach ($document_groups as $value_pair) {
- list($group, $link_id) = explode(',', $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list)
+ [$group, $link_id] = explode(',',
+ $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list)
$new_groups[$group] = $link_id;
}
// grab the current set of permissions on this document the user can access
$isManager = $modx->hasPermission('access_permissions');
- $isWeb = $modx->hasPermission('web_access_permissions');
+ $isWeb = $modx->hasPermission('web_access_permissions');
$rs = $modx->db->select(
'groups_document.id, groups_document.document_group',
"{$tbl_document_groups} AS groups_document
LEFT JOIN {$tbl_documentgroup_names} AS dgn ON dgn.id = groups_document.document_group",
- "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups_document.document = '{$id}'"
- );
- $old_groups = array();
- while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id'];
+ "((1=" . (int) $isManager . " AND dgn.private_memgroup) OR (1=" . (int) $isWeb . " AND dgn.private_webgroup)) AND groups_document.document = '{$id}'"
+ );
+ $old_groups = [];
+ while ($row = $modx->db->getRow($rs)) {
+ $old_groups[$row['document_group']] = $row['id'];
+ }
// update the permissions in the database
- $insertions = $deletions = array();
+ $insertions = $deletions = [];
foreach ($new_groups as $group => $link_id) {
if (array_key_exists($group, $old_groups)) {
unset($old_groups[$group]);
continue;
} elseif ($link_id == 'new') {
- $insertions[] = '('.(int)$group.','.$id.')';
+ $insertions[] = '(' . (int) $group . ',' . $id . ')';
}
}
if (!empty($insertions)) {
- $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $insertions));
+ $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',',
+ $insertions));
}
if (!empty($old_groups)) {
- $modx->db->delete($tbl_document_groups, "id IN (".implode(',', $old_groups).")");
+ $modx->db->delete($tbl_document_groups, "id IN (" . implode(',', $old_groups) . ")");
}
// necessary to remove all permissions as document is public
if ((isset($_POST['chkalldocs']) && $_POST['chkalldocs'] == 'on')) {
@@ -624,7 +659,7 @@
// do the parent stuff
if ($parent != 0) {
- $fields = array('isfolder' => 1);
+ $fields = ['isfolder' => 1];
$modx->db->update($fields, $tbl_site_content, "id='{$_REQUEST['parent']}'");
}
@@ -633,16 +668,16 @@
$limit = $modx->db->getValue($rs);
if ($limit == 0) {
- $fields = array('isfolder' => 0);
+ $fields = ['isfolder' => 0];
$modx->db->update($fields, $tbl_site_content, "id='{$oldparent}'");
}
// invoke OnDocFormSave event
- $modx->invokeEvent("OnDocFormSave", array (
+ $modx->invokeEvent("OnDocFormSave", [
"mode" => "upd",
- "id" => $id
- ));
+ "id" => $id
+ ]);
// secure web documents - flag as private
include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php";
@@ -659,10 +694,9 @@
// empty cache
$modx->clearCache('full');
}
-
- if ($_POST['refresh_preview'] == '1')
- $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev";
- else {
+ if ($_POST['refresh_preview'] == '1') {
+ $header = "Location: " . MODX_SITE_URL . "index.php?id=$id&z=manprev";
+ } else {
if ($_POST['stay'] != '2' && $id > 0) {
$modx->unlockElement(7, $id);
}
@@ -675,13 +709,13 @@
// document
$a = ($_POST['stay'] == '2') ? "27&id=$id" : "4&pid=$parent";
}
- $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'].$add_path;
+ $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'] . $add_path;
} else {
- $header = "Location: index.php?a=3&id=$id&r=1".$add_path;
+ $header = "Location: index.php?a=3&id=$id&r=1" . $add_path;
}
}
if (headers_sent()) {
- $header = str_replace('Location: ','',$header);
+ $header = str_replace('Location: ', '', $header);
echo "\n";
} else {
header($header);
@@ -690,3 +724,4 @@
default :
$modx->webAlertAndQuit("No operation set in request.");
}
+
diff --git a/manager/processors/save_module.processor.php b/manager/processors/save_module.processor.php
index ada5f818de..6907a5177c 100755
--- a/manager/processors/save_module.processor.php
+++ b/manager/processors/save_module.processor.php
@@ -10,17 +10,17 @@
$name = $modx->db->escape(trim($_POST['name']));
$description = $modx->db->escape($_POST['description']);
$resourcefile = $modx->db->escape($_POST['resourcefile']);
-$enable_resource = $_POST['enable_resource'] == 'on' ? 1 : 0;
+$enable_resource = isset($_POST['enable_resource']) && $_POST['enable_resource'] == 'on' ? 1 : 0;
$icon = $modx->db->escape($_POST['icon']);
//$category = (int)$_POST['category'];
-$disabled = $_POST['disabled'] == 'on' ? 1 : 0;
-$wrap = $_POST['wrap'] == 'on' ? 1 : 0;
-$locked = $_POST['locked'] == 'on' ? 1 : 0;
+$disabled = isset($_POST['disabled']) && $_POST['disabled'] == 'on' ? 1 : 0;
+$wrap = isset($_POST['wrap']) && $_POST['wrap'] == 'on' ? 1 : 0;
+$locked = isset($_POST['locked']) && $_POST['locked'] == 'on' ? 1 : 0;
$modulecode = $modx->db->escape($_POST['post']);
$properties = $modx->db->escape($_POST['properties']);
-$enable_sharedparams = $_POST['enable_sharedparams'] == 'on' ? 1 : 0;
+$enable_sharedparams = isset($_POST['enable_sharedparams']) && $_POST['enable_sharedparams'] == 'on' ? 1 : 0;
$guid = $modx->db->escape($_POST['guid']);
-$parse_docblock = $_POST['parse_docblock'] == "1" ? '1' : '0';
+$parse_docblock = isset($_POST['parse_docblock']) && $_POST['parse_docblock'] == "1" ? '1' : '0';
$currentdate = time() + $modx->config['server_offset_time'];
//Kyle Jaebker - added category support
@@ -192,7 +192,7 @@ function saveUserGroupAccessPermissons()
if ($newid) {
$id = $newid;
}
- $usrgroups = $_POST['usrgroups'];
+ $usrgroups = $_POST['usrgroups'] ?? [];
// check for permission update access
if ($use_udperms == 1) {
diff --git a/manager/processors/save_plugin.processor.php b/manager/processors/save_plugin.processor.php
index 8d2805ac81..97149d21e2 100755
--- a/manager/processors/save_plugin.processor.php
+++ b/manager/processors/save_plugin.processor.php
@@ -9,13 +9,13 @@
$id = (int)$_POST['id'];
$name = $modx->db->escape(trim($_POST['name']));
$description = $modx->db->escape($_POST['description']);
-$locked = $_POST['locked'] == 'on' ? '1' : '0';
+$locked = isset($_POST['locked']) && $_POST['locked'] == 'on' ? '1' : '0';
$plugincode = $modx->db->escape($_POST['post']);
$properties = $modx->db->escape($_POST['properties']);
-$disabled = $_POST['disabled'] == 'on' ? '1' : '0';
+$disabled = isset($_POST['disabled']) && $_POST['disabled'] == 'on' ? '1' : '0';
$moduleguid = $modx->db->escape($_POST['moduleguid']);
-$sysevents = !empty($_POST['sysevents']) ? $_POST['sysevents'] : array();
-$parse_docblock = $_POST['parse_docblock'] == '1' ? '1' : '0';
+$sysevents = !empty($_POST['sysevents']) && is_array($_POST['sysevents']) ? $_POST['sysevents'] : array();
+$parse_docblock = isset($_POST['parse_docblock']) && $_POST['parse_docblock'] == '1' ? '1' : '0';
$currentdate = time() + $modx->config['server_offset_time'];
//Kyle Jaebker - added category support
@@ -40,7 +40,7 @@
$moduleguid = isset($parsed['guid']) ? $parsed['guid'] : $moduleguid;
$description = isset($parsed['description']) ? $parsed['description'] : $description;
- $version = isset($parsed['version']) ? '' . $parsed['version'] . ' ' : '';
+ $version = isset($parsed['version']) ? '' . $parsed['version'] . ' ' : '';
if ($version) {
$description = $version . trim(preg_replace('/(.+?)+(<\/b>)/i', '', $description));
}
@@ -178,6 +178,7 @@ function saveEventListeners($id, $sysevents, $mode)
$formEventList = array();
foreach ($sysevents as $evtId) {
if(!preg_match('@^[1-9][0-9]*$@',$evtId)) $evtId = getEventIdByName($evtId);
+ if ($evtId === false) continue;
if ($mode == '101') {
$rs = $modx->db->select('max(priority) as priority', '[+prefix+]site_plugin_events', "evtid='{$evtId}'");
} else {
@@ -216,7 +217,7 @@ function saveEventListeners($id, $sysevents, $mode)
/**
* @param string $name
- * @return string|int
+ * @return string|int|bool
*/
function getEventIdByName($name)
{
@@ -230,6 +231,6 @@ function getEventIdByName($name)
$eventIds[$row['name']] = $row['id'];
}
- return $eventIds[$name];
+ return $eventIds[$name] ?? false;
}
diff --git a/manager/processors/save_tmplvars.processor.php b/manager/processors/save_tmplvars.processor.php
index 7260cabd83..2c0f49b480 100755
--- a/manager/processors/save_tmplvars.processor.php
+++ b/manager/processors/save_tmplvars.processor.php
@@ -16,7 +16,7 @@
$rank = isset ($_POST['rank']) ? $modx->db->escape($_POST['rank']) : 0;
$display = $modx->db->escape($_POST['display']);
$params = $modx->db->escape($_POST['params']);
-$locked = $_POST['locked'] == 'on' ? 1 : 0;
+$locked = isset($_POST['locked']) && $_POST['locked'] == 'on' ? 1 : 0;
$origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76;
$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null;
$currentdate = time() + $modx->config['server_offset_time'];
@@ -200,7 +200,7 @@ function saveTemplateVarAccess()
$modx->db->delete($tbl_site_tmplvar_templates, "tmplvarid = '{$id}'");
if (!empty($templates)) {
for ($i = 0; $i < count($templates); $i++) {
- $setRank = ($getRankArray[$templates[$i]]) ? $getRankArray[$templates[$i]] : 0;
+ $setRank = isset($getRankArray[$templates[$i]]) && $getRankArray[$templates[$i]] ? $getRankArray[$templates[$i]] : 0;
$modx->db->insert(array(
'tmplvarid' => $id,
'templateid' => $templates[$i],
diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php
index da0ef70e08..eb01a7969e 100755
--- a/manager/processors/save_web_user.processor.php
+++ b/manager/processors/save_web_user.processor.php
@@ -19,7 +19,7 @@
}
$id = (int)$input['id'];
-$oldusername = $input['oldusername'];
+$oldusername = $input['oldusername'] ?? '';
$newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User";
$esc_newusername = $modx->db->escape($newusername);
$fullname = $input['fullname'];
@@ -48,7 +48,7 @@
$blocked = !empty($input['blocked']) ? $input['blocked'] : 0;
$blockeduntil = !empty($input['blockeduntil']) ? $modx->toTimeStamp($input['blockeduntil']) : 0;
$blockedafter = !empty($input['blockedafter']) ? $modx->toTimeStamp($input['blockedafter']) : 0;
-$user_groups = $input['user_groups'];
+$user_groups = isset($input['user_groups']) && is_array($input['user_groups']) ? $input['user_groups'] : [];
// verify password
if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) {
@@ -70,7 +70,7 @@
}
// check if the email address already exist
- if ($modx->config['allow_multiple_emails'] != 1) {
+ if ($modx->getConfig('allow_multiple_emails') != 1) {
$rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'");
$limit = $modx->db->getValue($rs);
if ($limit > 0) {
@@ -419,7 +419,7 @@ function saveUserSettings($id)
$modx->db->delete($tbl_web_user_settings, "webuser='{$id}'");
foreach ($settings as $n) {
- $vl = $_POST[$n];
+ $vl = $_POST[$n] ?? '';
if (is_array($vl)) {
$vl = implode(",", $vl);
}
diff --git a/manager/processors/undelete_content.processor.php b/manager/processors/undelete_content.processor.php
index 84cdc95f72..681755fcc3 100755
--- a/manager/processors/undelete_content.processor.php
+++ b/manager/processors/undelete_content.processor.php
@@ -14,7 +14,12 @@
/************ webber ********/
$content=$modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
$pid=($content['parent']==0?$id:$content['parent']);
-
+if ($content['parent'] > 0) {
+ $parentNotDeleted = $modx->db->getValue($modx->db->select('id', $modx->getFullTableName('site_content'), "`id`={$content['parent']} AND `deleted`=0"));
+ if (!$parentNotDeleted) {
+ $modx->webAlertAndQuit($_lang["error_parent_deleted"]);
+ }
+}
/************** webber *************/
$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC';
$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon';
diff --git a/vendor/.htaccess b/vendor/.htaccess
index ff2beb844b..de8d8a9d42 100755
--- a/vendor/.htaccess
+++ b/vendor/.htaccess
@@ -1,2 +1,7 @@
-order deny,allow
-deny from all
+
+ Require all denied
+
+
+ order deny,allow
+ deny from all
+
Posts: [+comment.userpostcount+]\n
\n \n