From c91b080a8e001c5940f0d48d1c80e3d10b07873f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 29 Dec 2010 16:18:43 -0800 Subject: [PATCH 1/8] version 0.9.8dev --- lib/common.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common.php b/lib/common.php index 5505dc39da..6138200e49 100644 --- a/lib/common.php +++ b/lib/common.php @@ -22,13 +22,13 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } //exit with 200 response, if this is checking fancy from the installer if (isset($_REQUEST['p']) && $_REQUEST['p'] == 'check-fancy') { exit; } -define('STATUSNET_BASE_VERSION', '0.9.7'); +define('STATUSNET_BASE_VERSION', '0.9.8'); define('STATUSNET_LIFECYCLE', 'dev'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release' define('STATUSNET_VERSION', STATUSNET_BASE_VERSION . STATUSNET_LIFECYCLE); define('LACONICA_VERSION', STATUSNET_VERSION); // compatibility -define('STATUSNET_CODENAME', 'World Leader Pretend'); +define('STATUSNET_CODENAME', 'Letter Never Sent'); define('AVATAR_PROFILE_SIZE', 96); define('AVATAR_STREAM_SIZE', 48); From 63c95484bd658056f36b726f1751ad310a85f5b9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 30 Dec 2010 13:21:59 -0800 Subject: [PATCH 2/8] Update ActivityCreationTests for our switch away from the obsolete --- tests/ActivityGenerationTests.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/ActivityGenerationTests.php b/tests/ActivityGenerationTests.php index b9e74a570a..8cf1b009ed 100644 --- a/tests/ActivityGenerationTests.php +++ b/tests/ActivityGenerationTests.php @@ -194,7 +194,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase $actor = ActivityUtils::child($element, 'actor', Activity::SPEC); $this->assertFalse(is_null($author)); - $this->assertFalse(is_null($actor)); + $this->assertTrue(is_null($actor)); // is obsolete, no longer added } public function testAuthorContent() @@ -213,6 +213,9 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase $this->assertEquals($this->author1->uri, ActivityUtils::childContent($author, 'uri')); } + /** + * We no longer create entries, they have merged to + */ public function testActorContent() { $notice = $this->_fakeNotice(); @@ -225,8 +228,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase $actor = ActivityUtils::child($element, 'actor', Activity::SPEC); - $this->assertEquals($this->author1->uri, ActivityUtils::childContent($actor, 'id')); - $this->assertEquals($this->author1->nickname, ActivityUtils::childContent($actor, 'title')); + $this->assertEquals($actor, null); } public function testReplyLink() From 80e2f4f529cac935d69dfb42a5bfdef82aa00dad Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 30 Dec 2010 17:11:16 -0800 Subject: [PATCH 3/8] Fix up edge case in nickname processing: overlong display forms should be rejected before normalization (storage of display forms will also have fields with limited length) --- lib/nickname.php | 10 ++++++---- tests/NicknameTest.php | 9 +++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/nickname.php b/lib/nickname.php index 562f1e2052..4d3795e392 100644 --- a/lib/nickname.php +++ b/lib/nickname.php @@ -103,15 +103,17 @@ class Nickname */ public static function normalize($str) { + if (mb_strlen($str) > self::MAX_LEN) { + // Display forms must also fit! + throw new NicknameTooLongException(); + } + $str = trim($str); $str = str_replace('_', '', $str); $str = mb_strtolower($str); - $len = mb_strlen($str); - if ($len < 1) { + if (mb_strlen($str) < 1) { throw new NicknameEmptyException(); - } else if ($len > self::MAX_LEN) { - throw new NicknameTooLongException(); } if (!self::isCanonical($str)) { throw new NicknameInvalidException(); diff --git a/tests/NicknameTest.php b/tests/NicknameTest.php index f49aeba602..66e883c049 100644 --- a/tests/NicknameTest.php +++ b/tests/NicknameTest.php @@ -33,9 +33,14 @@ class NicknameTest extends PHPUnit_Framework_TestCase if ($expected === false) { if ($expectedException) { + if ($exception) { + $stuff = get_class($exception) . ': ' . $exception->getMessage(); + } else { + $stuff = var_export($exception, true); + } $this->assertTrue($exception && $exception instanceof $expectedException, "invalid input '$input' expected to fail with $expectedException, " . - "got " . get_class($exception) . ': ' . $exception->getMessage()); + "got $stuff"); } else { $this->assertTrue($normalized == false, "invalid input '$input' expected to fail"); @@ -104,7 +109,7 @@ class NicknameTest extends PHPUnit_Framework_TestCase array('', false, 'NicknameEmptyException'), array('___', false, 'NicknameEmptyException'), array('eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'), // 64 chars - array('eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee_', 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'), // the _ will be trimmed off, remaining valid + array('eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee_', false, 'NicknameTooLongException'), // the _ is too long... array('eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', false, 'NicknameTooLongException'), // 65 chars -- too long ); } From fd205546512b75016b1e055aec24eab586ae818b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 3 Jan 2011 10:51:29 -0800 Subject: [PATCH 4/8] Revert "0.9.7alpha1" This reverts commit 3d62c1cf5114760c0a7b97cd69ba363ac059e215. --- lib/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.php b/lib/common.php index 22890b5cb7..5505dc39da 100644 --- a/lib/common.php +++ b/lib/common.php @@ -23,7 +23,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } if (isset($_REQUEST['p']) && $_REQUEST['p'] == 'check-fancy') { exit; } define('STATUSNET_BASE_VERSION', '0.9.7'); -define('STATUSNET_LIFECYCLE', 'alpha1'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release' +define('STATUSNET_LIFECYCLE', 'dev'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release' define('STATUSNET_VERSION', STATUSNET_BASE_VERSION . STATUSNET_LIFECYCLE); define('LACONICA_VERSION', STATUSNET_VERSION); // compatibility From 523d27501b05512c255b3488f94ae0922330cf0d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 4 Jan 2011 11:03:42 -0800 Subject: [PATCH 5/8] Typo fix: http://status.net/open-source/issues/2976 --- locale/fr/LC_MESSAGES/statusnet.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/fr/LC_MESSAGES/statusnet.po b/locale/fr/LC_MESSAGES/statusnet.po index ee415abb4f..32c774597d 100644 --- a/locale/fr/LC_MESSAGES/statusnet.po +++ b/locale/fr/LC_MESSAGES/statusnet.po @@ -8247,7 +8247,7 @@ msgstr "" #: lib/mail.php:680 #, php-format msgid "%1$s (@%2$s) sent a notice to your attention" -msgstr "%1$s (@%2$s) a envoyé un avis à vote attention" +msgstr "%1$s (@%2$s) a envoyé un avis à votre attention" #. TRANS: Body of @-reply notification e-mail. #. TRANS: %1$s is the sending user's long name, $2$s is the StatusNet sitename, From fb9ecddbf16ad3b33466732334aaafdd92719c30 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 4 Jan 2011 12:04:11 -0800 Subject: [PATCH 6/8] Ticket #2649: fix for undefined $base_url in lighttpd code path The $base_url var is never defined, and the code has actually always been wrong since it was added. Just removing it seems to work fine :) --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 9501e2275d..b2cf2d4a9d 100644 --- a/index.php +++ b/index.php @@ -204,7 +204,7 @@ function main() { // fake HTTP redirects using lighttpd's 404 redirects if (strpos($_SERVER['SERVER_SOFTWARE'], 'lighttpd') !== false) { - $_lighty_url = $base_url.$_SERVER['REQUEST_URI']; + $_lighty_url = $_SERVER['REQUEST_URI']; $_lighty_url = @parse_url($_lighty_url); if ($_lighty_url['path'] != '/index.php' && $_lighty_url['path'] != '/') { From af1cbc6fe32c3d181e1a6d7315634a975cb91c17 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 4 Jan 2011 13:09:44 -0800 Subject: [PATCH 7/8] Fix ticket #2181: Can't save #000000 (black) in color fields on design page It seems to have actually been saving correctly, but the update of the colors on the form success page wasn't working properly. When a design object is pulled out of the database, the numeric fields are read in as strings, so black comes back as "0". But, when we populate the new object and then stick it live, we've populated it with actual integers; with memcache on these might live for a while in the cache... The fallback code in Design::toWebColor() did a check ($color == null) which would be false for the string "0", but counts as true for the *integer* 0. Thus, the display code would initially interpret the correctly-saved black color as "use default". Changing the check to === against null and "" empty string avoids the false positive on integers, and lets us see our nice black text immediately after save. --- classes/Design.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Design.php b/classes/Design.php index a8fdb72191..f4834c714e 100644 --- a/classes/Design.php +++ b/classes/Design.php @@ -107,7 +107,7 @@ class Design extends Memcached_DataObject static function toWebColor($color) { - if ($color == null) { + if ($color === null || $color === '') { return null; } From 19a3b28898d1e5c390d76dca49ae32b02def1806 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 5 Jan 2011 09:39:36 -0800 Subject: [PATCH 8/8] Remove json2 author's "don't hotlink my script pls" alert line from our local copy of json2.js :D Added json2.min.js to the makefile so it can be updated easily when json2.js changes. --- js/Makefile | 9 ++++++--- js/json2.js | 1 - js/json2.min.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/js/Makefile b/js/Makefile index e7ae44e421..2f3dfcdf70 100644 --- a/js/Makefile +++ b/js/Makefile @@ -1,12 +1,15 @@ .fake: all clean -TARGETS=util.min.js -SOURCES=util.js xbImportNode.js geometa.js +TARGETS=util.min.js json2.min.js +UTIL_SOURCES=util.js xbImportNode.js geometa.js all: $(TARGETS) clean: rm -f $(TARGETS) -util.min.js: $(SOURCES) +util.min.js: $(UTIL_SOURCES) cat $+ | yui-compressor --type js > $@ + +json2.min.js: json2.js + yui-compressor $+ > $@ diff --git a/js/json2.js b/js/json2.js index e9ccc0d376..6bdea10e51 100644 --- a/js/json2.js +++ b/js/json2.js @@ -1,4 +1,3 @@ -alert('IMPORTANT: Remove this line from json2.js before deployment.'); /* http://www.JSON.org/json2.js 2010-08-25 diff --git a/js/json2.min.js b/js/json2.min.js index e84c5f70fc..08977b590c 100644 --- a/js/json2.min.js +++ b/js/json2.min.js @@ -1 +1 @@ -alert("IMPORTANT: Remove this line from json2.js before deployment.");if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i