Skip to content
This repository was archived by the owner on Mar 8, 2021. It is now read-only.

Commit 83ab6d1

Browse files
authored
Merge pull request #1414 from evolution-cms/master
1.4.4
2 parents c79c717 + 9b79900 commit 83ab6d1

File tree

197 files changed

+4951
-2953
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+4951
-2953
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
# Manager
4747
/manager/includes/config.inc.php
48+
/manager/includes/config_mutator.php
4849

4950
# Composer
5051
/composer.phar
@@ -71,4 +72,4 @@ Desktop.ini
7172
.rocketeer
7273

7374
# except do not ignore .gitignore
74-
!.gitignore
75+
!.gitignore

assets/docs/changelog.txt

+126
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,132 @@
11
This file shows the changes in recent releases of Evolution CMS. The most current release is usually the
22
development release, and is only shown to give an idea of what's currently in the pipeline.
33

4+
Evolution CMS 1.4.4 (Jun 08, 2018)
5+
* [GitHub:#5d177a4ea] - [I] Auto set Sender (Евгений Борисов)
6+
* [GitHub:#f13d19d60] - [I] Move color switcher icon (Mr B)
7+
* [GitHub:#ee5cb56b2] - [I] Remove css / colour switch conflict (Mr B)
8+
* [GitHub:#32d2165c7] - [I] Update save_user.processor.php (Mr B)
9+
* [GitHub:#a450d22af] - [I] Trim user/webuser email address (Mr B)
10+
* [GitHub:#cdbeaf8b9] - [I] Update web_user_management.static.php (Mr B)
11+
* [GitHub:#82cda9654] - [I] Replace gender on user/webuser tables (Mr B)
12+
* [GitHub:#b9c3e474c] - [F] - Ignored if default class is extended (Евгений Борисов)
13+
* [GitHub:#dda339c27] - [I] config_mutator.php (Agel_Nash)
14+
* [GitHub:#cb55e213c] - [I] Define MODX_CLI (Agel_Nash)
15+
* [GitHub:#a3fc8c57c] - [I] refactoring webAlertAndQuit (Agel_Nash)
16+
* [GitHub:#bbefb5a28] - [I] $_lang['invalid_event_response'] (Agel_Nash)
17+
* [GitHub:#c60c6a8e6] - [I] OnBeforeMinifyCss (Agel_Nash)
18+
* [GitHub:#81c160eea] - [I] Native support mixed types in a output statement (Agel_Nash)
19+
* [GitHub:#019462178] - [F] Conflict with DLTemplate::renderDoc() (Евгений Борисов)
20+
* [GitHub:#0f0095dd7] - [F] style for 1200px - (dmi3yy)
21+
* [GitHub:#21b31569c] - Update preload.functions.inc.php (Евгений Борисов)
22+
* [GitHub:#d568f89d2] - [I] Code style (Agel_Nash)
23+
* [GitHub:#769270b96] - [S] Cross-Site Scripting https://www.exploit-db.com/exploits/44775/ Site name field XSS fix: https://github.com/nathunandwani/ClipperCMS/commit/f286fbfa81dc3728dbbf6d9d817c8848edcad0b2 (Agel_Nash)
24+
* [GitHub:#ddb47a7d0] - [F] Fix buttons transition and focus background-color (Serg)
25+
* [GitHub:#5edac57c8] - [I] Moving tv parameters without a category to the General tab (Serg)
26+
* [GitHub:#2950b760d] - [F] correct install finish (dmi3yy)
27+
* [GitHub:#ebed40c60] - [F] undeclared variable (Serg)
28+
* [GitHub:#f399f2ea8] - [F] broken OnParseProperties event (Pathologic)
29+
* [GitHub:#ef95a606a] - [F] update DocLister and FormLister (dmi3yy)
30+
* [GitHub:#8c873d61a] - [F] Update tab6_filemanager_settings.inc.php (Mr B)
31+
* [GitHub:#3608ab90f] - [F] Update tab5_security_settings.inc.php (Mr B)
32+
* [GitHub:#0c2fa0ddd] - [I] Add missing events for System Settings tabs (Mr B)
33+
* [GitHub:#323e9cdc9] - [F] tab3 invokeEvent to last tr (Mr B)
34+
* [GitHub:#8d1a0ebac] - [F] revert tab change (Mr B)
35+
* [GitHub:#aff400f72] - [F] Correct message urls (Mr B)
36+
* [GitHub:#6fa23c6a7] - [I] Show element icon (Mr B)
37+
* [GitHub:#7b3692125] - [F] fix locked (Ser1ous)
38+
* [GitHub:#e32d25e19] - [F] Fix strict mode bug on get tv list (Ser1ous)
39+
* [GitHub:#67117ab6b] - [F] fix error log in phpmailer (Pathologic)
40+
* [GitHub:#569a1533c] - [I] singleton (Pathologic)
41+
* [GitHub:#946f7f5de] - [F] fix code format (Ser1ous)
42+
* [GitHub:#bb174a09d] - [I] Ctr+Alt+L on PhpStorm (Ser1ous)
43+
* [GitHub:#4c5a44233] - [I] Add event pub/unpub documents (Ser1ous)
44+
* [GitHub:#99edc5fb5] - [F] Fix ios iframe scroll so only applied to ios (Mr B)
45+
* [GitHub:#bd7237579] - [F] Update qm.inc.php (Mr B)
46+
* [GitHub:#2905e58c7] - [I] Give custom QM buttons a title (Mr B)
47+
* [GitHub:#d287e2b85] - [F] Update execute_module.processor.php (Mr B)
48+
* [GitHub:#12c151b13] - [I] Make store fit iframe width (Mr B)
49+
* [GitHub:#ccb4ac7a6] - [I] Change html check for scroller (Mr B)
50+
* [GitHub:#e100bef00] - [I] iframe scroller for for Module if no need fix add to GET &api=1 (dmi3yy)
51+
* [GitHub:#97179a3bd] - [I] Stacked table cells for system configuration (Piotr Matysiak)
52+
* [GitHub:#84617f23b] - [I] Stacked table cells on small screens (Piotr Matysiak)
53+
* [GitHub:#4db235560] - [F] fix for module iframe scrolling (Mr B)
54+
* [GitHub:#c07af3d5f] - [F] Update modx.min.js (Mr B)
55+
* [GitHub:#c84388af0] - [I] Restrict menu tree auto hide to small mobile (Mr B)
56+
* [GitHub:#7acb549af] - [I] Polish translation (Piotr Matysiak)
57+
* [GitHub:#dbd75f74f] - [I] move login page and menu setting to tab 4 (dmi3yy)
58+
* [GitHub:#f266be8b6] - [F] TinyMCE darcness theme by default - need set lightgray by default #613 (dmi3yy)
59+
* [GitHub:#5c6d120ed] - [F] update DocLister 2.3.15 (dmi3yy)
60+
* [GitHub:#8aed61699] - [F] update FormLister to 1.7.19 (dmi3yy)
61+
* [GitHub:#10a9a62b0] - [I] add params for manager_menu_position (dmi3yy)
62+
* [GitHub:#816c645a0] - [F] welcome widget fix (Piotr Matysiak)
63+
* [GitHub:#cc0e2294c] - [F] Fix manager restrict by day login (Mr B)
64+
* [GitHub:#3658514a8] - [I] welcome widget change (Piotr Matysiak)
65+
* [GitHub:#631286ca9] - [F] welcome and online widgets stacked (Piotr Matysiak)
66+
* [GitHub:#a0198c207] - [F] #650 Display valid-hostnames after setting them (Deesen)
67+
* [GitHub:#ffd97e6bf] - [F] #616 Fix TinyMCE4 custom-theme´s toolbars with global settings (Deesen)
68+
* [GitHub:#657088dc1] - [F] Update .htaccess (Евгений Борисов)
69+
* [GitHub:#454f4f975] - [F] Update index.css (Mr B)
70+
* [GitHub:#bdc53cbf2] - [F] Update modx.min.js (Mr B)
71+
* [GitHub:#135e9b047] - [F] Update modx.js (Mr B)
72+
* [GitHub:#009388364] - [F] iOS iframe Scrolling/jumping (Mr B)
73+
* [GitHub:#bec6c2f09] - [F] #643 Fix TinyMCE4 mobile-mode (Deesen)
74+
* [GitHub:#c26f0eaa6] - [I] Add space to bottom of menu tree (Mr B)
75+
* [GitHub:#8ecd06ecf] - [I] Remove 'Top how many' option as not used (Mr B)
76+
* [GitHub:#30673e780] - refactor stay icons (Serg)
77+
* [GitHub:#adc145943] - [S] Secutiy fix for old version (dmi3yy)
78+
* [GitHub:#1c7f67c1b] - [F] #629 Fix issue with HTTP2/SSL & check connection to server (Deesen)
79+
* [GitHub:#aa7892eea] - [F] store sql fixed (mnoskov)
80+
* [GitHub:#4e6d54387] - [F] box-shadow (Piotr Matysiak)
81+
* [GitHub:#57821c93c] - [I] Remove scrollbars in centered layout (Piotr Matysiak)
82+
* [GitHub:#be9830839] - [I] Login form positions (Piotr Matysiak)
83+
* [GitHub:#e6fec0458] - [F] Set loginbox position CSS class (Piotr Matysiak)
84+
* [GitHub:#160590f23] - [I] Login page - set images placeholders (Piotr Matysiak)
85+
* [GitHub:#009833f50] - [I] Manager Polish Translation update (Piotr Matysiak)
86+
* [GitHub:#28a082472] - [I] Manager Polish Translation (Piotr Matysiak)
87+
* [GitHub:#b69d83b50] - [I] Optimized images (Piotr Matysiak)
88+
* [GitHub:#60cc4b893] - [I] First commit of new login page (Piotr Matysiak)
89+
* [GitHub:#0e628b256] - [I] setting for customize login page (dmi3yy)
90+
* [GitHub:#9b0f507c2] - [F] for TinyMCE skin by default lightgray (dmi3yy)
91+
* [GitHub:#73ebfee5a] - [F] missing tabheader border (Piotr Matysiak)
92+
* [GitHub:#0840e3a31] - [F] minify css default theme (Serg)
93+
* [GitHub:#3cf94bf7d] - [F] width auto for select size=1 (Serg)
94+
* [GitHub:#c2a4032d7] - [F] logo page help (Serg)
95+
* [GitHub:#74da26055] - [F] class input-group-addon (Serg)
96+
* [GitHub:#f8f91e41a] - [F] pagination darkness theme (Serg)
97+
* [GitHub:#4eb2414d3] - [F] hover background-color mainMenu item version (Serg)
98+
* [GitHub:#19b1f5534] - [F] fix for darkness mode (Piotr Matysiak)
99+
* [GitHub:#27b5a37fb] - [F] Fix missing border (Piotr Matysiak)
100+
101+
Evolution CMS 1.4.3 (Apr 04, 2018)
102+
* [GitHub:#e10383b14] - update DocLister (dmi3yy)
103+
* [GitHub:#2654f2c59] - update Formlister (dmi3yy)
104+
* [GitHub:#64c4e9adf] - add select for theme mode in managers settings (dmi3yy)
105+
* [GitHub:#44f8f6c88] - fix for not touch composer.json on update (dmi3yy)
106+
* [GitHub:#4fd89e618] - add Darkness style for tinyMCE (dmi3yy)
107+
* [GitHub:#8526ee4b5] - add styles for modes theme (Serg)
108+
* [GitHub:#097a1076b] - more checks in cli mode (Pathologic)
109+
* [GitHub:#6fb277896] - Missing introtext in Recent Resources (Piotr Matysiak)
110+
* [GitHub:#998f3a2fa] - Fix #603 bug for resource tree scrolling (Piotr Matysiak)
111+
* [GitHub:#f8c17c495] - moved JS code to a file manager/media/script/main.js (Serg)
112+
* [GitHub:#060e49f1d] - fix empty template on save tv (Serg)
113+
* [GitHub:#3fb227540] - [F] #577 Fix TinyMCE for [*introtext*] (Deesen)
114+
* [GitHub:#1a5a68027] - Fix Extras buttons on 1.4.1 #571 (dmi3yy)
115+
* [GitHub:#263737fbe] - add user_agent info to manager_log (dmi3yy)
116+
* [GitHub:#36dfe9c6d] - write manager IP address to manager_log (dmi3yy)
117+
* [GitHub:#8a3bee0ce] - new settings manager_theme_mode (dmi3yy)
118+
* [GitHub:#745f633af] - setting color schema for manager template (dmi3yy)
119+
* [GitHub:#f25ec1e59] - fix 577 TinyMCE introtext mode not work (dmi3yy)
120+
* [GitHub:#d27e12bdc] - fix notice (Serg)
121+
* [GitHub:#10ce1f270] - fix TinyMCE disable after update to 1.4.2 (dmi3yy)
122+
* [GitHub:#dc06fb72f] - fix possible wrong path calculation (Pathologic)
123+
* [GitHub:#b6fecddec] - [I] Wrap TinyMCE3 Toolbar (Mr B)
124+
* [GitHub:#f55089ba7] - [F] Prevent long select option text values overflowing container (Mr B)
125+
* [GitHub:#40f2a53d4] - add view ability for ini files in manager files (dmi3yy)
126+
* [GitHub:#d3117b1c2] - fix demo site (Formlister, param reply-to) (dmi3yy)
127+
* [GitHub:#a5aff20db] - formlister fix typo (dmi3yy)
128+
129+
4130
Evolution CMS 1.4.2 (Mar 23, 2018)
5131
* [GitHub:#6a33e6f2b] - now you can use argv like this: php cli-install.php --database_server=localhost --database=db --database_user=dbuser --database_password=dbpass --table_prefix=evo_ --cmsadmin=admin [email protected] --cmspassword=123456 --language=ru --mode=new --installData=n --removeInstall=y (dmi3yy)
6132
* [GitHub:#d8e7ec072] - run install file (dmi3yy)
Loading

assets/lib/APIHelpers.class.php

+33
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,39 @@ public static function checkString($value, $minLen = 1, $alph = array(), $mixArr
381381
return $flag;
382382
}
383383

384+
/**
385+
* @param $IDs
386+
* @param string $sep
387+
* @param integer[] $ignore
388+
* @return array
389+
* @throws Exception
390+
*/
391+
public static function cleanIDs($IDs, $sep = ',', $ignore = array())
392+
{
393+
$out = array();
394+
if (!is_array($IDs)) {
395+
if (is_scalar($IDs)) {
396+
$IDs = explode($sep, $IDs);
397+
} else {
398+
$IDs = array();
399+
throw new Exception('Invalid IDs list <pre>' . print_r($IDs, 1) . '</pre>');
400+
}
401+
}
402+
foreach ($IDs as $item) {
403+
$item = trim($item);
404+
if (is_scalar($item) && (int)$item >= 0) { //Fix 0xfffffffff
405+
if (!empty($ignore) && in_array((int)$item, $ignore, true)) {
406+
$this->log[] = 'Ignore id ' . (int)$item;
407+
} else {
408+
$out[] = (int)$item;
409+
}
410+
}
411+
}
412+
$out = array_unique($out);
413+
414+
return $out;
415+
}
416+
384417
/**
385418
* Переменовывание элементов массива
386419
*

assets/lib/MODxAPI/MODx.php

+1-20
Original file line numberDiff line numberDiff line change
@@ -559,26 +559,7 @@ public function isChanged($key)
559559
*/
560560
final public function cleanIDs($IDs, $sep = ',', $ignore = array())
561561
{
562-
$out = array();
563-
if (!is_array($IDs)) {
564-
if (is_scalar($IDs)) {
565-
$IDs = explode($sep, $IDs);
566-
} else {
567-
$IDs = array();
568-
throw new Exception('Invalid IDs list <pre>' . print_r($IDs, 1) . '</pre>');
569-
}
570-
}
571-
foreach ($IDs as $item) {
572-
$item = trim($item);
573-
if (is_scalar($item) && (int)$item >= 0) { //Fix 0xfffffffff
574-
if (!empty($ignore) && in_array((int)$item, $ignore, true)) {
575-
$this->log[] = 'Ignore id ' . (int)$item;
576-
} else {
577-
$out[] = (int)$item;
578-
}
579-
}
580-
}
581-
$out = array_unique($out);
562+
$out = APIhelpers::cleanIDs($IDs, $sep, $ignore);
582563

583564
return $out;
584565
}

assets/lib/MODxAPI/modManagers.php

100755100644
+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function edit($id)
150150
$result = $this->query("
151151
SELECT * from {$this->makeTable('user_attributes')} as attribute
152152
LEFT JOIN {$this->makeTable('manager_users')} as user ON user.id=attribute.internalKey
153-
WHERE BINARY {$find}='{$this->escape($id)}'
153+
WHERE {$find}='{$this->escape($id)}'
154154
");
155155
$this->field = $this->modx->db->getRow($result);
156156

assets/lib/MODxAPI/modResource.php

+19-11
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ public function get($key)
310310
$tvID = APIHelpers::getkey($this->tv, $key, 0);
311311
if (in_array($tvID, $tvTPL) && is_null($out)) {
312312
$out = APIHelpers::getkey($this->tvd, $key, null);
313+
$out = $out['default'];
313314
}
314315
}
315316

@@ -444,7 +445,7 @@ public function create($data = array())
444445
$this->close();
445446
$fld = array();
446447
foreach ($this->tvd as $name => $tv) {
447-
$fld[$name] = $tv;
448+
$fld[$name] = $tv['default'];
448449
};
449450
$this->store($fld);
450451

@@ -468,24 +469,29 @@ public function edit($id)
468469
$this->close();
469470
$this->markAllEncode();
470471
$this->newDoc = false;
471-
472472
$result = $this->query("SELECT * from {$this->makeTable('site_content')} where `id`=" . (int)$id);
473473
$this->fromArray($this->modx->db->getRow($result));
474474
$result = $this->query("SELECT * from {$this->makeTable('site_tmplvar_contentvalues')} where `contentid`=" . (int)$id);
475475
while ($row = $this->modx->db->getRow($result)) {
476476
$this->field[$this->tvid[$row['tmplvarid']]] = $row['value'];
477477
}
478+
$fld = array();
479+
foreach ($this->tvd as $name => $tv) {
480+
if ($this->belongsToTemplate($this->tv[$name])) {
481+
$fld[$name] = $tv['default'];
482+
}
483+
};
484+
$this->store(array_merge($fld, $this->field));
478485
if (empty($this->field['id'])) {
479486
$this->id = null;
480487
} else {
481488
$this->id = $this->field['id'];
482489
$this->set('editedby', null)->touch();
483490
$this->decodeFields();
484491
}
485-
$this->store($this->toArray(null, null, null, false));
486492
unset($this->field['id']);
487493
}
488-
494+
489495
return $this;
490496
}
491497

@@ -590,7 +596,7 @@ public function save($fire_events = false, $clearCache = false)
590596
foreach ($fld as $key => $value) {
591597
if (empty($this->tv[$key]) || !$this->isChanged($key) || !$this->belongsToTemplate($this->tv[$key])) {
592598
continue;
593-
} elseif ($value === '') {
599+
} elseif ($value === '' || is_null($value) || (isset($this->tvd[$key]) && $value == $this->tvd[$key]['default'])) {
594600
$_deleteTVs[] = $this->tv[$key];
595601
} else {
596602
$_insertTVs[$this->tv[$key]] = $this->escape($value);
@@ -794,7 +800,7 @@ protected function checkAlias($alias)
794800
*/
795801
public function issetField($key)
796802
{
797-
return (array_key_exists($key, $this->default_field) || array_key_exists($key, $this->tv));
803+
return (array_key_exists($key, $this->default_field) || (array_key_exists($key, $this->tv) && $this->belongsToTemplate($this->tv[$key])));
798804
}
799805

800806
/**
@@ -806,12 +812,14 @@ protected function get_TV($reload = false)
806812
$this->modx->_TVnames = $this->loadFromCache('_TVnames');
807813
if ($this->modx->_TVnames === false || empty($this->modx->_TVnames) || $reload) {
808814
$this->modx->_TVnames = array();
809-
$result = $this->query('SELECT `id`,`name`,`default_text`,`type` FROM ' . $this->makeTable('site_tmplvars'));
815+
$result = $this->query('SELECT `id`,`name`,`default_text`,`type`,`display`,`display_params` FROM ' . $this->makeTable('site_tmplvars'));
810816
while ($row = $this->modx->db->GetRow($result)) {
811817
$this->modx->_TVnames[$row['name']] = array(
812-
"id" => $row['id'],
813-
"type" => $row['type'],
814-
"default" => $row['default_text']
818+
'id' => $row['id'],
819+
'type' => $row['type'],
820+
'default' => $row['default_text'],
821+
'display' => $row['display'],
822+
'display_params' => $row['display_params']
815823
);
816824
}
817825
$this->saveToCache($this->modx->_TVnames, '_TVnames');
@@ -861,7 +869,7 @@ protected function loadTVDefault(array $tvId = array())
861869
$this->tvd = array();
862870
foreach ($tvId as $id) {
863871
$name = $this->tvid[$id];
864-
$this->tvd[$name] = $this->modx->_TVnames[$name]['default'];
872+
$this->tvd[$name] = $this->modx->_TVnames[$name];
865873
}
866874
}
867875

0 commit comments

Comments
 (0)