Skip to content

Commit

Permalink
Fix PHP notice
Browse files Browse the repository at this point in the history
  • Loading branch information
artpi committed Sep 15, 2020
1 parent 74f7c59 commit 797082c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<string>Searching searching searching</string>
<key>script</key>
<string>&lt;?php
error_reporting( E_WARNING );
require_once './workflow.php';
(new Roam())-&gt;search( isset( $argv[1] ) ? $argv[1] : '' );
Expand Down
15 changes: 12 additions & 3 deletions workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,13 @@ function explore( $data, $title, $parent ) {
}
if ( isset( $parent->title ) && strtolower( $this->search ) === strtolower( "[[$parent->title]]" ) ) {
$this->output( $data, $title, "\t" );
} else
if ( strtolower( $title ) === strtolower( $match[1] ) && isset( $data->string ) && stristr( $data->string , trim( str_replace( "[[{$match[1]}]]", '', $this->search ) ) ) ) {
}
else if (
isset( $data->string ) &&
strtolower( $title ) === strtolower( $match[1] ) &&
strlen( trim( str_replace( "[[{$match[1]}]]", '', $this->search ) ) ) > 1 &&
stristr( $data->string , trim( str_replace( "[[{$match[1]}]]", '', $this->search ) ) )
) {
$this->output( $data, $title );
}
} else if( isset( $data->uid ) && strtolower( trim( $this->search ) ) === '((' . strtolower( $data->uid ) . '))' ) {
Expand All @@ -119,7 +124,11 @@ function explore( $data, $title, $parent ) {
} else if ( isset( $parent->uid ) && strtolower( trim( $this->search ) ) === '((' . strtolower( $parent->uid ) . '))' ) {
$this->output( $data, $title, "\t" );
} else if ( substr( $this->search, 0, 2 ) === '[[' || $this->modifier === 'pages' ) {
if( isset( $data->title ) && stristr( $data->title, trim(str_replace( '[[', '', $this->search ) ) ) ) {
if(
isset( $data->title ) &&
strlen( trim(str_replace( '[[', '', $this->search ) ) ) > 1 &&
stristr( $data->title, trim(str_replace( '[[', '', $this->search ) ) )
) {
$this->output( $data, $title );
}
return;
Expand Down

0 comments on commit 797082c

Please sign in to comment.