Submit Plugin: "Nothing Submitted"
Here's an example of a url that will trigger the "Nothing Submitted" error on Submit step 1 even if something is submitted:
http://www.asahi.com/english/TKY201003170253.html
On closer inspection...
Array ( [submit_editorial] => [submit_orig_url] => http://www.asahi.com/english/TKY201003170253.html [submit_title] => asahi.com��ī��ʹ�ҡˡ�Internet posts held to libel standards - English )
The title is (if Assembla can show the Japanese characters):
asahi.com(朝日新聞社):Internet posts held to libel standards - English
When Submit tries to save the serialized array to the database in /submit/libs/SubmitFunctions.php line 264~, it gets cut oof when the characters begin:
a:3:{s:16:"submit_editorial";b:0;s:15:"submit_orig_url";s:49:"http://www.asahi.com/english/TKY201003170253.html";s:12:"submit_title";s:73:"asahi.com
Therefore, Hotaru is unable to unserialize it properly and the url is considered "false", hence "Nothing Submitted".
http://www.asahi.com/english/TKY201003170253.html
On closer inspection...
Array ( [submit_editorial] => [submit_orig_url] => http://www.asahi.com/english/TKY201003170253.html [submit_title] => asahi.com��ī��ʹ�ҡˡ�Internet posts held to libel standards - English )
The title is (if Assembla can show the Japanese characters):
asahi.com(朝日新聞社):Internet posts held to libel standards - English
When Submit tries to save the serialized array to the database in /submit/libs/SubmitFunctions.php line 264~, it gets cut oof when the characters begin:
a:3:{s:16:"submit_editorial";b:0;s:15:"submit_orig_url";s:49:"http://www.asahi.com/english/TKY201003170253.html";s:12:"submit_title";s:73:"asahi.com
Therefore, Hotaru is unable to unserialize it properly and the url is considered "false", hence "Nothing Submitted".
Leave a comment
on 2010-03-18 07:08 *
By nick_ramsay
I should also add that this doesn't apply to every server. On WampServer, it returns the title just fine.
on 2010-03-18 08:06 *
By nick_ramsay
The problem occurs on servers without libiconv (http://www.gnu.org/software/libiconv/)
http://php.net/manual/en/book.iconv.php
from SubmitFunctions.php, fetchTitle function:
I'm currently waiting for my webhost to respond to my request to enable iconv,
http://php.net/manual/en/book.iconv.php
from SubmitFunctions.php, fetchTitle function:
//you need iconv to encode to utf-8
if (function_exists("iconv"))
{
if (strcasecmp($encoding, 'utf-8') != 0) {
//convert the html code into utf-8 whatever encoding it is using
$string=iconv($encoding, 'UTF-8//IGNORE', $string);
}
}
I'm currently waiting for my webhost to respond to my request to enable iconv,
Fixed after adding the iconv lib to PHP.
One could also expand on the conditionals and perhaps use mb_convert_encoding if iconv is not available or use a fall back like
(found @ http://www.jpfox.fr/?post/2007/07/25/165-alternative-a-la-fonction-php-iconv)
if(!function_exists("iconv"))
{
function iconv($from, $to, $string)
{
$converted = htmlentities($string, ENT_NOQUOTES, $from); $converted = html_entity_decode($converted, ENT_NOQUOTES, $to); return $converted;
}
}
(found @ http://www.jpfox.fr/?post/2007/07/25/165-alternative-a-la-fonction-php-iconv)
on 2010-03-18 13:57 *
By nick_ramsay
Thanks William. I should put that in the next version.