Changeset 1178698
- Timestamp:
- 06/11/2015 03:04:09 AM (11 years ago)
- Location:
- genoo/trunk
- Files:
-
- 10 edited
-
Genoo.php (modified) (1 diff)
-
GenooInit.php (modified) (1 diff)
-
assets/Genoo.js (modified) (5 diffs)
-
assets/GenooTinyMCECTA.php (modified) (1 diff)
-
assets/GenooTinyMCEForm.php (modified) (1 diff)
-
assets/GenooTinyMCELumens.php (modified) (1 diff)
-
assets/TinyMCEHanlder.php (modified) (9 diffs)
-
libs/Genoo/Admin.php (modified) (1 diff)
-
libs/Genoo/Frontend.php (modified) (10 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
genoo/trunk/Genoo.php
r1172260 r1178698 6 6 Author URI: http://www.genoo.com/ 7 7 Author Email: info@genoo.com 8 Version: 2. 78 Version: 2.8.5 9 9 License: GPLv2 10 10 Text Domain: genoo -
genoo/trunk/GenooInit.php
r1172260 r1178698 48 48 define('GENOO_HOME_URL',get_option('siteurl')); 49 49 define('GENOO_FOLDER', plugins_url(NULL, __FILE__)); 50 define('GENOO_ROOT', dirname(__FILE__) . DIRECTORY_SEPARATOR); 50 51 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); 52 53 define('GENOO_CACHE', GENOO_ROOT . 'cache' . DIRECTORY_SEPARATOR); 53 54 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')); 55 56 // start the engine last file to require, rest is auto 56 57 // custom auto loader, PSR-0 Standard -
genoo/trunk/assets/Genoo.js
r1121144 r1178698 1180 1180 GenooTinyMCE.addPlugin.log('Button: ' + buttonTitle); 1181 1181 1182 1183 1182 /** 1184 1183 * Replace Shortcode … … 1244 1243 return contentNew; 1245 1244 }; 1246 1247 1245 1248 1246 // Version 4 and above … … 1324 1322 query['commandRefresh'] = buttonCommandRefresh; 1325 1323 ed.windowManager.open({ 1326 file : url + '/' + pluginFile + '?' + Admin.buildQuery(query),1324 file : GenooVars.GenooTinyMCE.url + pluginFile + '&' + Admin.buildQuery(query), 1327 1325 width : options.width + parseInt(ed.getLang('example.delta_width', 0)), 1328 1326 height : options.height + parseInt(ed.getLang('example.delta_height', 0)), … … 1338 1336 query['commandRefresh'] = buttonCommandRefresh; 1339 1337 ed.windowManager.open({ 1340 file : url + '/' + pluginFile + '?' + Admin.buildQuery(query),1338 file : GenooVars.GenooTinyMCE.url + pluginFile + '&' + Admin.buildQuery(query), 1341 1339 width : options.width + parseInt(ed.getLang('example.delta_width', 0)), 1342 1340 height : options.height + parseInt(ed.getLang('example.delta_height', 0)), … … 1362 1360 // Version 3 1363 1361 } else if(Tool.versionCompare(TinyMCEVersion, '3', '>=')){ 1364 // Todo add version 31365 } 1366 }; 1362 // Do we still support older TinyMCE? 1363 } 1364 }; -
genoo/trunk/assets/GenooTinyMCECTA.php
r1121144 r1178698 15 15 16 16 // Include parent class 17 if(file_exists( 'TinyMCEHanlder.php')){17 if(file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'TinyMCEHanlder.php')){ 18 18 require_once 'TinyMCEHanlder.php'; 19 19 } -
genoo/trunk/assets/GenooTinyMCEForm.php
r1121144 r1178698 15 15 16 16 // Include parent class 17 if(file_exists( 'TinyMCEHanlder.php')){17 if(file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'TinyMCEHanlder.php')){ 18 18 require_once 'TinyMCEHanlder.php'; 19 19 } -
genoo/trunk/assets/GenooTinyMCELumens.php
r1121144 r1178698 15 15 16 16 // Include parent class 17 if(file_exists( 'TinyMCEHanlder.php')){17 if(file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'TinyMCEHanlder.php')){ 18 18 require_once 'TinyMCEHanlder.php'; 19 19 } 20 21 20 22 21 /** -
genoo/trunk/assets/TinyMCEHanlder.php
r1121144 r1178698 12 12 * Class TinyMCEHanlder 13 13 */ 14 15 14 abstract class TinyMCEHanlder 16 15 { … … 38 37 * @param $shortcode 39 38 */ 40 41 39 public function __construct($shortcode) 42 40 { … … 55 53 * Resolve GET parameters 56 54 */ 57 58 55 public function resolve() 59 56 { … … 75 72 * @return array|string 76 73 */ 77 78 74 public static function parseAtts($text) 79 75 { 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); 99 79 return $atts; 100 80 } … … 106 86 * @return string 107 87 */ 108 109 88 public function shortcodeRegex() 110 89 { … … 150 129 * from extending classes. 151 130 */ 152 153 131 public function render() 154 132 { … … 305 283 * this will be overwritten by each extending class. 306 284 */ 307 308 285 public function renderJavascript(){} 309 286 … … 313 290 * the extending class. 314 291 */ 315 316 292 public function renderForm(){} 317 293 … … 320 296 * To be overwritten by extending class. 321 297 */ 322 323 298 public function resolveSecond(){} 324 299 } -
genoo/trunk/libs/Genoo/Admin.php
r1172260 r1178698 132 132 'lumens' => $this->repositaryLumens->getLumensArray(), 133 133 'ctas' => $this->repositaryCTAs->getArray(), 134 'cta-pt' => $this->repositarySettings->getCTAPostTypes() 134 'cta-pt' => $this->repositarySettings->getCTAPostTypes(), 135 'url' => Utils::addQueryParam(GENOO_HOME_URL, 'genooIframe=', '') 135 136 ) 136 137 )); -
genoo/trunk/libs/Genoo/Frontend.php
r1172260 r1178698 19 19 Genoo\HtmlForm, 20 20 Genoo\Wordpress\Widgets; 21 use Genoo\Utils\Strings; 21 22 use Genoo\Wordpress\Debug; 22 23 use Genoo\Wordpress\Post; … … 31 32 32 33 /** 33 * Constructor 34 */ 35 34 * Construct Frontend 35 * 36 * @param RepositorySettings $repositorySettings 37 */ 36 38 public function __construct(RepositorySettings $repositorySettings) 37 39 { … … 54 56 * Init, rewrite rules for mobiles windows 55 57 */ 56 57 58 public function init() 58 59 { 59 60 Filter::add('query_vars', function($query_vars){ 60 61 $query_vars[] = 'genooMobileWindow'; 62 $query_vars[] = 'genooIframe'; 61 63 return $query_vars; 62 64 }, 10, 1); … … 68 70 Frontend::renderMobileWindow(); 69 71 } 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 } 70 85 }); 71 86 Widgets::refreshDynamic(); … … 79 94 * @param $wp 80 95 */ 81 82 96 public function wp($wp) 83 97 { … … 114 128 * Enqueue 115 129 */ 116 117 130 public function enqueue() 118 131 { … … 130 143 * Footer first 131 144 */ 132 133 145 public function footerFirst() 134 146 { … … 144 156 * Footer last 145 157 */ 146 147 158 public function footerLast() 148 159 { … … 192 203 * Render mobile window 193 204 */ 194 195 205 public static function renderMobileWindow() 196 206 { … … 211 221 } 212 222 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 213 232 214 233 /** -
genoo/trunk/readme.txt
r1172260 r1178698 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html 8 Stable tag: 2. 78 Stable tag: 2.8.5 9 9 10 10 Combine the flexibility of WordPress with the power of Genoo and experience amazing results! … … 69 69 == Changelog == 70 70 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 71 74 = 2.8 = 72 75 * Added dynamic CTA validation
Note: See TracChangeset
for help on using the changeset viewer.