aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/advisory
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/advisory')
-rw-r--r--crates/shirabe/src/advisory/auditor.rs6
-rw-r--r--crates/shirabe/src/advisory/partial_security_advisory.rs5
2 files changed, 5 insertions, 6 deletions
diff --git a/crates/shirabe/src/advisory/auditor.rs b/crates/shirabe/src/advisory/auditor.rs
index c85871fc..563da5b3 100644
--- a/crates/shirabe/src/advisory/auditor.rs
+++ b/crates/shirabe/src/advisory/auditor.rs
@@ -12,10 +12,9 @@ use crate::package::base_package;
use crate::repository::RepositorySet;
use crate::util::PackageInfo;
use indexmap::IndexMap;
-use shirabe_pcre::Preg;
use shirabe_php_shim::{
DATE_ATOM, InvalidArgumentException, PhpMixed, array_all, array_any, array_key_exists,
- array_keys, array_reduce, get_class,
+ array_keys, array_reduce, get_class, preg_match2,
};
use shirabe_symfony_console::formatter::OutputFormatter;
use shirabe_symfony_console::helper::Cell;
@@ -290,7 +289,8 @@ impl Auditor {
continue;
};
if pkg.is_abandoned()
- && (filter.is_none() || !Preg::is_match(filter.as_ref().unwrap(), &pkg.get_name()))
+ && (filter.is_none()
+ || preg_match2(filter.as_ref().unwrap(), &pkg.get_name(), 0).is_none())
{
result.push(pkg);
}
diff --git a/crates/shirabe/src/advisory/partial_security_advisory.rs b/crates/shirabe/src/advisory/partial_security_advisory.rs
index 677425ba..086d921d 100644
--- a/crates/shirabe/src/advisory/partial_security_advisory.rs
+++ b/crates/shirabe/src/advisory/partial_security_advisory.rs
@@ -5,8 +5,7 @@ use crate::advisory::SecurityAdvisory;
use crate::package::version::VersionParser;
use chrono::{DateTime, Utc};
use indexmap::IndexMap;
-use shirabe_pcre::Preg;
-use shirabe_php_shim::{PhpMixed, php_regex};
+use shirabe_php_shim::{PhpMixed, php_regex, preg_replace};
use shirabe_semver::constraint::AnyConstraint;
use shirabe_semver::constraint::SimpleConstraint;
@@ -37,7 +36,7 @@ impl PartialSecurityAdvisory {
let constraint: AnyConstraint = match parser.parse_constraints(affected_versions_str) {
Ok(c) => c,
Err(_) => {
- let affected_version = Preg::replace(
+ let affected_version = preg_replace(
php_regex!(r"{(^[>=<^~]*[\d.]+).*}"),
"$1",
affected_versions_str,