Skip to content

Commit

Permalink
Get around length limit of mt_keywords by using description instead. F…
Browse files Browse the repository at this point in the history
…ixes #2
  • Loading branch information
captn3m0 committed Oct 26, 2013
1 parent 18ecab4 commit 6733bdb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions xmlrpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand Down Expand Up @@ -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.