Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* }
*/
function browsehappy_get_explicit_browser_tokens() {
return array(
return array(
'Camino' => array(),
'Chromium' => array(),
'Edge' => array(
Expand Down
6 changes: 3 additions & 3 deletions api.wordpress.org/public_html/core/credits/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
require_once dirname( __FILE__ ) . '/wp-credits.php';

if ( ! function_exists( 'like_escape' ) ) :
function like_escape( $text ) {
return str_replace( array( "%", "_") , array( "\\%", "\\_" ), $text );
}
function like_escape( $text ) {
return str_replace( array( "%", "_") , array( "\\%", "\\_" ), $text );
}
endif;

if ( ! empty( $_GET['version'] ) ) {
Expand Down
4 changes: 2 additions & 2 deletions api.wordpress.org/public_html/core/credits/wp-32.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function external_libraries() {
return array(
array( 'Class POP3', 'https://squirrelmail.org/' ),
array( 'Color Animations', 'http://plugins.jquery.com/project/color' ),
// array( 'ColorPicker', 'http://' ),
// array( 'ColorPicker', 'http://' ),
array( 'Horde Text Diff', 'http://pear.horde.org/' ),
array( 'hoverIntent', 'http://plugins.jquery.com/project/hoverIntent' ),
array( 'imgAreaSelect', 'https://github.com/odyniec/imgareaselect' ),
Expand All @@ -183,7 +183,7 @@ function external_libraries() {
array( 'jQuery Hotkeys', 'https://github.com/mathusiast/jquery.hotkeys' ),
array( 'jQuery serializeObject', 'https://benalman.com/projects/jquery-misc-plugins/' ),
array( 'jQuery.query', 'http://plugins.jquery.com/project/query-object' ),
// array( 'jquery.schedule', 'http://' ),
// array( 'jquery.schedule', 'http://' ),
array( 'jQuery.suggest', 'http://plugins.jquery.com/project/suggest' ),
array( 'json2', 'https://github.com/douglascrockford/JSON-js' ),
array( 'PclZip', 'https://www.phpconcept.net/pclzip/' ),
Expand Down
4 changes: 2 additions & 2 deletions api.wordpress.org/public_html/core/credits/wp-33.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ function external_libraries() {
return array(
array( 'Class POP3', 'https://squirrelmail.org/' ),
array( 'Color Animations', 'http://plugins.jquery.com/project/color' ),
// array( 'ColorPicker', 'http://' ),
// array( 'ColorPicker', 'http://' ),
array( 'Horde Text Diff', 'http://pear.horde.org/' ),
array( 'hoverIntent', 'http://plugins.jquery.com/project/hoverIntent' ),
array( 'imgAreaSelect', 'https://github.com/odyniec/imgareaselect' ),
Expand All @@ -242,7 +242,7 @@ function external_libraries() {
array( 'jQuery Hotkeys', 'https://github.com/mathusiast/jquery.hotkeys' ),
array( 'jQuery serializeObject', 'https://benalman.com/projects/jquery-misc-plugins/' ),
array( 'jQuery.query', 'http://plugins.jquery.com/project/query-object' ),
// array( 'jquery.schedule', 'http://' ),
// array( 'jquery.schedule', 'http://' ),
array( 'jQuery.suggest', 'http://plugins.jquery.com/project/suggest' ),
array( 'json2', 'https://github.com/douglascrockford/JSON-js' ),
array( 'PclZip', 'https://www.phpconcept.net/pclzip/' ),
Expand Down
4 changes: 2 additions & 2 deletions api.wordpress.org/public_html/core/credits/wp-34.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function external_libraries() {
return array(
array( 'Class POP3', 'https://squirrelmail.org/' ),
array( 'Color Animations', 'http://plugins.jquery.com/project/color' ),
// array( 'ColorPicker', 'http://' ),
// array( 'ColorPicker', 'http://' ),
array( 'Horde Text Diff', 'http://pear.horde.org/' ),
array( 'hoverIntent', 'http://plugins.jquery.com/project/hoverIntent' ),
array( 'imgAreaSelect', 'https://github.com/odyniec/imgareaselect' ),
Expand All @@ -251,7 +251,7 @@ function external_libraries() {
array( 'jQuery Hotkeys', 'https://github.com/mathusiast/jquery.hotkeys' ),
array( 'jQuery serializeObject', 'https://benalman.com/projects/jquery-misc-plugins/' ),
array( 'jQuery.query', 'http://plugins.jquery.com/project/query-object' ),
// array( 'jquery.schedule', 'http://' ),
// array( 'jquery.schedule', 'http://' ),
array( 'jQuery.suggest', 'http://plugins.jquery.com/project/suggest' ),
array( 'jQuery UI Touch Punch', 'https://github.com/furf/jquery-ui-touch-punch' ),
array( 'json2', 'https://github.com/douglascrockford/JSON-js' ),
Expand Down
4 changes: 2 additions & 2 deletions api.wordpress.org/public_html/core/credits/wp-35.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function external_libraries() {
array( 'Backbone', 'http://backbonejs.org/' ),
array( 'Class POP3', 'https://squirrelmail.org/' ),
array( 'Color Animations', 'http://plugins.jquery.com/project/color' ),
// array( 'ColorPicker', 'http://' ),
// array( 'ColorPicker', 'http://' ),
array( 'Horde Text Diff', 'http://pear.horde.org/' ),
array( 'hoverIntent', 'http://plugins.jquery.com/project/hoverIntent' ),
array( 'imgAreaSelect', 'https://github.com/odyniec/imgareaselect' ),
Expand All @@ -346,7 +346,7 @@ function external_libraries() {
array( 'jQuery Masonry', 'https://masonry.desandro.com/' ),
array( 'jQuery serializeObject', 'https://benalman.com/projects/jquery-misc-plugins/' ),
array( 'jQuery.query', 'http://plugins.jquery.com/project/query-object' ),
// array( 'jquery.schedule', 'http://' ),
// array( 'jquery.schedule', 'http://' ),
array( 'jQuery.suggest', 'http://plugins.jquery.com/project/suggest' ),
array( 'jQuery UI Touch Punch', 'https://github.com/furf/jquery-ui-touch-punch' ),
array( 'json2', 'https://github.com/douglascrockford/JSON-js' ),
Expand Down
4 changes: 2 additions & 2 deletions api.wordpress.org/public_html/core/credits/wp-36.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function external_libraries() {
array( 'Backbone.js', 'http://backbonejs.org/' ),
array( 'Class POP3', 'https://squirrelmail.org/' ),
array( 'Color Animations', 'http://plugins.jquery.com/project/color' ),
// array( 'ColorPicker', 'http://' ),
// array( 'ColorPicker', 'http://' ),
array( 'Horde Text Diff', 'http://pear.horde.org/' ),
array( 'hoverIntent', 'http://plugins.jquery.com/project/hoverIntent' ),
array( 'imgAreaSelect', 'https://github.com/odyniec/imgareaselect' ),
Expand All @@ -315,7 +315,7 @@ function external_libraries() {
array( 'jQuery Masonry', 'https://masonry.desandro.com/' ),
array( 'jQuery serializeObject', 'https://benalman.com/projects/jquery-misc-plugins/' ),
array( 'jQuery.query', 'http://plugins.jquery.com/project/query-object' ),
// array( 'jquery.schedule', 'http://' ),
// array( 'jquery.schedule', 'http://' ),
array( 'jQuery.suggest', 'http://plugins.jquery.com/project/suggest' ),
array( 'jQuery UI Touch Punch', 'https://github.com/furf/jquery-ui-touch-punch' ),
array( 'json2', 'https://github.com/douglascrockford/JSON-js' ),
Expand Down
4 changes: 2 additions & 2 deletions api.wordpress.org/public_html/core/credits/wp-37.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ function external_libraries() {
array( 'Backbone.js', 'http://backbonejs.org/' ),
array( 'Class POP3', 'https://squirrelmail.org/' ),
array( 'Color Animations', 'http://plugins.jquery.com/project/color' ),
// array( 'ColorPicker', 'http://' ),
// array( 'ColorPicker', 'http://' ),
array( 'Horde Text Diff', 'http://pear.horde.org/' ),
array( 'hoverIntent', 'http://plugins.jquery.com/project/hoverIntent' ),
array( 'imgAreaSelect', 'https://github.com/odyniec/imgareaselect' ),
Expand All @@ -291,7 +291,7 @@ function external_libraries() {
array( 'jQuery Masonry', 'https://masonry.desandro.com/' ),
array( 'jQuery serializeObject', 'https://benalman.com/projects/jquery-misc-plugins/' ),
array( 'jQuery.query', 'http://plugins.jquery.com/project/query-object' ),
// array( 'jquery.schedule', 'http://' ),
// array( 'jquery.schedule', 'http://' ),
array( 'jQuery.suggest', 'http://plugins.jquery.com/project/suggest' ),
array( 'jQuery UI Touch Punch', 'https://github.com/furf/jquery-ui-touch-punch' ),
array( 'json2', 'https://github.com/douglascrockford/JSON-js' ),
Expand Down
4 changes: 2 additions & 2 deletions api.wordpress.org/public_html/core/credits/wp-38.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ function external_libraries() {
array( 'Backbone.js', 'http://backbonejs.org/' ),
array( 'Class POP3', 'https://squirrelmail.org/' ),
array( 'Color Animations', 'http://plugins.jquery.com/project/color' ),
// array( 'ColorPicker', 'http://' ),
// array( 'ColorPicker', 'http://' ),
array( 'Horde Text Diff', 'http://pear.horde.org/' ),
array( 'hoverIntent', 'http://plugins.jquery.com/project/hoverIntent' ),
array( 'imgAreaSelect', 'https://github.com/odyniec/imgareaselect' ),
Expand All @@ -302,7 +302,7 @@ function external_libraries() {
array( 'jQuery Masonry', 'https://masonry.desandro.com/' ),
array( 'jQuery serializeObject', 'https://benalman.com/projects/jquery-misc-plugins/' ),
array( 'jQuery.query', 'http://plugins.jquery.com/project/query-object' ),
// array( 'jquery.schedule', 'http://' ),
// array( 'jquery.schedule', 'http://' ),
array( 'jQuery.suggest', 'http://plugins.jquery.com/project/suggest' ),
array( 'jQuery UI Touch Punch', 'https://github.com/furf/jquery-ui-touch-punch' ),
array( 'json2', 'https://github.com/douglascrockford/JSON-js' ),
Expand Down
4 changes: 2 additions & 2 deletions api.wordpress.org/public_html/core/credits/wp-39.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ function external_libraries() {
array( 'Backbone.js', 'http://backbonejs.org/' ),
array( 'Class POP3', 'https://squirrelmail.org/' ),
array( 'Color Animations', 'http://plugins.jquery.com/project/color' ),
// array( 'ColorPicker', 'http://' ),
// array( 'ColorPicker', 'http://' ),
array( 'Horde Text Diff', 'http://pear.horde.org/' ),
array( 'hoverIntent', 'http://plugins.jquery.com/project/hoverIntent' ),
array( 'imgAreaSelect', 'https://github.com/odyniec/imgareaselect' ),
Expand All @@ -359,7 +359,7 @@ function external_libraries() {
array( 'jQuery Hotkeys', 'https://github.com/mathusiast/jquery.hotkeys' ),
array( 'jQuery serializeObject', 'https://benalman.com/projects/jquery-misc-plugins/' ),
array( 'jQuery.query', 'http://plugins.jquery.com/project/query-object' ),
// array( 'jquery.schedule', 'http://' ),
// array( 'jquery.schedule', 'http://' ),
array( 'jQuery.suggest', 'http://plugins.jquery.com/project/suggest' ),
array( 'jQuery UI Touch Punch', 'https://github.com/furf/jquery-ui-touch-punch' ),
array( 'json2', 'https://github.com/douglascrockford/JSON-js' ),
Expand Down
4 changes: 2 additions & 2 deletions api.wordpress.org/public_html/core/credits/wp-40.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ function external_libraries() {
array( 'Backbone.js', 'http://backbonejs.org/' ),
array( 'Class POP3', 'https://squirrelmail.org/' ),
array( 'Color Animations', 'http://plugins.jquery.com/project/color' ),
// array( 'ColorPicker', 'http://' ),
// array( 'ColorPicker', 'http://' ),
array( 'Horde Text Diff', 'http://pear.horde.org/' ),
array( 'hoverIntent', 'http://plugins.jquery.com/project/hoverIntent' ),
array( 'imgAreaSelect', 'https://github.com/odyniec/imgareaselect' ),
Expand All @@ -358,7 +358,7 @@ function external_libraries() {
array( 'jQuery Hotkeys', 'https://github.com/mathusiast/jquery.hotkeys' ),
array( 'jQuery serializeObject', 'https://benalman.com/projects/jquery-misc-plugins/' ),
array( 'jQuery.query', 'http://plugins.jquery.com/project/query-object' ),
// array( 'jquery.schedule', 'http://' ),
// array( 'jquery.schedule', 'http://' ),
array( 'jQuery.suggest', 'http://plugins.jquery.com/project/suggest' ),
array( 'jQuery UI Touch Punch', 'https://github.com/furf/jquery-ui-touch-punch' ),
array( 'json2', 'https://github.com/douglascrockford/JSON-js' ),
Expand Down
4 changes: 2 additions & 2 deletions api.wordpress.org/public_html/core/credits/wp-41.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ function external_libraries() {
array( 'Backbone.js', 'http://backbonejs.org/' ),
array( 'Class POP3', 'https://squirrelmail.org/' ),
array( 'Color Animations', 'http://plugins.jquery.com/color/' ),
// array( 'ColorPicker', 'http://' ),
// array( 'ColorPicker', 'http://' ),
array( 'Horde Text Diff', 'http://pear.horde.org/' ),
array( 'hoverIntent', 'http://plugins.jquery.com/project/hoverIntent' ),
array( 'imgAreaSelect', 'https://github.com/odyniec/imgareaselect' ),
Expand All @@ -384,7 +384,7 @@ function external_libraries() {
array( 'jQuery Hotkeys', 'https://github.com/mathusiast/jquery.hotkeys' ),
array( 'jQuery serializeObject', 'https://benalman.com/projects/jquery-misc-plugins/' ),
array( 'jQuery.query', 'http://plugins.jquery.com/query-object/' ),
// array( 'jquery.schedule', 'http://' ),
// array( 'jquery.schedule', 'http://' ),
array( 'jQuery.suggest', 'http://plugins.jquery.com/project/suggest' ),
array( 'jQuery UI Touch Punch', 'https://github.com/furf/jquery-ui-touch-punch' ),
array( 'json2', 'https://github.com/douglascrockford/JSON-js' ),
Expand Down
36 changes: 18 additions & 18 deletions api.wordpress.org/public_html/dotorg/slack/announce.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@

namespace Dotorg\Slack\Announce {

require dirname( dirname( __DIR__ ) ) . '/includes/slack/announce/lib.php';
require dirname( dirname( __DIR__ ) ) . '/includes/slack/announce/lib.php';

function get_avatar( $username, $slack_id, $team_id ) {
global $wpdb;
function get_avatar( $username, $slack_id, $team_id ) {
global $wpdb;

$wp_user_id = $wpdb->get_var( $wpdb->prepare(
$wp_user_id = $wpdb->get_var( $wpdb->prepare(
"SELECT user_id FROM slack_users WHERE slack_id = %s",
$slack_id
) );
) );

$email = $wpdb->get_var( $wpdb->prepare(
"SELECT user_email FROM $wpdb->users WHERE ID = %d",
$wp_user_id
) );
$email = $wpdb->get_var( $wpdb->prepare(
"SELECT user_email FROM $wpdb->users WHERE ID = %d",
$wp_user_id
) );

$hash = hash( 'sha256', strtolower( trim( $email ) ) );
return sprintf( 'https://secure.gravatar.com/avatar/%s?s=96d=mm&r=G&%s', $hash, time() );
}
$hash = hash( 'sha256', strtolower( trim( $email ) ) );
return sprintf( 'https://secure.gravatar.com/avatar/%s?s=96d=mm&r=G&%s', $hash, time() );
}

$i = 0;
// WEBHOOK_TOKEN_1, WEBHOOK_TOKEN_2, etc.
while ( defined( __NAMESPACE__ . '\\WEBHOOK_TOKEN_' . ++$i ) ) {
if ( hash_equals( constant( __NAMESPACE__ . '\\WEBHOOK_TOKEN_' . $i ), $_POST['token'] ) ) {
run( $_POST );
$i = 0;
// WEBHOOK_TOKEN_1, WEBHOOK_TOKEN_2, etc.
while ( defined( __NAMESPACE__ . '\\WEBHOOK_TOKEN_' . ++$i ) ) {
if ( hash_equals( constant( __NAMESPACE__ . '\\WEBHOOK_TOKEN_' . $i ), $_POST['token'] ) ) {
run( $_POST );
}
}
}

}

112 changes: 56 additions & 56 deletions api.wordpress.org/public_html/dotorg/slack/security-team.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,80 +8,80 @@

namespace Dotorg\Slack\Security_Team {

require dirname( dirname( __DIR__ ) ) . '/includes/slack-config.php';
require dirname( dirname( __DIR__ ) ) . '/includes/slack-config.php';

function slack_api( $method, $content = array() ) {
$content['token'] = SLACK_TOKEN;
$content = http_build_query( $content );
$context = stream_context_create( array(
function slack_api( $method, $content = array() ) {
$content['token'] = SLACK_TOKEN;
$content = http_build_query( $content );
$context = stream_context_create( array(
'http' => array(
'method' => 'POST',
'header' => 'Content-Type: application/x-www-form-urlencoded' . PHP_EOL,
'content' => $content,
),
) );
) );

$response = file_get_contents( 'https://slack.com/api/' . $method, false, $context );
return json_decode( $response, true );
}
$response = file_get_contents( 'https://slack.com/api/' . $method, false, $context );
return json_decode( $response, true );
}

/**
* Returns array of security team members by specified field value.
*
* @param string $user_field Optional. The user column value to return for each security team member. Defaut 'user_login'.
* @return array
*/
function get_security_team( $user_field = 'user_login' ) {
global $wpdb;
$group = slack_api( 'groups.info', array( 'channel' => SECURITY_GROUP_ID ) );

if ( empty( $group['ok'] ) ) {
return false;
/**
* Returns array of security team members by specified field value.
*
* @param string $user_field Optional. The user column value to return for each security team member. Defaut 'user_login'.
* @return array
*/
function get_security_team( $user_field = 'user_login' ) {
global $wpdb;
$group = slack_api( 'groups.info', array( 'channel' => SECURITY_GROUP_ID ) );

if ( empty( $group['ok'] ) ) {
return false;
}

$slack_user_ids = $group['group']['members'];
$slack_user_ids = array_filter( $slack_user_ids, function( $user_id ) {
return (bool) preg_match( '/^U[A-Z0-9]+$/', $user_id );
});
$slack_user_ids_for_sql = "'" . implode( "', '", $slack_user_ids ) . "'";
$user_ids = $wpdb->get_col( "SELECT user_id FROM slack_users WHERE slack_id IN ($slack_user_ids_for_sql)" );

$user_ids = array_map( 'intval', $user_ids );
$user_ids_for_sql = implode( ', ', $user_ids );

// Whitelist user field before using.
if ( ! in_array( $user_field, array( 'ID', 'user_email', 'user_login', 'user_nicename', 'display_name' ) ) ) {
$user_field = 'user_login';
}

$user_logins = $wpdb->get_col( "SELECT $user_field FROM $wpdb->users WHERE ID IN ($user_ids_for_sql)" );
return $user_logins;
}

$slack_user_ids = $group['group']['members'];
$slack_user_ids = array_filter( $slack_user_ids, function( $user_id ) {
return (bool) preg_match( '/^U[A-Z0-9]+$/', $user_id );
});
$slack_user_ids_for_sql = "'" . implode( "', '", $slack_user_ids ) . "'";
$user_ids = $wpdb->get_col( "SELECT user_id FROM slack_users WHERE slack_id IN ($slack_user_ids_for_sql)" );
function api_call() {
header( 'Content-type: text/plain' );

$user_ids = array_map( 'intval', $user_ids );
$user_ids_for_sql = implode( ', ', $user_ids );
// Confirm it came from the Trac server.
if ( ! hash_equals( API_TOKEN, $_GET['token'] ?? '' ) ) {
exit;
}

// Whitelist user field before using.
if ( ! in_array( $user_field, array( 'ID', 'user_email', 'user_login', 'user_nicename', 'display_name' ) ) ) {
$user_field = 'user_login';
}
if ( isset( $_GET['user_field'] ) && 'user_email' === $_GET['user_field'] ) {
$user_field = 'user_email';
}

$user_logins = $wpdb->get_col( "SELECT $user_field FROM $wpdb->users WHERE ID IN ($user_ids_for_sql)" );
return $user_logins;
}

function api_call() {
header( 'Content-type: text/plain' );
$team = get_security_team( $user_field );
if ( $team === false ) {
exit;
}

// Confirm it came from the Trac server.
if ( ! hash_equals( API_TOKEN, $_GET['token'] ?? '' ) ) {
echo implode( "\n", $team ) . "\n"; // Trailing newline critical.
exit;
}

$user_field = 'user_login';
if ( isset( $_GET['user_field'] ) && 'user_email' === $_GET['user_field'] ) {
$user_field = 'user_email';
}

$team = get_security_team( $user_field );
if ( $team === false ) {
exit;
if ( isset( $_SERVER['REQUEST_URI'] ) && false !== strpos( $_SERVER['REQUEST_URI'], '/security-team.php?token=' ) ) {
api_call();
}

echo implode( "\n", $team ) . "\n"; // Trailing newline critical.
exit;
}

if ( isset( $_SERVER['REQUEST_URI'] ) && false !== strpos( $_SERVER['REQUEST_URI'], '/security-team.php?token=' ) ) {
api_call();
}

}
Loading
Loading