Permalink
Browse files

Get around length limit of mt_keywords by using description instead. F…

…ixes #2
  • Loading branch information...
captn3m0 committed Oct 26, 2013
1 parent 18ecab4 commit 6733bdb6a11bafb5754f5d4620ffdd5140553f7a
Showing with 9 additions and 7 deletions.
  1. +9 −7 xmlrpc.php
@@ -31,10 +31,9 @@
{
switch((string)$data->name)
{
//we use the tags field for providing webhook URL
case 'mt_keywords':
$url = $data->xpath('value/array/data/value/string');
$url = (string)$url[0];
//neglect these sections of the request
case 'post_status' ://publish status
case 'mt_keywords': //tags
break;
//the passed categories are parsed into an array
@@ -44,8 +43,11 @@
array_push($categories,(string)$cat);
$obj->categories = $categories;
break;
//this is used for title/description
case 'description':
$url = (string)$data->value->string;
break;
//this is used for title
default:
$obj->{$data->name} = (string)$data->value->string;
}
@@ -152,4 +154,4 @@ function valid_url($url, $absolute = FALSE) {
else {
return (bool) preg_match("/^(?:[\w#!:\.\?\+=&@$'~*,;\/\(\)\[\]\-]|%[0-9a-f]{2})+$/i", $url);
}
}
}

0 comments on commit 6733bdb

Please sign in to comment.