Plugin Directory

Changeset 1038273


Ignore:
Timestamp:
12/04/2014 04:35:30 PM (11 years ago)
Author:
PaulHughes01
Message:

3.0.2.3 Hotfix

Location:
muut/tags/3.0.2.3/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • muut/tags/3.0.2.3/lib/admin/admin-field-validation.utility.class.php

    r1024009 r1038273  
    114114            }
    115115        }
     116
     117        /**
     118         * Function to validate that a is regular-expression save (does not need to be escaped in any way)..
     119         *
     120         * @param string $value The value that we are validating.
     121         * @return bool Whether the field is valid or not.
     122         * @author Paul Hughes
     123         * @since 3.0.2
     124         */
     125        public static function validateNoRegexEscaping( $value ) {
     126            $escaped = preg_quote( $value );
     127
     128            if ( $escaped != $value ) {
     129                return false;
     130            } else {
     131                return true;
     132            }
     133        }
    116134    }
    117135}
  • muut/tags/3.0.2.3/lib/admin/admin-settings.class.php

    r1024009 r1038273  
    291291                    $value = trim( $value );
    292292                    // Make sure the forum name has no whitespace.
    293                     $valid = Muut_Field_Validation::validateHasNoWhitespace( $value );
     293                    $valid = Muut_Field_Validation::validateHasNoWhitespace( $value ) && Muut_Field_Validation::validateNoRegexEscaping( $value );
    294294
    295295                    if ( !$valid ) {
    296296                        $error_args = array(
    297297                            'name' => $name,
    298                             'message' => __( 'Forum name must contain no spaces of any kind. Make sure the forum name is the name you registered with Muut when you set up the forum.', 'muut' ),
     298                            'message' => __( 'Forum name must contain no spaces or special characters of any kind. Make sure the forum name is the name you registered with Muut when you set up the forum.', 'muut' ),
    299299                            'field' => 'muut_forum_name',
    300300                            'new_value' => $value,
  • muut/tags/3.0.2.3/lib/escaped-fragments.class.php

    r1024009 r1038273  
    184184            if ( $this->isUsingEscapedFragments() )  {
    185185                $post_commenting_options = Muut_Post_Utility::getPostOption( $post_id, 'commenting_settings' );
    186                 if ( $post_commenting_options['type'] == 'threaded' ) {
     186                if ( isset( $post_commenting_options['type'] ) && $post_commenting_options['type'] == 'threaded' ) {
    187187                    $this->context = 'threaded-commenting';
    188188                } else {
  • muut/tags/3.0.2.3/lib/muut.class.php

    r1024009 r1038273  
    345345                    'RewriteEngine On',
    346346                    'RewriteBase /',
    347                     'RewriteRule ^i/(' . $this->getForumName() . ')(/.*)?$ ' . $this->getProxyContentServer() . '/$1$2 [P]',
     347                    'RewriteRule ^i/(' . preg_quote( $this->getForumName() ) . ')(/.*)?$ ' . $this->getProxyContentServer() . '/$1$2 [P]',
    348348                    'RewriteRule ^m/(.*)$ http://' . self::MUUTSERVERS . '/m/$1 [P]',
    349349                    '</IfModule>',
     
    372372            $permastruct = get_option( 'permalink_structure', '' );
    373373
    374             $muut_rules = "RewriteRule ^i/(" . $this->getForumName() . ")(/.*)?\$ " . $this->getProxyContentServer() . "/\$1\$2 [P]\n";
     374            $muut_rules = "RewriteRule ^i/(" . preg_quote( $this->getForumName() ) . ")(/.*)?\$ " . $this->getProxyContentServer() . "/\$1\$2 [P]\n";
    375375            $muut_rules .=  "RewriteRule ^m/(.*)$ http://" . self::MUUTSERVERS . "/m/\$1 [P]";
    376376
  • muut/tags/3.0.2.3/lib/shortcodes.class.php

    r1024009 r1038273  
    283283                    $post = get_post( $page_id );
    284284                }
    285                 if ( has_shortcode( $post->post_content, 'muut' ) || has_shortcode( $post->post_content, 'moot' ) ) {
     285                if (  isset( $post ) && is_a( $post, 'WP_Post' ) && ( has_shortcode( $post->post_content, 'muut' ) || has_shortcode( $post->post_content, 'moot' ) ) ) {
    286286                    $requires_resources = true;
    287287                }
Note: See TracChangeset for help on using the changeset viewer.