aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-11-17 15:27:18 -0800
committerfriendica <info@friendica.com>2014-11-17 15:27:18 -0800
commit064b48fa712acf00162a65638b134883c8b1afa0 (patch)
treea09ed244d3c6f7a1a37400b0d4d5c845add17e04 /mod
parent13a7637d9d17a2ea8adcdb635842ca12dfc0a632 (diff)
parente59f7cc198fb038cd8344c2d403b423d57300a96 (diff)
downloadvolse-hubzilla-064b48fa712acf00162a65638b134883c8b1afa0.tar.gz
volse-hubzilla-064b48fa712acf00162a65638b134883c8b1afa0.tar.bz2
volse-hubzilla-064b48fa712acf00162a65638b134883c8b1afa0.zip
Merge https://github.com/friendica/red into pending_merge
Diffstat (limited to 'mod')
-rw-r--r--mod/dirsearch.php53
-rwxr-xr-xmod/events.php9
2 files changed, 32 insertions, 30 deletions
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index dea34c566..52d953707 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -282,35 +282,38 @@ function dir_parse_query($s) {
if($all) {
foreach($all as $q) {
- if($q === 'and') {
- $curr['logic'] = 'and';
- continue;
- }
- if($q === 'or') {
- $curr['logic'] = 'or';
- continue;
- }
- if($q === 'not') {
- $curr['logic'] .= ' not';
- continue;
- }
- if(strpos($q,'=')) {
- if(! isset($curr['logic']))
+ if($quoted_string === false) {
+ if($q === 'and') {
+ $curr['logic'] = 'and';
+ continue;
+ }
+ if($q === 'or') {
$curr['logic'] = 'or';
- $curr['field'] = trim(substr($q,0,strpos($q,'=')));
- $curr['value'] = trim(substr($q,strpos($q,'=')+1));
- if(strpos($curr['value'],'"') !== false) {
- $quoted_string = true;
- $curr['value'] = substr($curr['value'],strpos($curr['value'],'"')+1);
+ continue;
}
- else {
- $ret[] = $curr;
- $curr = array();
- $continue;
+ if($q === 'not') {
+ $curr['logic'] .= ' not';
+ continue;
+ }
+ if(strpos($q,'=')) {
+ if(! isset($curr['logic']))
+ $curr['logic'] = 'or';
+ $curr['field'] = trim(substr($q,0,strpos($q,'=')));
+ $curr['value'] = trim(substr($q,strpos($q,'=')+1));
+ if($curr['value'][0] == '"' && $curr['value'][strlen($curr['value'])-1] != '"') {
+ $quoted_string = true;
+ $curr['value'] = substr($curr['value'],1);
+ continue;
+ }
+ else {
+ $ret[] = $curr;
+ $curr = array();
+ continue;
+ }
}
}
- elseif($quoted_string) {
- if(strpos($q,'"') !== false) {
+ else {
+ if($q[strlen($q)-1] == '"') {
$curr['value'] .= ' ' . str_replace('"','',trim($q));
$ret[] = $curr;
$curr = array();
diff --git a/mod/events.php b/mod/events.php
index 009afbcb8..5af7d381e 100755
--- a/mod/events.php
+++ b/mod/events.php
@@ -268,8 +268,8 @@ function events_content(&$a) {
if($mode == 'view') {
- $thisyear = datetime_convert('UTC',date_default_timezone_get(),'now','Y');
- $thismonth = datetime_convert('UTC',date_default_timezone_get(),'now','m');
+ $thisyear = datetime_convert('UTC',date_default_timezone_get(),'now','Y');
+ $thismonth = datetime_convert('UTC',date_default_timezone_get(),'now','m');
if(! $y)
$y = intval($thisyear);
if(! $m)
@@ -549,7 +549,6 @@ function events_content(&$a) {
$tpl = get_markup_template('event_form.tpl');
-
$o .= replace_macros($tpl,array(
'$post' => $a->get_baseurl() . '/events',
'$eid' => $eid,
@@ -567,11 +566,11 @@ function events_content(&$a) {
'$ftext' => $ftext,
'$ModalCANCEL' => t('Cancel'),
'$ModalOK' => t('OK'),
- '$s_dsel' => datetimesel($f,mktime(),mktime(0,0,0,0,0,$syear+5),mktime($shour,$sminute,$ssecond,$smonth,$sday,$syear),'start_text'),
+ '$s_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$syear+5),DateTime::createFromFormat('Y-m-d H:i',"$syear-$smonth-$sday $shour:$sminute"),'start_text'),
'$n_text' => t('Finish date/time is not known or not relevant'),
'$n_checked' => $n_checked,
'$f_text' => t('Event Finishes:'),
- '$f_dsel' => datetimesel($f,mktime(),mktime(0,0,0,0,0,$fyear+5),mktime($fhour,$fminute,$fsecond,$fmonth,$fday,$fyear),'finish_text',true,true,'start_text'),
+ '$f_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$fyear+5),DateTime::createFromFormat('Y-m-d H:i',"$fyear-$fmonth-$fday $fhour:$fminute"),'finish_text',true,true,'start_text'),
'$a_text' => t('Adjust for viewer timezone'),
'$a_checked' => $a_checked,
'$d_text' => t('Description:'),