Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions inc/class.embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ private function prepare_atts($atts): array
$url = sanitize_text_field($atts['url']);

// ensure url is sanitized correctly
if (str_contains($atts['url'], 'https://cal.com/')) {
if (strpos($atts['url'], 'https://cal.com/') !== false) {
$url = str_replace('https://cal.com/', '/', $url);
}
// 'https://' or 'http://' protocol indicate self-hosted instance
elseif (str_contains($atts['url'], 'https://') || str_contains($atts['url'], 'http://')) {
elseif (strpos($atts['url'], 'https://') !== false || strpos($atts['url'], 'http://') !== false) {
// Start searching after 'http(s)://'
$firstSlashPosition = strpos($url, '/', strlen(str_contains($atts['url'], 'https://') ? "https://" : "http://"));
$firstSlashPosition = strpos($url, '/', strlen(strpos($atts['url'], 'https://') !== false ? "https://" : "http://"));
$embed_custom_cal_url = substr($url, 0, $firstSlashPosition);
$url = substr($url, $firstSlashPosition);
}
Expand Down
6 changes: 3 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: calcom, turn2honey
Tags: appointment, appointment booking, appointment scheduling, booking calendar, calcom
Requires at least: 4.0
Tested up to: 6.0.1
Stable tag: 1.0.0
Requires PHP: 5.2.4
Tested up to: 6.8.2
Stable tag: 1.0.1
Requires PHP: 5.6
License: GNU General Public License
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html

Expand Down