Skip to content

Commit db26d9c

Browse files
committed
Merge pull request #105 from Ariadne-CMS/dev
last changes for ariadne 9.5
2 parents 1fe645a + 79195a7 commit db26d9c

File tree

10 files changed

+123
-20
lines changed

10 files changed

+123
-20
lines changed

docs/CHANGES

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
===================
2+
Changes Ariadne 9.5
3+
===================
4+
5+
Changes:
6+
- the ariadne backend details view can now be configured to show different
7+
columns. In addition you can add custom filters or completely rewrite the
8+
query
9+
- ar\url now users arc\url, which supports all valid URL formats
10+
- php7 support improved
11+
- onbeforesave and workflow.pre now have access to the complete set of
12+
customdata
13+
- added ar\store::info method, that returns meta information about objects.
14+
This is faster and uses less memory than calling templates.
15+
16+
Bug fixes:
17+
- fixed a bug in the html cleaner that broke html5 custom tags / web
18+
components
19+
- fixed a bug that allowed onbeforesave / user.workflow.pre to overwrite
20+
properties
21+
- fixed bug in upgrade script that prevented upgrades from 8.4 to 9.x
22+
- fixed possible XSS attacks with file names in a file upload
23+
- ar\contents\file::getContents now forces the stream pointer to stay put,
24+
this fixes problems in specific php versions.
25+
- fixed use of array functions in pinp that update the array by reference
26+
(usort, uasort, array_walk, etc.)
27+
28+
129
========================
230
Changes Ariadne 9.4
331
========================

ftp/loader.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,6 @@ function ftp_GenListEntry($entry) {
10791079
}
10801080

10811081

1082-
sleep(1);
10831082
// debugon("pinp");
10841083

10851084
// set PHP error handling

lib/ar.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,10 @@ public static function getPath( $options = array() ) {
493493
} else if ($options['rememberShortcuts']) {
494494
$me->_load('mod_keepurl.php');
495495
$path = pinp_keepurl::_make_path( $path );
496+
} else if ( $options['searchObject'] ) {
497+
if (isset($me->data->path)) {
498+
$path = $me->data->path;
499+
}
496500
}
497501
} else {
498502
$path = self::makePath( '/', $options['path'] );
@@ -510,6 +514,21 @@ public static function getObject( $options = array() ) {
510514
return $me;
511515
}
512516

517+
public static function getQuery( $query, $options = array() ) {
518+
$me = self::getObject( $options );
519+
if ($me) {
520+
if (isset($me->data->query)) {
521+
if ( $query ) {
522+
$query = "(" . $me->data->query . ") and $query";
523+
} else {
524+
$query = $me->data->query;
525+
}
526+
return $query;
527+
}
528+
}
529+
return $query;
530+
}
531+
513532
public static function getLoader( $options = array() ) { //FIXME: move code from ar_loader to here
514533
return ar_loader::getLoader();
515534
}

lib/ar/store.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77

88
class ar_store extends arBase {
99
static public $rememberShortcuts = true;
10+
static public $searchObject = false;
1011

1112
public static function configure( $option, $value ) {
1213
switch ($option) {
1314
case 'rememberShortcuts' :
1415
self::$rememberShortcuts = $value;
1516
break;
17+
case 'searchObject' :
18+
self::$searchObject = $value;
19+
break;
1620
}
1721
}
1822

@@ -34,6 +38,17 @@ public static function find( $query = "" ) {
3438
return new ar_storeFind( ar::context()->getPath(), $query);
3539
}
3640

41+
public static function getSearchPath( $path ) {
42+
return ar::context()->getPath( array(
43+
'searchObject' => self::$searchObject,
44+
'path' => $path
45+
) );
46+
}
47+
48+
public static function getSearchQuery( $query ) {
49+
return ar::context()->getQuery( $query );
50+
}
51+
3752
public static function get( $path = "" ) {
3853
$path = (string) $path;
3954
return new ar_storeGet( ar::context()->getPath( array(
@@ -160,6 +175,11 @@ class ar_storeFind extends arBase {
160175
public function __construct( $path = '/', $query = '' ) {
161176
$this->path = (string)$path;
162177
$this->query = (string)$query;
178+
179+
if ( ar_store::$searchObject ) {
180+
$this->query = ar_store::getSearchQuery( $query );
181+
$this->path = ar_store::getSearchPath( $path );
182+
}
163183
}
164184

165185
public function call( $template, $args = null ) {

lib/objects/pfile.phtml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ class pfile extends pobject { // pfile class definition
103103
$defaultnls = $this->data->nls->default;
104104
$mimetype = $this->data->{$defaultnls}->mimetype;
105105
}
106-
if (!$mimetype && function_exists("get_content_type")) {
106+
if ( !$mimetype ) {
107+
$temp = ar_store_files::temp($file);
108+
$temp_file_meta = $temp->getMetaData();
109+
$mimetype = get_mime_type($temp_file_meta['uri']);
110+
}
111+
112+
if ($mimetype && function_exists("get_content_type")) {
107113
$mimetype = get_content_type($mimetype, basename($this->path));
108114
}
109115
if (!$ARCurrent->arDontCache && $ARCurrent->cacheCallChainSettings[$this->id]['serverCache'] != -1 && $this->CheckPublic('read')) {
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
if ( $this->CheckLogin("layout") && $this->CheckConfig() ) {
3+
$grepresults = [];
4+
if ( $search != "" ) {
5+
$filestore = $this->store->get_filestore("templates");
6+
$templates_path = $filestore->make_path($this->id);
7+
$esc_search = escapeshellarg($search);
8+
$greps = [];
9+
10+
11+
$result = exec($AR->Grep->path." ".$AR->Grep->options." $esc_search $templates_path*.pinp", $greps);
12+
$grepresults = [];
13+
foreach ($greps as $grep) {
14+
list($file, $linenr, $line) = explode(":", $grep, 3);
15+
$file = substr($file, strrpos($file, '/'));
16+
$file = substr($file, 2);
17+
$file = substr($file, 0, strrpos($file, '.'));
18+
if( !is_array($grepresults[$file])) {
19+
$grepresults[$file] = [];
20+
}
21+
$grepresults[$file][] = [ 'line' => $linenr, 'match' => $line ];
22+
}
23+
}
24+
$arResult = $grepresults;
25+
}
26+
?>

lib/version.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
22
$ARversion = array();
3-
$ARversion['version'] = '9.4';
4-
$ARversion['date'] = strtotime('2015-01-07');
3+
$ARversion['version'] = '9.5';
4+
$ARversion['date'] = strtotime('2016-03-22');
55
$ARversion['year'] = strftime('%G', $ARversion['date']);

lib/widgets/vedor/editor.v9.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,8 @@ function init() {
652652
if ( getOption('tagBoundaries') ) {
653653
vedor.editor.actions['vedor-show-tags'](document.getElementById('vdShowTagBoundaries'));
654654
}
655-
if ( getOption('properties') ) {
656-
vedor.editor.actions['vedor-properties'](document.getElementById('VD_META'));
655+
if ( getOption('properties') || vdOpenMetaPane ) {
656+
vedor.editor.actions['vedor-properties'](document.getElementById('VD_META'),true);
657657
}
658658
if ( getOption('tagStack')===false ) { // default is on, this toggles it
659659
vedor.editor.actions['vedor-show-tags-stack'](document.getElementById('vdShowTagStack'));
@@ -3681,8 +3681,10 @@ function vdLogOff() {
36813681
}
36823682
window_onresize();
36833683
},
3684-
"vedor-properties" : function(el) {
3685-
VD_META_onclick();
3684+
"vedor-properties" : function(el, enabled) {
3685+
if ( vdMetaDataSlideEnabled != enabled ) {
3686+
VD_META_onclick();
3687+
}
36863688
return false;
36873689
},
36883690
"vedor-insert-gadget" : function(el) {

www/install/packages/lib.ax

9.96 KB
Binary file not shown.

www/install/upgrade/tasks.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,20 @@
119119
));
120120
*/
121121
case '8.4-b1': // because of previous released upgrade scripts
122+
case '8.4-b2': // because of previous released upgrade scripts
123+
case '8.4':
122124
case '9.0-rc1.1':
123125
array_push($todo, array(
124126
"description" => "Installing cache store",
125127
"operation" => "9.0/install.cache_store.php",
128+
"newversion" => '9.0-rc1.1a'
129+
));
130+
case '9.0-rc1.1a':
131+
array_push($todo, array(
132+
"description" => "Update properties and path length",
133+
"operation" => "9.1/upgrade.database.php",
126134
"newversion" => '9.0-rc1.2'
127135
));
128-
case '8.4-b2': // because of previous released upgrade scripts
129136
case '9.0-rc1.2':
130137
array_push($todo, array(
131138
"description" => "Installing default libs",
@@ -143,14 +150,9 @@
143150
array_push($todo, array(
144151
"description" => "Mogrify dirs in system folder",
145152
"operation" => "9.0/install.configfiles.php",
146-
"newversion" => '9.0-rc1.6'
147-
));
148-
case '9.0-rc1.6':
149-
array_push($todo, array(
150-
"description" => "Update properties and path length",
151-
"operation" => "9.0/upgrade.database.php",
152153
"newversion" => '9.0-rc1'
153154
));
155+
case '9.0-rc1.6':
154156
case '9.0-rc1.7': // because of previous released upgrade scripts
155157
case '9.0-rc1':
156158
array_push($todo, array(
@@ -175,16 +177,17 @@
175177
"newversion" => "9.3-rc1"
176178
));
177179
case '9.3-rc1':
178-
array_push($todo, array(
179-
"description" => "Update libraries for muze and vedor",
180-
"operation" => "all/upgrade.muze.libs.php",
181-
"newversion" => "9.4"
182-
));
183180
case '9.3':
184181
array_push($todo, array(
185182
"description" => "Bumping revision to 9.4",
186183
"operation" => "all/dummy.php",
187184
"newversion" => "9.4"
188185
));
186+
case '9.4':
187+
array_push($todo, array(
188+
"description" => "Update libraries for muze and vedor",
189+
"operation" => "all/upgrade.muze.libs.php",
190+
"newversion" => "9.5"
191+
));
189192

190193
}

0 commit comments

Comments
 (0)