Plugin Directory

Changeset 1178698


Ignore:
Timestamp:
06/11/2015 03:04:09 AM (11 years ago)
Author:
latorante
Message:

Updating to version 2.8.5

  • Adding workaround for servers, that don't allow direct excecution of php files in wp-content/plugins/*
Location:
genoo/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • genoo/trunk/Genoo.php

    r1172260 r1178698  
    66    Author URI: http://www.genoo.com/
    77    Author Email: info@genoo.com
    8     Version: 2.7
     8    Version: 2.8.5
    99    License: GPLv2
    1010    Text Domain: genoo
  • genoo/trunk/GenooInit.php

    r1172260 r1178698  
    4848        define('GENOO_HOME_URL',get_option('siteurl'));
    4949        define('GENOO_FOLDER',  plugins_url(NULL, __FILE__));
     50        define('GENOO_ROOT',    dirname(__FILE__) . DIRECTORY_SEPARATOR);
    5051        define('GENOO_ASSETS',  GENOO_FOLDER . '/assets/');
    51         define('GENOO_ROOT',    dirname(__FILE__) . DIRECTORY_SEPARATOR);
     52        define('GENOO_ASSETS_DIR', GENOO_ROOT . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR);
    5253        define('GENOO_CACHE',   GENOO_ROOT . 'cache' . DIRECTORY_SEPARATOR);
    5354        define('GENOO_DEBUG',   get_option('genooDebug'));
    54         define('GENOO_REFRESH', sha1('genoo-new-javascript-now-css-too'));
     55        define('GENOO_REFRESH', sha1('genoo-works-around-security-protocols'));
    5556        // start the engine last file to require, rest is auto
    5657        // custom auto loader, PSR-0 Standard
  • genoo/trunk/assets/Genoo.js

    r1121144 r1178698  
    11801180    GenooTinyMCE.addPlugin.log('Button: ' + buttonTitle);
    11811181
    1182 
    11831182    /**
    11841183     * Replace Shortcode
     
    12441243        return contentNew;
    12451244    };
    1246 
    12471245
    12481246    // Version 4 and above
     
    13241322                query['commandRefresh'] = buttonCommandRefresh;
    13251323                ed.windowManager.open({
    1326                     file : url + '/' + pluginFile + '?' + Admin.buildQuery(query),
     1324                    file : GenooVars.GenooTinyMCE.url + pluginFile + '&' + Admin.buildQuery(query),
    13271325                    width : options.width + parseInt(ed.getLang('example.delta_width', 0)),
    13281326                    height : options.height + parseInt(ed.getLang('example.delta_height', 0)),
     
    13381336                query['commandRefresh'] = buttonCommandRefresh;
    13391337                ed.windowManager.open({
    1340                     file : url + '/' + pluginFile + '?' + Admin.buildQuery(query),
     1338                    file : GenooVars.GenooTinyMCE.url + pluginFile + '&' + Admin.buildQuery(query),
    13411339                    width : options.width + parseInt(ed.getLang('example.delta_width', 0)),
    13421340                    height : options.height + parseInt(ed.getLang('example.delta_height', 0)),
     
    13621360        // Version 3
    13631361    } else if(Tool.versionCompare(TinyMCEVersion, '3', '>=')){
    1364         // Todo add version 3
    1365     }
    1366 };
     1362        // Do we still support older TinyMCE?
     1363    }
     1364};
  • genoo/trunk/assets/GenooTinyMCECTA.php

    r1121144 r1178698  
    1515
    1616// Include parent class
    17 if(file_exists('TinyMCEHanlder.php')){
     17if(file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'TinyMCEHanlder.php')){
    1818    require_once 'TinyMCEHanlder.php';
    1919}
  • genoo/trunk/assets/GenooTinyMCEForm.php

    r1121144 r1178698  
    1515
    1616// Include parent class
    17 if(file_exists('TinyMCEHanlder.php')){
     17if(file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'TinyMCEHanlder.php')){
    1818    require_once 'TinyMCEHanlder.php';
    1919}
  • genoo/trunk/assets/GenooTinyMCELumens.php

    r1121144 r1178698  
    1515
    1616// Include parent class
    17 if(file_exists('TinyMCEHanlder.php')){
     17if(file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'TinyMCEHanlder.php')){
    1818    require_once 'TinyMCEHanlder.php';
    1919}
    20 
    2120
    2221/**
  • genoo/trunk/assets/TinyMCEHanlder.php

    r1121144 r1178698  
    1212 * Class TinyMCEHanlder
    1313 */
    14 
    1514abstract class TinyMCEHanlder
    1615{
     
    3837     * @param $shortcode
    3938     */
    40 
    4139    public function __construct($shortcode)
    4240    {
     
    5553     * Resolve GET parameters
    5654     */
    57 
    5855    public function resolve()
    5956    {
     
    7572     * @return array|string
    7673     */
    77 
    7874    public static function parseAtts($text)
    7975    {
    80         $atts = array();
    81         $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/';
    82         $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text);
    83         if (preg_match_all($pattern, $text, $match, PREG_SET_ORDER)){
    84             foreach ($match as $m) {
    85                 if (!empty($m[1]))
    86                     $atts[strtolower($m[1])] = stripcslashes($m[2]);
    87                 elseif (!empty($m[3]))
    88                     $atts[strtolower($m[3])] = stripcslashes($m[4]);
    89                 elseif (!empty($m[5]))
    90                     $atts[strtolower($m[5])] = stripcslashes($m[6]);
    91                 elseif (isset($m[7]) and strlen($m[7]))
    92                     $atts[] = stripcslashes($m[7]);
    93                 elseif (isset($m[8]))
    94                     $atts[] = stripcslashes($m[8]);
    95             }
    96         } else {
    97             $atts = ltrim($text);
    98         }
     76        // We now include the file, so we can use WordPress inner Parse Attributes
     77        $text = str_replace("\'", "'", $text);
     78        $atts = shortcode_parse_atts($text);
    9979        return $atts;
    10080    }
     
    10686     * @return string
    10787     */
    108 
    10988    public function shortcodeRegex()
    11089    {
     
    150129     * from extending classes.
    151130     */
    152 
    153131    public function render()
    154132    {
     
    305283     * this will be overwritten by each extending class.
    306284     */
    307 
    308285    public function renderJavascript(){}
    309286
     
    313290     * the extending class.
    314291     */
    315 
    316292    public function renderForm(){}
    317293
     
    320296     * To be overwritten by extending class.
    321297     */
    322 
    323298    public function resolveSecond(){}
    324299}
  • genoo/trunk/libs/Genoo/Admin.php

    r1172260 r1178698  
    132132                    'lumens' => $this->repositaryLumens->getLumensArray(),
    133133                    'ctas'   => $this->repositaryCTAs->getArray(),
    134                     'cta-pt' => $this->repositarySettings->getCTAPostTypes()
     134                    'cta-pt' => $this->repositarySettings->getCTAPostTypes(),
     135                    'url'    => Utils::addQueryParam(GENOO_HOME_URL, 'genooIframe=', '')
    135136                )
    136137            ));
  • genoo/trunk/libs/Genoo/Frontend.php

    r1172260 r1178698  
    1919    Genoo\HtmlForm,
    2020    Genoo\Wordpress\Widgets;
     21use Genoo\Utils\Strings;
    2122use Genoo\Wordpress\Debug;
    2223use Genoo\Wordpress\Post;
     
    3132
    3233    /**
    33      * Constructor
    34      */
    35 
     34     * Construct Frontend
     35     *
     36     * @param RepositorySettings $repositorySettings
     37     */
    3638    public function __construct(RepositorySettings $repositorySettings)
    3739    {
     
    5456     * Init, rewrite rules for mobiles windows
    5557     */
    56 
    5758    public function init()
    5859    {
    5960        Filter::add('query_vars', function($query_vars){
    6061            $query_vars[] = 'genooMobileWindow';
     62            $query_vars[] = 'genooIframe';
    6163            return $query_vars;
    6264        }, 10, 1);
     
    6870                Frontend::renderMobileWindow();
    6971            }
     72            // If iframe load for backend, its safe to assume
     73            // that only logged in users will hava access to tinyMCE editor
     74            if(array_key_exists('genooIframe', $wp->query_vars) && is_user_logged_in()){
     75                // Only continue if file actually exists and iframe not empty
     76                if(!empty($wp->query_vars['genooIframe']) && file_exists(GENOO_ASSETS_DIR . $wp->query_vars['genooIframe'])){
     77                    // Since this could be potentionally hazardous, to display just any PHP file that is in the folder
     78                    // we will check if its GenooTinyMCE file first, just to be safe, and of course just those PHP iframe files, not any others.
     79                    if(Strings::startsWith($wp->query_vars['genooIframe'], 'GenooTinyMCE') && Strings::endsWith($wp->query_vars['genooIframe'], '.php')){
     80                        // No we have a winner.
     81                        Frontend::renderTinyMCEIframe($wp->query_vars['genooIframe']);
     82                    }
     83                }
     84            }
    7085        });
    7186        Widgets::refreshDynamic();
     
    7994     * @param $wp
    8095     */
    81 
    8296    public function wp($wp)
    8397    {
     
    114128     * Enqueue
    115129     */
    116 
    117130    public function enqueue()
    118131    {
     
    130143     * Footer first
    131144     */
    132 
    133145    public function footerFirst()
    134146    {
     
    144156     * Footer last
    145157     */
    146 
    147158    public function footerLast()
    148159    {
     
    192203     * Render mobile window
    193204     */
    194 
    195205    public static function renderMobileWindow()
    196206    {
     
    211221    }
    212222
     223    /**
     224     * Render iframe for TinyMCE admin editor
     225     */
     226    public static function renderTinyMCEIframe($file)
     227    {
     228        include_once GENOO_ASSETS_DIR . $file;
     229        exit();
     230    }
     231
    213232
    214233    /**
  • genoo/trunk/readme.txt

    r1172260 r1178698  
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
    8 Stable tag: 2.7
     8Stable tag: 2.8.5
    99
    1010Combine the flexibility of WordPress with the power of Genoo and experience amazing results!
     
    6969== Changelog ==
    7070
     71= 2.8.5 =
     72* Added compatibility for TinyMCE iframes when servers don't allow direct access to PHP files in wp-content/plugins/ directory.
     73
    7174= 2.8 =
    7275* Added dynamic CTA validation
Note: See TracChangeset for help on using the changeset viewer.