Plugin Directory

Changeset 1246852


Ignore:
Timestamp:
09/16/2015 07:43:44 PM (11 years ago)
Author:
RylanH
Message:

Fixes for authors having images stripped out

Location:
storyform/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • storyform/trunk/class-storyform-editor-page.php

    r1245485 r1246852  
    105105        $post_type = isset( $_GET[ 'post_type' ] ) ? $_GET['post_type'] : null;
    106106
     107        $version_params = ('wp_version=' . get_bloginfo('version')) . '&' . ('sfp_version=' . $storyform_version) . '&' . ('app_key=' . Storyform_Options::get_instance()->get_application_key());
     108
    107109        if( $post_id ){
    108             $url = $hostname . '/posts/' . $post_id . '/edit-wp?' . ('wp_version=' . get_bloginfo('version')) . '&' . ('sfp_version=' . $storyform_version);
     110            $url = $hostname . '/posts/' . $post_id . '/edit-wp?' . $version_params;
    109111
    110112            // Setting template if not for existing post
     
    115117
    116118        } else {
    117             $url = $hostname . '/posts/new-wp?' . ($post_type ? 'post_type=' . $post_type : '') . ('wp_version=' . get_bloginfo('version')) . '&' . ('sfp_version=' . $storyform_version);
     119            $url = $hostname . '/posts/new-wp?' . ( $post_type ? 'post_type=' . ( $post_type . '&' ) : '' ) . $version_params;
    118120        }
    119121       
     
    199201        $template = isset( $_POST['template'] ) ? sanitize_text_field( $_POST['template'] ) : null;
    200202
     203        // Ensure XHTML balancing doesn't ruin custom elements with "-" in them (<post-publisher>)
     204        // and ensure even Author's (not just admins) can add <picture> elements and other custom elements
    201205        add_filter( 'pre_option_use_balanceTags', array( $this, 'avoid_balance_tags' ) );
     206        kses_remove_filters();
    202207
    203208        // Check if we've already published, if so create revision
  • storyform/trunk/editor/editor.js

    r1237746 r1246852  
    21282128        })
    21292129    });
     2130}
     2131
     2132// Production steps of ECMA-262, Edition 6, 22.1.2.1
     2133// Reference: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from
     2134if (!Array.from) {
     2135    Array.from = (function () {
     2136        var toStr = Object.prototype.toString;
     2137        var isCallable = function isCallable(fn) {
     2138            return typeof fn === "function" || toStr.call(fn) === "[object Function]";
     2139        };
     2140        var toInteger = function toInteger(value) {
     2141            var number = Number(value);
     2142            if (isNaN(number)) {
     2143                return 0;
     2144            }
     2145            if (number === 0 || !isFinite(number)) {
     2146                return number;
     2147            }
     2148            return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
     2149        };
     2150        var maxSafeInteger = Math.pow(2, 53) - 1;
     2151        var toLength = function toLength(value) {
     2152            var len = toInteger(value);
     2153            return Math.min(Math.max(len, 0), maxSafeInteger);
     2154        };
     2155
     2156        // The length property of the from method is 1.
     2157        return function from(arrayLike /*, mapFn, thisArg */) {
     2158            // 1. Let C be the this value.
     2159            var C = this;
     2160
     2161            // 2. Let items be ToObject(arrayLike).
     2162            var items = Object(arrayLike);
     2163
     2164            // 3. ReturnIfAbrupt(items).
     2165            if (arrayLike == null) {
     2166                throw new TypeError("Array.from requires an array-like object - not null or undefined");
     2167            }
     2168
     2169            // 4. If mapfn is undefined, then let mapping be false.
     2170            var mapFn = arguments.length > 1 ? arguments[1] : void undefined;
     2171            var T;
     2172            if (typeof mapFn !== "undefined") {
     2173                // 5. else     
     2174                // 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
     2175                if (!isCallable(mapFn)) {
     2176                    throw new TypeError("Array.from: when provided, the second argument must be a function");
     2177                }
     2178
     2179                // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.
     2180                if (arguments.length > 2) {
     2181                    T = arguments[2];
     2182                }
     2183            }
     2184
     2185            // 10. Let lenValue be Get(items, "length").
     2186            // 11. Let len be ToLength(lenValue).
     2187            var len = toLength(items.length);
     2188
     2189            // 13. If IsConstructor(C) is true, then
     2190            // 13. a. Let A be the result of calling the [[Construct]] internal method of C with an argument list containing the single item len.
     2191            // 14. a. Else, Let A be ArrayCreate(len).
     2192            var A = isCallable(C) ? Object(new C(len)) : new Array(len);
     2193
     2194            // 16. Let k be 0.
     2195            var k = 0;
     2196            // 17. Repeat, while k < len… (also steps a - h)
     2197            var kValue;
     2198            while (k < len) {
     2199                kValue = items[k];
     2200                if (mapFn) {
     2201                    A[k] = typeof T === "undefined" ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
     2202                } else {
     2203                    A[k] = kValue;
     2204                }
     2205                k += 1;
     2206            }
     2207            // 18. Let putStatus be Put(A, "length", len, true).
     2208            A.length = len;
     2209            // 20. Return A.
     2210            return A;
     2211        };
     2212    })();
    21302213}
    21312214
  • storyform/trunk/media/storyform-media.php

    r1225531 r1246852  
    8787
    8888    $tags = array(
     89        'picture' => array(),
    8990        'iframe' => array(
    9091            'data-area-crop' => true,
  • storyform/trunk/storyform.php

    r1237746 r1246852  
    55Plugin Name:  Storyform
    66Plugin URI:   http://storyform.co/docs/wordpress
    7 Version:      0.6.6
     7Version:      0.6.7
    88Description:  Plugin to enable Storyform on select posts. Works with both SEO and non-SEO permalinks.
    99Author:       Storyform
     
    1313
    1414global $storyform_version;
    15 $storyform_version = '0.6.6'; // The plugin version
     15$storyform_version = '0.6.7'; // The plugin version
    1616
    1717require_once( dirname( __FILE__ ) . '/config.php');
Note: See TracChangeset for help on using the changeset viewer.