forked from ILIAS-eLearning/ILIAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AdvMD: be more lenient when filtering text, links (42217)
- Loading branch information
1 parent
ea5a41e
commit d5579b7
Showing
4 changed files
with
21 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of ILIAS, a powerful learning management system | ||
* published by ILIAS open source e-Learning e.V. | ||
|
@@ -18,6 +16,8 @@ | |
* | ||
*********************************************************************/ | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* external link search bridge | ||
* @author Stefan Meyer <[email protected]> | ||
|
@@ -146,9 +146,12 @@ public function getSQLCondition(string $a_element_id, int $mode = self::SQL_LIKE | |
public function isInCondition(ilADT $a_adt): bool | ||
{ | ||
if ($this->getADT()->getCopyOfDefinition()->isComparableTo($a_adt)) { | ||
$search_term = strtolower(trim((string) $this->getADT()->getUrl())); | ||
$title = strtolower(trim((string) $a_adt->getTitle())); | ||
$url = strtolower(trim((string) $a_adt->getUrl())); | ||
return | ||
strcasecmp(trim($this->getADT()->getUrl()), trim((string) $a_adt->getUrl())) === 0 || | ||
strcasecmp(trim($this->getADT()->getUrl()), trim((string) $a_adt->getTitle())) === 0; | ||
str_contains($title, $search_term) || | ||
str_contains($url, $search_term); | ||
} | ||
return false; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of ILIAS, a powerful learning management system | ||
* published by ILIAS open source e-Learning e.V. | ||
|
@@ -18,6 +16,8 @@ | |
* | ||
*********************************************************************/ | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* external link search bridge | ||
* @author Stefan Meyer <[email protected]> | ||
|
@@ -132,8 +132,11 @@ public function isInCondition(ilADT $a_adt): bool | |
{ | ||
if ($this->getADT()->getCopyOfDefinition()->isComparableTo($a_adt)) { | ||
$ref_id = $a_adt->getTargetRefId(); | ||
$title = ilObject::_lookupTitle((int) ilObject::_lookupObjId((int) $ref_id)); | ||
return strcasecmp($title, $this->getTitleQuery()) === 0; | ||
$title = strtolower(trim( | ||
ilObject::_lookupTitle((int) ilObject::_lookupObjId((int) $ref_id)) | ||
)); | ||
$query = strtolower(trim($this->getTitleQuery())); | ||
return str_contains($title, $query); | ||
} | ||
return false; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters