Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
MetaGer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
56
Issues
56
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
open-source
MetaGer
Commits
279acbb0
Commit
279acbb0
authored
Oct 18, 2019
by
Dominik Hebeler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed a bug in the new phrase search
parent
64f791ad
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
app/MetaGer.php
app/MetaGer.php
+19
-19
No files found.
app/MetaGer.php
View file @
279acbb0
...
...
@@ -285,8 +285,8 @@ class MetaGer
$newResults
=
[];
foreach
(
$this
->
ads
as
$ad
)
{
if
((
$ad
->
strippedHost
!==
""
&&
(
in_array
(
$ad
->
strippedHost
,
$this
->
adDomainsBlacklisted
)
||
in_array
(
$ad
->
strippedLink
,
$this
->
adUrlsBlacklisted
)))
||
(
$ad
->
strippedHostAnzeige
!==
""
&&
(
in_array
(
$ad
->
strippedHostAnzeige
,
$this
->
adDomainsBlacklisted
)
||
in_array
(
$ad
->
strippedLinkAnzeige
,
$this
->
adUrlsBlacklisted
)))
in_array
(
$ad
->
strippedLink
,
$this
->
adUrlsBlacklisted
)))
||
(
$ad
->
strippedHostAnzeige
!==
""
&&
(
in_array
(
$ad
->
strippedHostAnzeige
,
$this
->
adDomainsBlacklisted
)
||
in_array
(
$ad
->
strippedLinkAnzeige
,
$this
->
adUrlsBlacklisted
)))
)
{
continue
;
}
...
...
@@ -566,7 +566,7 @@ class MetaGer
$filter
=
rtrim
(
$filter
,
","
);
$error
=
trans
(
'metaGer.engines.noSpecialSearch'
,
[
'fokus'
=>
trans
(
$this
->
sumaFile
->
foki
->
{
$this
->
fokus
}
->
{
"display-name"
}),
'filter'
=>
$filter
'filter'
=>
$filter
,
]);
$this
->
errors
[]
=
$error
;
}
...
...
@@ -743,31 +743,31 @@ class MetaGer
public
function
sumaIsDisabled
(
$suma
)
{
return
isset
(
$suma
[
'disabled'
])
&&
$suma
[
'disabled'
]
->
__toString
()
===
"1"
;
isset
(
$suma
[
'disabled'
])
&&
$suma
[
'disabled'
]
->
__toString
()
===
"1"
;
}
public
function
sumaIsOverture
(
$suma
)
{
return
$suma
[
"name"
]
->
__toString
()
===
"overture"
||
$suma
[
"name"
]
->
__toString
()
===
"overtureAds"
;
$suma
[
"name"
]
->
__toString
()
===
"overture"
||
$suma
[
"name"
]
->
__toString
()
===
"overtureAds"
;
}
public
function
sumaIsNotAdsuche
(
$suma
)
{
return
$suma
[
"name"
]
->
__toString
()
!==
"qualigo"
&&
$suma
[
"name"
]
->
__toString
()
!==
"similar_product_ads"
&&
$suma
[
"name"
]
->
__toString
()
!==
"overtureAds"
;
$suma
[
"name"
]
->
__toString
()
!==
"qualigo"
&&
$suma
[
"name"
]
->
__toString
()
!==
"similar_product_ads"
&&
$suma
[
"name"
]
->
__toString
()
!==
"overtureAds"
;
}
public
function
requestIsCached
(
$request
)
{
return
$request
->
filled
(
'next'
)
&&
Cache
::
has
(
$request
->
input
(
'next'
))
&&
unserialize
(
Cache
::
get
(
$request
->
input
(
'next'
)))[
'page'
]
>
1
;
$request
->
filled
(
'next'
)
&&
Cache
::
has
(
$request
->
input
(
'next'
))
&&
unserialize
(
Cache
::
get
(
$request
->
input
(
'next'
)))[
'page'
]
>
1
;
}
public
function
getCachedEngines
(
$request
)
...
...
@@ -863,8 +863,8 @@ class MetaGer
}
/*
* Ende Suchmaschinenerstellung und Ergebniserhalt
*/
* Ende Suchmaschinenerstellung und Ergebniserhalt
*/
public
function
parseFormData
(
Request
$request
)
{
...
...
@@ -1093,7 +1093,7 @@ class MetaGer
if
((
$request
->
filled
(
$filter
->
{
"get-parameter"
})
&&
$request
->
input
(
$filter
->
{
"get-parameter"
})
!==
"off"
)
||
\
Cookie
::
get
(
$this
->
getFokus
()
.
"_setting_"
.
$filter
->
{
"get-parameter"
})
!==
null
)
{
# If the filter is set via Cookie
$this
->
parameterFilter
[
$filterName
]
=
$filter
;
$this
->
parameterFilter
[
$filterName
]
=
$filter
;
$this
->
parameterFilter
[
$filterName
]
->
value
=
$request
->
input
(
$filter
->
{
"get-parameter"
},
''
);
if
(
empty
(
$this
->
parameterFilter
[
$filterName
]
->
value
))
{
$this
->
parameterFilter
[
$filterName
]
->
value
=
\
Cookie
::
get
(
$this
->
getFokus
()
.
"_setting_"
.
$filter
->
{
"get-parameter"
});
...
...
@@ -1227,14 +1227,14 @@ class MetaGer
// matches '[... ]-test[ ...]'
$words
=
preg_split
(
"/\s+/si"
,
$tmp
);
$newQ
=
""
;
$newQ
=
$this
->
q
;
foreach
(
$words
as
$word
)
{
if
(
strpos
(
$word
,
"-"
)
===
0
&&
strlen
(
$word
)
>
1
)
{
$this
->
stopWords
[]
=
substr
(
$word
,
1
);
}
else
{
$newQ
.
=
" "
.
$word
;
$newQ
=
str_ireplace
(
$word
,
""
,
$newQ
);
}
}
$newQ
=
preg_replace
(
"/(\s)\s+/"
,
"$1"
,
$newQ
);
$this
->
q
=
trim
(
$newQ
);
# Overwrite Setting if submitted via Parameter
if
(
$request
->
has
(
'stop'
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment