1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-15 10:00:55 +01:00

(stable) Promote 2017 Week 47

This commit is contained in:
epriestley 2017-11-25 05:13:49 -08:00
commit 62d2d98b04
5 changed files with 30 additions and 21 deletions

View file

@ -38,15 +38,19 @@ $parser->setText(file_get_contents('php://stdin'));
$content = array(); $content = array();
foreach (array('text', 'html') as $part) { foreach (array('text', 'html') as $part) {
$part_body = $parser->getMessageBody($part); $part_body = $parser->getMessageBody($part);
$part_headers = $parser->getMessageBodyHeaders($part);
$content_type = idx($part_headers, 'content-type'); if (strlen($part_body) && !phutil_is_utf8($part_body)) {
if ( $part_headers = $parser->getMessageBodyHeaders($part);
!phutil_is_utf8($part_body) && if (!is_array($part_headers)) {
(preg_match('/charset="(.*?)"/', $content_type, $matches) || $part_headers = array();
preg_match('/charset=(\S+)/', $content_type, $matches)) }
) { $content_type = idx($part_headers, 'content-type');
$part_body = phutil_utf8_convert($part_body, 'UTF-8', $matches[1]); if (preg_match('/charset="(.*?)"/', $content_type, $matches) ||
preg_match('/charset=(\S+)/', $content_type, $matches)) {
$part_body = phutil_utf8_convert($part_body, 'UTF-8', $matches[1]);
}
} }
$content[$part] = $part_body; $content[$part] = $part_body;
} }

View file

@ -96,10 +96,11 @@ final class DiffusionPatternSearchView extends DiffusionView {
$path_title = Filesystem::readablePath($this->path, $drequest->getPath()); $path_title = Filesystem::readablePath($this->path, $drequest->getPath());
$href = $drequest->generateURI(array( $href = $drequest->generateURI(
'action' => 'browse', array(
'path' => $path_title, 'action' => 'browse',
)); 'path' => $this->path,
));
$title = phutil_tag('a', array('href' => $href), $path_title); $title = phutil_tag('a', array('href' => $href), $path_title);

View file

@ -21,6 +21,16 @@ final class ManiphestGetTaskTransactionsConduitAPIMethod
return 'nonempty list<dict<string, wild>>'; return 'nonempty list<dict<string, wild>>';
} }
public function getMethodStatus() {
return self::METHOD_STATUS_FROZEN;
}
public function getMethodStatusDescription() {
return pht(
'This method is frozen and will eventually be deprecated. New code '.
'should use "transaction.search" instead.');
}
protected function execute(ConduitAPIRequest $request) { protected function execute(ConduitAPIRequest $request) {
$results = array(); $results = array();
$task_ids = $request->getValue('ids'); $task_ids = $request->getValue('ids');

View file

@ -6,20 +6,17 @@ final class ManiphestTaskPriorityTransaction
const TRANSACTIONTYPE = 'priority'; const TRANSACTIONTYPE = 'priority';
public function generateOldValue($object) { public function generateOldValue($object) {
if ($this->isNewObject()) { return (string)$object->getPriority();
return null;
}
return $object->getPriority();
} }
public function generateNewValue($object, $value) { public function generateNewValue($object, $value) {
// `$value` is supposed to be a keyword, but if the priority // `$value` is supposed to be a keyword, but if the priority
// assigned to a task has been removed from the config, // assigned to a task has been removed from the config,
// no such keyword will be available. Other edits to the task // no such keyword will be available. Other edits to the task
// should still be allowed, even if the priority is no longer // should still be allowed, even if the priority is no longer
// valid, so treat this as a no-op. // valid, so treat this as a no-op.
if ($value === ManiphestTaskPriority::UNKNOWN_PRIORITY_KEYWORD) { if ($value === ManiphestTaskPriority::UNKNOWN_PRIORITY_KEYWORD) {
return $object->getPriority(); return (string)$object->getPriority();
} }
return (string)ManiphestTaskPriority::getTaskPriorityFromKeyword($value); return (string)ManiphestTaskPriority::getTaskPriorityFromKeyword($value);

View file

@ -6,9 +6,6 @@ final class ManiphestTaskStatusTransaction
const TRANSACTIONTYPE = 'status'; const TRANSACTIONTYPE = 'status';
public function generateOldValue($object) { public function generateOldValue($object) {
if ($this->isNewObject()) {
return null;
}
return $object->getStatus(); return $object->getStatus();
} }