Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/02/2008 02:53:07 PM (17 years ago)
Author:
sambauers
Message:

bb_uri() and bb_get_uri() commit bomb.

BB_URI_CONTEXT_* definitions applied to all link creation functions and passed to their filters.

First stages of SSL support for user forms (login, registration, etc.) and admin area.

Links rewritten for SSL at this stage, but pages are not yet forced to SSL if loaded as non-secure.

bb_force_ssl_user_forms() and bb_force_ssl_admin() also included.

Introducing new config constants, BB_FORCE_SSL_USER_FORMS and BB_FORCE_SSL_ADMIN.

New config variable $bb->uri_ssl, a complete URI for the SSL links to go to. If not set it is based on replacing http with https in $bb->uri.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-plugins/akismet.php

    r1385 r1575  
    8181function bb_akismet_verify_key( $key ) {
    8282    global $bb_ksd_api_port;
    83     $blog = urlencode( bb_get_option('uri') );
     83    $blog = urlencode( bb_get_uri(null, null, BB_URI_CONTEXT_TEXT + BB_URI_CONTEXT_AKISMET) );
    8484    $response = bb_ksd_http_post("key=$key&blog=$blog", 'rest.akismet.com', '/1.1/verify-key', $bb_ksd_api_port);
    8585    if ( 'valid' == $response[1] )
     
    128128
    129129        $_submit = array(
    130             'blog' => bb_get_option('uri'),
     130            'blog' => bb_get_uri(null, null, BB_URI_CONTEXT_TEXT + BB_URI_CONTEXT_AKISMET),
    131131            'user_ip' => $bb_post->poster_ip,
    132132            'permalink' => get_topic_link( $bb_post->topic_id ), // First page
     
    150150
    151151        $_submit = array(
    152             'blog' => bb_get_option('uri'),
     152            'blog' => bb_get_uri(null, null, BB_URI_CONTEXT_TEXT + BB_URI_CONTEXT_AKISMET),
    153153            'permalink' => get_user_profile_link( $user->ID ),
    154154            'comment_type' => 'profile',
     
    167167
    168168        $_submit = array(
    169             'blog' => bb_get_option('uri'),
     169            'blog' => bb_get_uri(null, null, BB_URI_CONTEXT_TEXT + BB_URI_CONTEXT_AKISMET),
    170170            'user_ip' => preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] ),
    171171            'user_agent' => $_SERVER['HTTP_USER_AGENT'],
     
    292292    if ( !bb_current_user_can('moderate') )
    293293        return $link;
    294     if ( 2 == $post_status )
    295         $link .= " <a href='" . attribute_escape( bb_nonce_url( bb_get_option('uri') . 'bb-admin/delete-post.php?id=' . get_post_id() . '&status=0&view=all', 'delete-post_' . get_post_id() ) ) . "' >" . __('Not Spam') ."</a>";
    296     else
    297         $link .= " <a href='" . attribute_escape( bb_nonce_url( bb_get_option('uri') . 'bb-admin/delete-post.php?id=' . get_post_id() . '&status=2', 'delete-post_' . get_post_id() ) ) . "' >" . __('Spam') ."</a>";
     294    if ( 2 == $post_status ) {
     295        $query = array(
     296            'id'     => get_post_id(),
     297            'status' => 0,
     298            'view'   => 'all'
     299        );
     300        $display = __('Not Spam');
     301    } else {
     302        $query = array(
     303            'id'     => get_post_id(),
     304            'status' => 2
     305        );
     306        $display = __('Spam');
     307    }
     308    $uri = bb_get_uri('bb-admin/delete-post.php', $query, BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN);
     309    $uri = attribute_escape( bb_nonce_url( $uri, 'delete-post_' . get_post_id() ) );
     310    $link .= " <a href='" . $uri . "' >" . $display ."</a>";
    298311    return $link;
    299312}
Note: See TracChangeset for help on using the changeset viewer.