Advertisement
marikamitsos

wordpress Platform v1.4.3 + PHPv5.4 patch

Nov 27th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. http://wordpress.org/support/topic/php-54-compatibility
  2.  
  3. Platform breaks WP on PHP 5.4, because PHP warnings are generated before HTTP response headers are sent.
  4. The cause is that class properties are being accessed as objects, without instantiating them as (stdClass) objects first.
  5. I searched, but wasn't able to find where to contribute a patch for this, so for now:
  6.  
  7.  
  8. diff --git a/admin/class.options.metapanel.php b/admin/class.options.metapanel.php
  9. index 535c6ca..3aa6ffb 100644
  10. --- a/admin/class.options.metapanel.php
  11. +++ b/admin/class.options.metapanel.php
  12. @@ -45,7 +45,7 @@ class PageLinesMetaPanel {
  13. $key = $option_settings['id'];
  14.  
  15. if($location == 'top'){
  16. -
  17. + $top[$key] = new stdClass;
  18. $top[$key]->options = $option_array;
  19. $top[$key]->icon = $option_settings['icon'];
  20. $top[$key]->name = $option_settings['name'];
  21. @@ -53,6 +53,7 @@ class PageLinesMetaPanel {
  22. $this->tabs = array_merge($top, $this->tabs);
  23.  
  24. } else {
  25. + $this->tabs[$key] = new stdClass;
  26. $this->tabs[$key]->options = $option_array;
  27. $this->tabs[$key]->icon = $option_settings['icon'];
  28. $this->tabs[$key]->name = $option_settings['name'];
  29. diff --git a/includes/class.layout.php b/includes/class.layout.php
  30. index 4b0ffba..f35d52d 100644
  31. --- a/includes/class.layout.php
  32. +++ b/includes/class.layout.php
  33. @@ -159,7 +159,12 @@ class PageLinesLayout {
  34.  
  35. function set_layout_data(){
  36. -
  37. + foreach (array('hidden', 'main_content', 'sidebar1', 'sidebar2', 'content', 'gutter', 'builder', 'margin', 'dynamic_grid', 'clip', 'column_wrap', 'sidebar_wrap') as $property) {
  38. + if (!isset($this->$property)) {
  39. + $this->$property = new stdClass;
  40. + }
  41. + }
  42. +
  43. // Text & IDs
  44. $this->hidden->text = '';
  45. $this->hidden->id = 'hidden';
  46. @@ -318,6 +323,7 @@ class PageLinesLayout {
  47. /*
  48. Set Container width (content + gutter as margin prevents the wider area from being seen)
  49. */
  50. + $this->dcol[ $number_of_columns ] = new stdClass;
  51. $this->dcol[ $number_of_columns ]->container_width = $this->content->width + $column_gutter - $round_amount;
  52.  
  53. $column_space = floor( $this->dcol[ $number_of_columns ]->container_width / $number_of_columns );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement