Page MenuHomePhabricator

D21821.diff
No OneTemporary

D21821.diff

diff --git a/src/applications/calendar/parser/ics/PhutilICSWriter.php b/src/applications/calendar/parser/ics/PhutilICSWriter.php
--- a/src/applications/calendar/parser/ics/PhutilICSWriter.php
+++ b/src/applications/calendar/parser/ics/PhutilICSWriter.php
@@ -184,14 +184,14 @@
}
$name = $event->getName();
- if (strlen($name)) {
+ if (phutil_nonempty_string($name)) {
$properties[] = $this->newTextProperty(
'SUMMARY',
$name);
}
$description = $event->getDescription();
- if (strlen($description)) {
+ if (phutil_nonempty_string($description)) {
$properties[] = $this->newTextProperty(
'DESCRIPTION',
$description);
diff --git a/src/applications/files/format/__tests__/PhabricatorFileStorageFormatTestCase.php b/src/applications/files/format/__tests__/PhabricatorFileStorageFormatTestCase.php
--- a/src/applications/files/format/__tests__/PhabricatorFileStorageFormatTestCase.php
+++ b/src/applications/files/format/__tests__/PhabricatorFileStorageFormatTestCase.php
@@ -45,6 +45,10 @@
}
public function testAES256Storage() {
+ if (!function_exists('openssl_encrypt')) {
+ $this->assertSkipped(pht('No OpenSSL extension available.'));
+ }
+
$engine = new PhabricatorTestStorageEngine();
$key_name = 'test.abcd';
diff --git a/src/applications/nuance/github/NuanceGitHubRawEvent.php b/src/applications/nuance/github/NuanceGitHubRawEvent.php
--- a/src/applications/nuance/github/NuanceGitHubRawEvent.php
+++ b/src/applications/nuance/github/NuanceGitHubRawEvent.php
@@ -164,7 +164,7 @@
$raw = $this->raw;
$full = idxv($raw, array('repo', 'name'));
- if (strlen($full)) {
+ if (phutil_nonempty_string($full)) {
return $full;
}
diff --git a/src/infrastructure/markup/blockrule/PhutilRemarkupListBlockRule.php b/src/infrastructure/markup/blockrule/PhutilRemarkupListBlockRule.php
--- a/src/infrastructure/markup/blockrule/PhutilRemarkupListBlockRule.php
+++ b/src/infrastructure/markup/blockrule/PhutilRemarkupListBlockRule.php
@@ -446,7 +446,7 @@
}
$start_attr = null;
- if (ctype_digit($starts_at) && $starts_at > 1) {
+ if (ctype_digit(phutil_string_cast($starts_at)) && $starts_at > 1) {
$start_attr = hsprintf(' start="%d"', $starts_at);
}
diff --git a/src/infrastructure/markup/markuprule/PhutilRemarkupDocumentLinkRule.php b/src/infrastructure/markup/markuprule/PhutilRemarkupDocumentLinkRule.php
--- a/src/infrastructure/markup/markuprule/PhutilRemarkupDocumentLinkRule.php
+++ b/src/infrastructure/markup/markuprule/PhutilRemarkupDocumentLinkRule.php
@@ -46,7 +46,7 @@
$is_anchor = false;
if (strncmp($link, '/', 1) == 0) {
- $base = $engine->getConfig('uri.base');
+ $base = phutil_string_cast($engine->getConfig('uri.base'));
$base = rtrim($base, '/');
$link = $base.$link;
} else if (strncmp($link, '#', 1) == 0) {
@@ -134,7 +134,7 @@
public function markupDocumentLink(array $matches) {
$uri = trim($matches[1]);
- $name = trim(idx($matches, 2));
+ $name = trim(idx($matches, 2, ''));
if (!$this->isFlatText($uri)) {
return $matches[0];

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 13, 9:09 AM (6 d, 7 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7613981
Default Alt Text
D21821.diff (3 KB)

Event Timeline