#dev 2025-05-27

2025-05-27 UTC
grufwub, sebbu, NaomiAmethyst5, [aciccarello], barnaby, GuestZero, [Jo], NaomiAmethyst9, ttybitnik, thegreekgeek, GuestZero_, NaomiAmethyst1 and gRegor joined the channel
#
[tantek]
amazing, PHP8.0 changed (from all prev PHP versions) the return value of strpos for an empty needle! that's what broke my footnote auto-linking
#
[tantek]
trivia for PHP devs, this code will give you a different result in PHP8 vs PHP<8:
#
[tantek]
`echo (strpos('"\'',"")===false) ? "false" : strpos('"\'',"");`
#
[tantek]
PHP < 8 will return "false". PHP8 will return 0.
#
[tantek]
I think this is a bug in PHP8, because strpos is claiming that the empty string is present at position 0 in the source string. But that's not true, position 0 in the source string is the double quote character "
#
[tantek]
PHP8 broke the behavior documented in this comment: https://www.php.net/manual/en/function.strpos.php#120505
#
[tantek]
anyone have any experience filing bugs against https://github.com/php/php-src/issues/ ?
#
doesnm
lol php always have breaking changes
#
gRegor
Huh, interesting. No experience filing against src. I did find https://github.com/php/php-src/issues/8582, skimming it now
#
Loqi
[preview] [dmitrirussu] #8582 Empty string issue for strpos(), strrpos(), stripos(), strripos(), strstr(), strchr(), strrchr(), and stristr()
#
[tantek]
wow good find gRegor, yeah that's basically my issue
#
gRegor
Unfortunately looks like wontfix. There's a link at the end to the mailing list discussion that led to this, haven't read that yet.
#
[tantek]
I'm looking at that mailing list discussion and it's even more confusing
#
[tantek]
This is a pretty bad breaking change like many have complained
#
[social]
Yesterday I just resetup my PHP 5.6 move to 7.4 and tore my 2+ year old start on that work to retarget to PHP8.3. Fortunately I don’t have his currently in my code, but wondering what other “fun” I will hit.
rubenwardy joined the channel
#
rubenwardy
Hey! Does anyone have an example for a coffeeshop/cafe h-item - or, even better, a h-review of a coffee shop
#
rubenwardy
for more context, here's an LD+Json I'd like to represent in my microformats2: https://gist.github.com/rubenwardy/6bb825cc3d650501ff8bb845f0a8581a
#
rubenwardy
Side note, thinking it would be cool to make an indieweb review aggregator. Could parse microformats and aggregate reviews for places/things, and link out to the original websites
barnaby and balintm joined the channel
#
[tantek]
rubenwardy, do you have a human readable review of a coffee shop to look at instead?
#
rubenwardy
no publicly
#
rubenwardy
I think my main question is how to encode the coffee shop information - so name, address, google maps url
#
[tantek]
because that's the best way to mark something up with microformats, from the visible content.
#
[tantek]
all too often there is tons of extraneous info in other formats which users never see and there's no need to replicate that
#
[tantek]
gRegor it looks like that one class of changes (returning "0" for null needles) it breaking lots of things, and frankly, amazing that my site is running
#
[tantek]
when I tried to the obvious "workaround" to do the null needle test in my code before calling strpos, that resulted in some other unobvious hang
#
[tantek]
so there's a bunch that seems to be accidentally working in PHP8. going to require a deeper exploration
#
[tantek]
yeah it's bad. I have a feeling I'm going to uncover a handful of PHP8 incompatibilities
#
[tantek]
rubenwardy, re: "to encode the coffee shop information, name, address, google maps url" an h-card works for that
#
gRegor
Tend to agree with the one github commenter that this scenario should throw a ValueError, not return int(0)
#
[tantek]
agreed gRegor
#
[tantek]
returning int(0) is lying because if you retrieve position 0 from a non-null haystack string, and then strict compare that to null, it will be false
#
[tantek]
0 has actual meaning as a return value, and they just overloaded it with "it might also mean the needle was null"
#
capjamesg
rubenwardy I am thinking about this too!
#
capjamesg
This is kind of the direction I wanted to take Breakfast and Coffee.
#
capjamesg
I was planning to have like breakfastand.coffee/Edinburgh and it would list all the Edinburgh recommendations.
#
gRegor
[tantek], is your code sometimes passing a `null` as the needle?
#
gRegor
Without strict typing on, that `null` will be coerced into an empty string, so same as your code above under php8.
#
gRegor
Adding `declare(strict_types=1);` will make it throw a TypeError if a null gets passed as the needle
#
gRegor
though potentially causing other strict typing issues to track down
#
gRegor
strict_types is a bit of a headache at first on older code, but I've definitely become a fan
#
perryflynn
I love strict_types=1. migrated a 5.6 code base to 8.x lately and it is fantastic.
GuestZero joined the channel
#
[tantek]
gRegor, no, no nulls, but sometimes an empty string by way of computation
#
[tantek]
This is going to require more debugging than I have time for today / rest of this week unfortunately. Maybe weekend or next week
#
[tantek]
So far it is contained to cassis.js so the code is all public
#
Loqi
[preview] [rubenwardy] BlackBörk Coffee
#
gRegor
Understandable, [tantek]. I might have some time to poke around with cassis on php8, will let you know if I do.
barnaby and btrem joined the channel
#
btrem
I found an answer to a question that I posed several days ago: https://chat.indieweb.org/dev/2025-05-21/1747835211380300
#
Loqi
[preview] [btrem] I'm trying to figure out how js libraries like moment build strings using tokens. Anyone know where such a thing might be explained?
#
btrem
Though it's a bit old, the solution for me was https://www.npmjs.com/package/sprintf-js
#
[tantek]
rubenwardy++ that's a really nice review page/post!
#
Loqi
rubenwardy has 1 karma over the last year
#
btrem
It's a node version of sprint, and does exactly what I need. Provide a format string with tokens, and a value, and the module outputs the string with the value inserted where the tokens were.
#
rubenwardy
I'm thinking I'm going to change the permalink to /coffee/slug/ rather than having the date - it separates it more from blog posts and the date isn't as relevant I don't think
#
Loqi
rubenwardy has 2 karma over the last year
#
capjamesg
rubenwardy++ great design!
#
btrem
I spent the last day or so rewriting a README.md for a small GitHub project, with the result that it's getting too big. I'm new to this, but I think the convention is to create a /docs/ directory, and break up documentation into manageable bits. Are there any recommended links that provide guidelines for this? Common conventions, helpful tips, that sort of thing?
#
[tantek]
great question and I think it's case by case btrem? maybe ok to stick with subheads in one giant document where people can use "find in document" to find anything
#
[tantek]
gRegor do you prefer 3v4l over onlinephp for web-based PHP execution tool?
#
gRegor
I haven't used either much, just seen links from github issues. The php-src repo linked the 3v4l
#
gRegor
So no preference
balintm joined the channel
#
[tantek]
Schepp showed me the onlinephp tools at IWC DUS and it was invaluable with fixing PHP8 errors
#
gRegor
Nice. They look pretty similar at a glance
#
[tantek]
good to have more than one, in case one suddenly shuts down
bret joined the channel
#
rubenwardy
It's so hard to know if I'm doing something correctly because the microformats2 tools online just give me json and don't indicate any issues
#
rubenwardy
just noticed I should be using p-adr not p-address
grufwub joined the channel
#
rubenwardy
I feel like this could check h-review s too https://indiewebify.me/validate-h-entry/
#
rubenwardy
@capjamesg what is breakfastand.coffee going to be?
#
gRegor
Yeah, there's probably an issue for that on indiewebify.me github. It needs quite a few updates, unfortunately haven't had time to do it myself.
#
gRegor
There's not many consumers of h-review, though, so it's unlikely to cause problems
#
[tantek]
rubenwardy indeed! there's also a proposal to simplify h-review to being a form of h-entry instead
#
[tantek]
since there is a strong overlap
#
gRegor
ooh yeah, forgot I'd experimented with that
#
capjamesg
rubenwardy That is to be determined!
#
rubenwardy
what about reviews without a rating? Feels like that would be indistinguishable from an article
#
rubenwardy
oh the microformats blog mentions u-review-of, which would allow you to see it's a review
#
gRegor
Status of the indiewebify.me modernization if anyone wants to take it on: https://github.com/indieweb/indiewebify-me/issues/82
#
Loqi
[preview] [gRegorLove] #82 Migrate to Slim4 framework
#
[tantek]
what is Slim4
#
Loqi
It looks like we don't have a page for "Slim4" yet. Would you like to create it? (Or just say "Slim4 is ____", a sentence describing the term)
#
Loqi
[preview] [James] Adding review support to Breakfast and Coffee
#
gRegor
what is slim
#
Loqi
Slim is a lightweight PHP framework for developing web applications and is used by several IndieWeb services and projects https://indieweb.org/Slim
#
gRegor
Slim4 is /Slim
#
rubenwardy
@apjamesg ah interesting, sounds like my aggregator idea - although I wouldn't have used a mediawiki for it
#
rubenwardy
I don't really see many indiewebbers posting cafe reviews unfortunately
#
rubenwardy
The title of the page is determined by the title of the h-review -> should use p-item p-name
#
rubenwardy
or u-review-of when that's availabl
#
gRegor
Discussion for the h-review merge into h-entry: https://github.com/microformats/h-entry/issues/32
#
Loqi
[preview] [barnabywalters] #32 Consider merging h-review properties into h-entry
#
rubenwardy
where is it documented what h- p- u- etc actually means?
#
perryflynn
p- means plaintext and e- means embedded aka contains html.
#
[tantek]
rubenwardy, a handful of us built an hReview aggregator at Technorati over 20y ago. it was quite cool for a bit.
#
perryflynn
(I read that somehwhere on the microformats wiki)
#
[tantek]
perhaps on the prefixes page?
#
[tantek]
let's see if it's that findable...
#
rubenwardy
ah okay. and u for url
#
rubenwardy
the main pages on the wiki are pretty pants
#
rubenwardy
I've done `p-item h-card` for the item of the review
#
rubenwardy
seems fine
#
rubenwardy
[tantek] did many people use it?
#
rubenwardy
as in the authoring side, not the user side
#
btrem
I use `p-item h-item` for record reviews.
#
[tantek]
yes! it was the mid-2000s, everything new with blogs was fun to experiment with and lots of people tried out lots of things
#
capjamesg
rubenwardy I wouldn't use a MediaWiki again 😂
#
perryflynn
schmarty: since I switched to my own auth server the webring is returning "missing iss" as error on login. webring is redirecting to indielogin.com, this is then redirecting to my auth provider, which is returning the iss with it's own base url as value to indielogin.com and then indielogin.com is redirecting without an iss to webring. any idea what the issue is?
#
gRegor
What's your domain?
#
Loqi
[preview] [gRegor] [schmarty], I'm poking around the source code, I don't think I see `session_start()` being called. Presuming https://git.schmarty.net/schmarty/gem-diamond is still the correct source.
#
perryflynn
serverless.industries / intercom.serverless.industries
#
perryflynn
works without any issues on webmention.rocks for example. (the tests for receiving mentions asks for indieauth login)
#
gRegor
yeah, that .rocks site is probably on older version of the IndieAuth spec
[schmarty] joined the channel
#
[schmarty]
Seen a few folks with this issue. Two of them on WordPress with the IndieAuth plugin. I can sign in just fine so I have no easy debugging setup
#
gRegor
Did you have a chance to try that session_start update?
#
perryflynn
but it's not related to the fact that I created the webring membership initially with the indieweb auth provider, right? die webring/indielogin.com store which provider was used for creating the identity/membership?
#
gRegor
Shouldn't be, no. Pretty sure it just relies on the final `me` domain that is returned
#
gRegor
The `missing_iss` error comes from the php-indieauth-client lib that several implementations use. You could try signing in to indiebookclub.biz, which should be up to date with the spec, so handles the issuer.
#
gRegor
Should work as long as the returned `iss` is `https://intercom.serverless.industries`
#
perryflynn
Signed in as serverless.industries <-- works. :-)
#
gRegor
sweet (indiebookclub is also on php-indieauth-client)
#
perryflynn
nice, login even revokes the token on my side. ❤
#
perryflynn
*logout even revokes
#
gRegor
nice! always glad to see that's still working, haha