Skip to content

Commit

Permalink
Don't use deprected "1" value to cURL CURLOPT_SSL_VERIFYHOST
Browse files Browse the repository at this point in the history
Summary: Fixes T2962. That task discusses this issue.

Test Plan: Read php-curl documentation to verify this change makes sense. Sent an email with SES.

Reviewers: btrahan, garoevans

Reviewed By: garoevans

CC: aran

Maniphest Tasks: T2962

Differential Revision: https://secure.phabricator.com/D5669
  • Loading branch information
epriestley committed Apr 12, 2013
1 parent 649f5cc commit 1e6deff
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 1 deletion.
2 changes: 1 addition & 1 deletion externals/amazon-ses/ses.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ public function getResponse() {
$curl = curl_init();
curl_setopt($curl, CURLOPT_USERAGENT, 'SimpleEmailService/php');

curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, ($this->ses->verifyHost() ? 1 : 0));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, ($this->ses->verifyHost() ? 2 : 0));
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, ($this->ses->verifyPeer() ? 1 : 0));

// Request types
Expand Down
2 changes: 2 additions & 0 deletions src/__phutil_library_map__.php
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,7 @@
'PholioTransactionType' => 'applications/pholio/constants/PholioTransactionType.php',
'PholioTransactionView' => 'applications/pholio/view/PholioTransactionView.php',
'PhortuneAccount' => 'applications/phortune/storage/PhortuneAccount.php',
'PhortuneAccountBuyController' => 'applications/phortune/controller/PhortuneAccountBuyController.php',
'PhortuneAccountEditor' => 'applications/phortune/editor/PhortuneAccountEditor.php',
'PhortuneAccountQuery' => 'applications/phortune/query/PhortuneAccountQuery.php',
'PhortuneAccountTransaction' => 'applications/phortune/storage/PhortuneAccountTransaction.php',
Expand Down Expand Up @@ -3252,6 +3253,7 @@
0 => 'PhortuneDAO',
1 => 'PhabricatorPolicyInterface',
),
'PhortuneAccountBuyController' => 'PhortuneController',
'PhortuneAccountEditor' => 'PhabricatorApplicationTransactionEditor',
'PhortuneAccountQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhortuneAccountTransaction' => 'PhabricatorApplicationTransaction',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function getRoutes() {
'paymentmethod/' => array(
'edit/' => 'PhortunePaymentMethodEditController',
),
'buy/(?P<id>\d+)/' => 'PhortuneAccountBuyController',
),
'account/' => array(
'' => 'PhortuneAccountListController',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php

final class PhortuneAccountBuyController
extends PhortuneController {

private $accountID;
private $id;

public function willProcessRequest(array $data) {
$this->accountID = $data['accountID'];
$this->id = $data['id'];
}

public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();

$account = id(new PhortuneAccountQuery())
->setViewer($user)
->withIDs(array($this->accountID))
->executeOne();
if (!$account) {
return new Aphront404Response();
}

$account_uri = $this->getApplicationURI($account->getID().'/');

$product = id(new PhortuneProductQuery())
->setViewer($user)
->withIDs(array($this->id))
->executeOne();
if (!$product) {
return new Aphront404Response();
}

$title = pht('Buy %s', $product->getProductName());

$payment_method_uri = $this->getApplicationURI(
$account->getID().'/paymentmethod/edit/');

$new_method = phutil_tag(
'a',
array(
'href' => $payment_method_uri,
'sigil' => 'workflow',
),
pht('Add New Payment Method'));


$form = id(new AphrontFormView())
->setUser($user)
->appendChild(
id(new AphrontFormStaticControl())
->setLabel(pht('Stuff'))
->setValue($product->getProductName()))
->appendChild(
id(new AphrontFormRadioButtonControl())
->setLabel(pht('Payment Method')))
->appendChild(
id(new AphrontFormMarkupControl())
->setValue($new_method))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue(pht("Dolla Dolla Bill Y'all")));

return $this->buildApplicationPage(
$form,
array(
'title' => $title,
'device' => true,
'dust' => true,
));

}
}
5 changes: 5 additions & 0 deletions src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ final class PhabricatorEdgeConfig extends PhabricatorEdgeConstants {
const TYPE_ACCOUNT_HAS_MEMBER = 27;
const TYPE_MEMBER_HAS_ACCOUNT = 28;

const TYPE_PURCAHSE_HAS_CHARGE = 29;
const TYPE_CHARGE_HAS_PURCHASE = 30;

const TYPE_TEST_NO_CYCLE = 9000;


Expand Down Expand Up @@ -125,6 +128,8 @@ public static function establishConnection($phid_type, $conn_type) {
PhabricatorPHIDConstants::PHID_TYPE_CONP => 'ConpherenceThread',
PhabricatorPHIDConstants::PHID_TYPE_WIKI => 'PhrictionDocument',
PhabricatorPHIDConstants::PHID_TYPE_ACNT => 'PhortuneAccount',
PhabricatorPHIDConstants::PHID_TYPE_PRCH => 'PhortunePurchase',
PhabricatorPHIDConstants::PHID_TYPE_CHRG => 'PhortuneCharge',
);

$class = idx($class_map, $phid_type);
Expand Down

0 comments on commit 1e6deff

Please sign in to comment.