Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: farinspace/wpalchemy
base: 92b87ee7f1
...
head fork: farinspace/wpalchemy
compare: 5351d00a9b
  • 4 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 20 additions and 17 deletions.
  1. +20 −17 wp-content/wpalchemy/MetaBox.php
View
37 wp-content/wpalchemy/MetaBox.php
@@ -5,7 +5,7 @@
* @copyright Copyright (c) 2009, Dimas Begunoff, http://farinspace.com
* @license http://en.wikipedia.org/wiki/MIT_License The MIT License
* @package WPAlchemy
- * @version 1.4.15
+ * @version 1.4.17
* @link http://github.com/farinspace/wpalchemy
* @link http://farinspace.com
*/
@@ -1017,26 +1017,29 @@ function _get_current_post_type()
{
$uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : NULL ;
- $uri_parts = parse_url($uri);
+ if ( isset( $uri ) )
+ {
+ $uri_parts = parse_url($uri);
- $file = basename($uri_parts['path']);
+ $file = basename($uri_parts['path']);
- if ($uri AND in_array($file, array('post.php', 'post-new.php')))
- {
- $post_id = WPAlchemy_MetaBox::_get_post_id();
+ if ($uri AND in_array($file, array('post.php', 'post-new.php')))
+ {
+ $post_id = WPAlchemy_MetaBox::_get_post_id();
- $post_type = isset($_GET['post_type']) ? $_GET['post_type'] : NULL ;
+ $post_type = isset($_GET['post_type']) ? $_GET['post_type'] : NULL ;
- $post_type = $post_id ? get_post_type($post_id) : $post_type ;
+ $post_type = $post_id ? get_post_type($post_id) : $post_type ;
- if (isset($post_type))
- {
- return $post_type;
- }
- else
- {
- // because of the 'post.php' and 'post-new.php' checks above, we can default to 'post'
- return 'post';
+ if (isset($post_type))
+ {
+ return $post_type;
+ }
+ else
+ {
+ // because of the 'post.php' and 'post-new.php' checks above, we can default to 'post'
+ return 'post';
+ }
}
}
@@ -2159,7 +2162,7 @@ function _save($post_id)
// authentication passed, save data
- $new_data = $_POST[$this->id];
+ $new_data = isset( $_POST[$this->id] ) ? $_POST[$this->id] : NULL ;
WPAlchemy_MetaBox::clean($new_data);

No commit comments for this range

Something went wrong with that request. Please try again.